From 3a7887348cc80ff7209ae193e22524a9bc49694b Mon Sep 17 00:00:00 2001 From: nym21 Date: Wed, 8 Apr 2026 12:09:35 +0200 Subject: [PATCH] global: snapshot --- .../src/generators/javascript/api.rs | 12 +- crates/brk_client/src/lib.rs | 5888 ++++++++++++++--- crates/brk_indexer/src/stores.rs | 2 - crates/brk_query/src/impl/block/info.rs | 59 +- .../src/impl/mining/block_fee_rates.rs | 7 +- crates/brk_query/src/impl/mining/hashrate.rs | 5 +- crates/brk_query/src/impl/tx.rs | 22 +- crates/brk_server/src/lib.rs | 5 +- crates/brk_store/src/lib.rs | 1 - crates/brk_types/src/cpfp.rs | 1 - crates/brk_types/src/dollars.rs | 8 +- crates/brk_types/src/feerate.rs | 9 +- crates/brk_types/src/raw_locktime.rs | 2 +- crates/brk_types/src/sats.rs | 10 +- crates/brk_types/src/timestamp.rs | 10 +- crates/brk_types/src/tx.rs | 3 +- crates/brk_types/src/tx_version_raw.rs | 8 +- crates/brk_types/src/vin.rs | 2 +- crates/brk_types/src/vout.rs | 2 +- crates/brk_types/src/vsize.rs | 8 +- crates/brk_types/src/weight.rs | 8 +- modules/brk-client/index.js | 2 +- modules/brk-client/package.json | 2 +- packages/brk_client/brk_client/__init__.py | 2 +- packages/brk_client/pyproject.toml | 2 +- website/scripts/explorer/address.js | 164 +- website/scripts/explorer/block.js | 16 +- website/scripts/explorer/chain.js | 31 +- website/scripts/explorer/index.js | 204 +- website/scripts/explorer/render.js | 29 +- website/scripts/explorer/tx.js | 38 +- website/scripts/utils/url.js | 20 +- website/styles/main.css | 2 +- website/styles/panes/explorer.css | 7 +- website/styles/panes/sim.css | 75 - website/styles/panes/table.css | 139 - 36 files changed, 5220 insertions(+), 1585 deletions(-) delete mode 100644 website/styles/panes/sim.css delete mode 100644 website/styles/panes/table.css diff --git a/crates/brk_bindgen/src/generators/javascript/api.rs b/crates/brk_bindgen/src/generators/javascript/api.rs index 153f8229d..1d3fcb769 100644 --- a/crates/brk_bindgen/src/generators/javascript/api.rs +++ b/crates/brk_bindgen/src/generators/javascript/api.rs @@ -127,9 +127,17 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { writeln!(output, " if (format === 'csv') {{").unwrap(); writeln!(output, " return this.getText(path, {{ signal }});").unwrap(); writeln!(output, " }}").unwrap(); - writeln!(output, " return this.getJson(path, {{ signal, onUpdate }});").unwrap(); + writeln!( + output, + " return this.getJson(path, {{ signal, onUpdate }});" + ) + .unwrap(); } else { - writeln!(output, " return this.getJson(path, {{ signal, onUpdate }});").unwrap(); + writeln!( + output, + " return this.getJson(path, {{ signal, onUpdate }});" + ) + .unwrap(); } } diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 723672207..e2a616fec 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -7,12 +7,11 @@ #![allow(clippy::useless_format)] #![allow(clippy::unnecessary_to_owned)] -use std::sync::Arc; -use std::ops::{Bound, RangeBounds}; -use serde::de::DeserializeOwned; pub use brk_cohort::*; pub use brk_types::*; - +use serde::de::DeserializeOwned; +use std::ops::{Bound, RangeBounds}; +use std::sync::Arc; /// Error type for BRK client operations. #[derive(Debug)] @@ -57,7 +56,10 @@ pub struct BrkClientBase { impl BrkClientBase { /// Create a new client with the given base URL. pub fn new(base_url: impl Into) -> Self { - Self::with_options(BrkClientOptions { base_url: base_url.into(), ..Default::default() }) + Self::with_options(BrkClientOptions { + base_url: base_url.into(), + ..Default::default() + }) } /// Create a new client with options. @@ -78,36 +80,49 @@ impl BrkClientBase { /// Make a GET request and deserialize JSON response. pub fn get_json(&self, path: &str) -> Result { - self.agent.get(&self.url(path)) + self.agent + .get(&self.url(path)) .call() .and_then(|mut r| r.body_mut().read_json()) - .map_err(|e| BrkError { message: e.to_string() }) + .map_err(|e| BrkError { + message: e.to_string(), + }) } /// Make a GET request and return raw text response. pub fn get_text(&self, path: &str) -> Result { - self.agent.get(&self.url(path)) + self.agent + .get(&self.url(path)) .call() .and_then(|mut r| r.body_mut().read_to_string()) - .map_err(|e| BrkError { message: e.to_string() }) + .map_err(|e| BrkError { + message: e.to_string(), + }) } } /// Build series name with suffix. #[inline] fn _m(acc: &str, s: &str) -> String { - if s.is_empty() { acc.to_string() } - else if acc.is_empty() { s.to_string() } - else { format!("{acc}_{s}") } + if s.is_empty() { + acc.to_string() + } else if acc.is_empty() { + s.to_string() + } else { + format!("{acc}_{s}") + } } /// Build series name with prefix. #[inline] fn _p(prefix: &str, acc: &str) -> String { - if acc.is_empty() { prefix.to_string() } else { format!("{prefix}_{acc}") } + if acc.is_empty() { + prefix.to_string() + } else { + format!("{prefix}_{acc}") + } } - /// Non-generic trait for series patterns (usable in collections). pub trait AnySeriesPattern { /// Get the series name. @@ -123,7 +138,6 @@ pub trait SeriesPattern: AnySeriesPattern { fn get(&self, index: Index) -> Option>; } - /// Shared endpoint configuration. #[derive(Clone)] struct EndpointConfig { @@ -136,7 +150,13 @@ struct EndpointConfig { impl EndpointConfig { fn new(client: Arc, name: Arc, index: Index) -> Self { - Self { client, name, index, start: None, end: None } + Self { + client, + name, + index, + start: None, + end: None, + } } fn path(&self) -> String { @@ -145,11 +165,21 @@ impl EndpointConfig { fn build_path(&self, format: Option<&str>) -> String { let mut params = Vec::new(); - if let Some(s) = self.start { params.push(format!("start={}", s)); } - if let Some(e) = self.end { params.push(format!("end={}", e)); } - if let Some(fmt) = format { params.push(format!("format={}", fmt)); } + if let Some(s) = self.start { + params.push(format!("start={}", s)); + } + if let Some(e) = self.end { + params.push(format!("end={}", e)); + } + if let Some(fmt) = format { + params.push(format!("format={}", fmt)); + } let p = self.path(); - if params.is_empty() { p } else { format!("{}?{}", p, params.join("&")) } + if params.is_empty() { + p + } else { + format!("{}?{}", p, params.join("&")) + } } fn get_json(&self, format: Option<&str>) -> Result { @@ -189,14 +219,20 @@ pub type DateSeriesEndpoint = SeriesEndpoint>; impl SeriesEndpoint { pub fn new(client: Arc, name: Arc, index: Index) -> Self { - Self { config: EndpointConfig::new(client, name, index), _marker: std::marker::PhantomData } + Self { + config: EndpointConfig::new(client, name, index), + _marker: std::marker::PhantomData, + } } /// Select a specific index position. pub fn get(mut self, index: usize) -> SingleItemBuilder { self.config.start = Some(index as i64); self.config.end = Some(index as i64 + 1); - SingleItemBuilder { config: self.config, _marker: std::marker::PhantomData } + SingleItemBuilder { + config: self.config, + _marker: std::marker::PhantomData, + } } /// Select a range using Rust range syntax. @@ -218,7 +254,10 @@ impl SeriesEndpoint { Bound::Excluded(&n) => Some(n as i64), Bound::Unbounded => None, }; - RangeBuilder { config: self.config, _marker: std::marker::PhantomData } + RangeBuilder { + config: self.config, + _marker: std::marker::PhantomData, + } } /// Take the first n items. @@ -233,13 +272,19 @@ impl SeriesEndpoint { } else { self.config.start = Some(-(n as i64)); } - RangeBuilder { config: self.config, _marker: std::marker::PhantomData } + RangeBuilder { + config: self.config, + _marker: std::marker::PhantomData, + } } /// Skip the first n items. Chain with `take(n)` to get a range. pub fn skip(mut self, n: usize) -> SkippedBuilder { self.config.start = Some(n as i64); - SkippedBuilder { config: self.config, _marker: std::marker::PhantomData } + SkippedBuilder { + config: self.config, + _marker: std::marker::PhantomData, + } } /// Fetch all data as parsed JSON. @@ -280,7 +325,11 @@ impl SeriesEndpoint> { } /// 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) @@ -322,7 +371,10 @@ impl SkippedBuilder { pub fn take(mut self, n: usize) -> RangeBuilder { let start = self.config.start.unwrap_or(0); self.config.end = Some(start + n as i64); - RangeBuilder { config: self.config, _marker: std::marker::PhantomData } + RangeBuilder { + config: self.config, + _marker: std::marker::PhantomData, + } } /// Fetch from the skipped position to the end. @@ -357,10 +409,42 @@ impl RangeBuilder { } } - // Static index arrays -const _I1: &[Index] = &[Index::Minute10, Index::Minute30, Index::Hour1, Index::Hour4, Index::Hour12, Index::Day1, Index::Day3, Index::Week1, Index::Month1, Index::Month3, Index::Month6, Index::Year1, Index::Year10, Index::Halving, Index::Epoch, Index::Height]; -const _I2: &[Index] = &[Index::Minute10, Index::Minute30, Index::Hour1, Index::Hour4, Index::Hour12, Index::Day1, Index::Day3, Index::Week1, Index::Month1, Index::Month3, Index::Month6, Index::Year1, Index::Year10, Index::Halving, Index::Epoch]; +const _I1: &[Index] = &[ + Index::Minute10, + Index::Minute30, + Index::Hour1, + Index::Hour4, + Index::Hour12, + Index::Day1, + Index::Day3, + Index::Week1, + Index::Month1, + Index::Month3, + Index::Month6, + Index::Year1, + Index::Year10, + Index::Halving, + Index::Epoch, + Index::Height, +]; +const _I2: &[Index] = &[ + Index::Minute10, + Index::Minute30, + Index::Hour1, + Index::Hour4, + Index::Hour12, + Index::Day1, + Index::Day3, + Index::Week1, + Index::Month1, + Index::Month3, + Index::Month6, + Index::Year1, + Index::Year10, + Index::Halving, + Index::Epoch, +]; const _I3: &[Index] = &[Index::Minute10]; const _I4: &[Index] = &[Index::Minute30]; const _I5: &[Index] = &[Index::Hour1]; @@ -401,535 +485,1753 @@ fn _ep(c: &Arc, n: &Arc, i: Index) -> S } #[inline] -fn _dep(c: &Arc, n: &Arc, i: Index) -> DateSeriesEndpoint { +fn _dep( + c: &Arc, + n: &Arc, + i: Index, +) -> DateSeriesEndpoint { DateSeriesEndpoint::new(c.clone(), n.clone(), i) } // Index accessor structs -pub struct SeriesPattern1By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern1By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern1By { - pub fn minute10(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Minute10) } - pub fn minute30(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Minute30) } - pub fn hour1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour1) } - pub fn hour4(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour4) } - pub fn hour12(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour12) } - pub fn day1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Day1) } - pub fn day3(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Day3) } - pub fn week1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Week1) } - pub fn month1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month1) } - pub fn month3(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month3) } - pub fn month6(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month6) } - pub fn year1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Year1) } - pub fn year10(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Year10) } - pub fn halving(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::Halving) } - pub fn epoch(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::Epoch) } - pub fn height(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::Height) } + pub fn minute10(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Minute10) + } + pub fn minute30(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Minute30) + } + pub fn hour1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour1) + } + pub fn hour4(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour4) + } + pub fn hour12(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour12) + } + pub fn day1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Day1) + } + pub fn day3(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Day3) + } + pub fn week1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Week1) + } + pub fn month1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month1) + } + pub fn month3(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month3) + } + pub fn month6(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month6) + } + pub fn year1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Year1) + } + pub fn year10(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Year10) + } + pub fn halving(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::Halving) + } + pub fn epoch(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::Epoch) + } + pub fn height(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::Height) + } } -pub struct SeriesPattern1 { name: Arc, pub by: SeriesPattern1By } +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 } + 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 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)) } } +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 SeriesPattern2By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern2By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern2By { - pub fn minute10(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Minute10) } - pub fn minute30(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Minute30) } - pub fn hour1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour1) } - pub fn hour4(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour4) } - pub fn hour12(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour12) } - pub fn day1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Day1) } - pub fn day3(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Day3) } - pub fn week1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Week1) } - pub fn month1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month1) } - pub fn month3(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month3) } - pub fn month6(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month6) } - pub fn year1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Year1) } - pub fn year10(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Year10) } - pub fn halving(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::Halving) } - pub fn epoch(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::Epoch) } + pub fn minute10(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Minute10) + } + pub fn minute30(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Minute30) + } + pub fn hour1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour1) + } + pub fn hour4(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour4) + } + pub fn hour12(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour12) + } + pub fn day1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Day1) + } + pub fn day3(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Day3) + } + pub fn week1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Week1) + } + pub fn month1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month1) + } + pub fn month3(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month3) + } + pub fn month6(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month6) + } + pub fn year1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Year1) + } + pub fn year10(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Year10) + } + pub fn halving(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::Halving) + } + pub fn epoch(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::Epoch) + } } -pub struct SeriesPattern2 { name: Arc, pub by: SeriesPattern2By } +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 } + 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 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)) } } +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 SeriesPattern3By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern3By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern3By { - pub fn minute10(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Minute10) } + pub fn minute10(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Minute10) + } } -pub struct SeriesPattern3 { name: Arc, pub by: SeriesPattern3By } +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 } + 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 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)) } } +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 SeriesPattern4By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern4By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern4By { - pub fn minute30(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Minute30) } + pub fn minute30(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Minute30) + } } -pub struct SeriesPattern4 { name: Arc, pub by: SeriesPattern4By } +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 } + 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 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)) } } +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 SeriesPattern5By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern5By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern5By { - pub fn hour1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour1) } + pub fn hour1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour1) + } } -pub struct SeriesPattern5 { name: Arc, pub by: SeriesPattern5By } +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 } + 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 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)) } } +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 SeriesPattern6By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern6By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern6By { - pub fn hour4(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour4) } + pub fn hour4(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour4) + } } -pub struct SeriesPattern6 { name: Arc, pub by: SeriesPattern6By } +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 } + 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 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)) } } +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 SeriesPattern7By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern7By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern7By { - pub fn hour12(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Hour12) } + pub fn hour12(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Hour12) + } } -pub struct SeriesPattern7 { name: Arc, pub by: SeriesPattern7By } +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 } + 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 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)) } } +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 SeriesPattern8By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern8By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern8By { - pub fn day1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Day1) } + pub fn day1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Day1) + } } -pub struct SeriesPattern8 { name: Arc, pub by: SeriesPattern8By } +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 } + 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 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)) } } +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 SeriesPattern9By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern9By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern9By { - pub fn day3(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Day3) } + pub fn day3(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Day3) + } } -pub struct SeriesPattern9 { name: Arc, pub by: SeriesPattern9By } +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 } + 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 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)) } } +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 SeriesPattern10By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern10By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern10By { - pub fn week1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Week1) } + pub fn week1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Week1) + } } -pub struct SeriesPattern10 { name: Arc, pub by: SeriesPattern10By } +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 } + 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 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)) } } +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 SeriesPattern11By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern11By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern11By { - pub fn month1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month1) } + pub fn month1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month1) + } } -pub struct SeriesPattern11 { name: Arc, pub by: SeriesPattern11By } +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 } + 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 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)) } } +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 SeriesPattern12By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern12By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern12By { - pub fn month3(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month3) } + pub fn month3(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month3) + } } -pub struct SeriesPattern12 { name: Arc, pub by: SeriesPattern12By } +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 } + 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 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)) } } +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 SeriesPattern13By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern13By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern13By { - pub fn month6(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Month6) } + pub fn month6(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Month6) + } } -pub struct SeriesPattern13 { name: Arc, pub by: SeriesPattern13By } +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 } + 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 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)) } } +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 SeriesPattern14By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern14By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern14By { - pub fn year1(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Year1) } + pub fn year1(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Year1) + } } -pub struct SeriesPattern14 { name: Arc, pub by: SeriesPattern14By } +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 } + 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 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)) } } +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 SeriesPattern15By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern15By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern15By { - pub fn year10(&self) -> DateSeriesEndpoint { _dep(&self.client, &self.name, Index::Year10) } + pub fn year10(&self) -> DateSeriesEndpoint { + _dep(&self.client, &self.name, Index::Year10) + } } -pub struct SeriesPattern15 { name: Arc, pub by: SeriesPattern15By } +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 } + 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 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)) } } +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 SeriesPattern16By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern16By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern16By { - pub fn halving(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::Halving) } + pub fn halving(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::Halving) + } } -pub struct SeriesPattern16 { name: Arc, pub by: SeriesPattern16By } +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 } + 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 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)) } } +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 SeriesPattern17By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern17By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern17By { - pub fn epoch(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::Epoch) } + pub fn epoch(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::Epoch) + } } -pub struct SeriesPattern17 { name: Arc, pub by: SeriesPattern17By } +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 } + 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 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)) } } +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 SeriesPattern18By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern18By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern18By { - pub fn height(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::Height) } + pub fn height(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::Height) + } } -pub struct SeriesPattern18 { name: Arc, pub by: SeriesPattern18By } +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 } + 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 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)) } } +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 SeriesPattern19By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern19By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern19By { - pub fn tx_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::TxIndex) } + pub fn tx_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::TxIndex) + } } -pub struct SeriesPattern19 { name: Arc, pub by: SeriesPattern19By } +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 } + 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 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)) } } +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 SeriesPattern20By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern20By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern20By { - pub fn txin_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::TxInIndex) } + pub fn txin_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::TxInIndex) + } } -pub struct SeriesPattern20 { name: Arc, pub by: SeriesPattern20By } +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 } + 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 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)) } } +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 SeriesPattern21By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern21By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern21By { - pub fn txout_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::TxOutIndex) } + pub fn txout_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::TxOutIndex) + } } -pub struct SeriesPattern21 { name: Arc, pub by: SeriesPattern21By } +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 } + 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 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)) } } +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 SeriesPattern22By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern22By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern22By { - pub fn empty_output_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::EmptyOutputIndex) } + pub fn empty_output_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::EmptyOutputIndex) + } } -pub struct SeriesPattern22 { name: Arc, pub by: SeriesPattern22By } +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 } + 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 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)) } } +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 SeriesPattern23By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern23By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern23By { - pub fn op_return_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::OpReturnIndex) } + pub fn op_return_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::OpReturnIndex) + } } -pub struct SeriesPattern23 { name: Arc, pub by: SeriesPattern23By } +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 } + 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 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)) } } +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 SeriesPattern24By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern24By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern24By { - pub fn p2a_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2AAddrIndex) } + pub fn p2a_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2AAddrIndex) + } } -pub struct SeriesPattern24 { name: Arc, pub by: SeriesPattern24By } +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 } + 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 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)) } } +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 SeriesPattern25By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern25By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern25By { - pub fn p2ms_output_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2MSOutputIndex) } + pub fn p2ms_output_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2MSOutputIndex) + } } -pub struct SeriesPattern25 { name: Arc, pub by: SeriesPattern25By } +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 } + 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 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)) } } +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 SeriesPattern26By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern26By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern26By { - pub fn p2pk33_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2PK33AddrIndex) } + pub fn p2pk33_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2PK33AddrIndex) + } } -pub struct SeriesPattern26 { name: Arc, pub by: SeriesPattern26By } +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 } + 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 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)) } } +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 SeriesPattern27By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern27By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern27By { - pub fn p2pk65_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2PK65AddrIndex) } + pub fn p2pk65_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2PK65AddrIndex) + } } -pub struct SeriesPattern27 { name: Arc, pub by: SeriesPattern27By } +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 } + 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 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)) } } +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 SeriesPattern28By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern28By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern28By { - pub fn p2pkh_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2PKHAddrIndex) } + pub fn p2pkh_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2PKHAddrIndex) + } } -pub struct SeriesPattern28 { name: Arc, pub by: SeriesPattern28By } +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 } + 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 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)) } } +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 SeriesPattern29By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern29By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern29By { - pub fn p2sh_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2SHAddrIndex) } + pub fn p2sh_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2SHAddrIndex) + } } -pub struct SeriesPattern29 { name: Arc, pub by: SeriesPattern29By } +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 } + 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 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)) } } +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 SeriesPattern30By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern30By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern30By { - pub fn p2tr_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2TRAddrIndex) } + pub fn p2tr_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2TRAddrIndex) + } } -pub struct SeriesPattern30 { name: Arc, pub by: SeriesPattern30By } +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 } + 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 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)) } } +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 SeriesPattern31By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern31By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern31By { - pub fn p2wpkh_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2WPKHAddrIndex) } + pub fn p2wpkh_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2WPKHAddrIndex) + } } -pub struct SeriesPattern31 { name: Arc, pub by: SeriesPattern31By } +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 } + 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 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)) } } +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 SeriesPattern32By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern32By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern32By { - pub fn p2wsh_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::P2WSHAddrIndex) } + pub fn p2wsh_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::P2WSHAddrIndex) + } } -pub struct SeriesPattern32 { name: Arc, pub by: SeriesPattern32By } +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 } + 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 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)) } } +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 SeriesPattern33By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern33By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern33By { - pub fn unknown_output_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::UnknownOutputIndex) } + pub fn unknown_output_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::UnknownOutputIndex) + } } -pub struct SeriesPattern33 { name: Arc, pub by: SeriesPattern33By } +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 } + 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 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)) } } +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 SeriesPattern34By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern34By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern34By { - pub fn funded_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::FundedAddrIndex) } + pub fn funded_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::FundedAddrIndex) + } } -pub struct SeriesPattern34 { name: Arc, pub by: SeriesPattern34By } +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 } + 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 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)) } } +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 SeriesPattern35By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +pub struct SeriesPattern35By { + client: Arc, + name: Arc, + _marker: std::marker::PhantomData, +} impl SeriesPattern35By { - pub fn empty_addr_index(&self) -> SeriesEndpoint { _ep(&self.client, &self.name, Index::EmptyAddrIndex) } + pub fn empty_addr_index(&self) -> SeriesEndpoint { + _ep(&self.client, &self.name, Index::EmptyAddrIndex) + } } -pub struct SeriesPattern35 { name: Arc, pub by: SeriesPattern35By } +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 } + 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 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)) } } +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 /// Pattern struct for repeated tree structure. -pub struct Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern { +pub struct Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern +{ pub pct05: CentsSatsUsdPattern, pub pct10: CentsSatsUsdPattern, pub pct15: CentsSatsUsdPattern, @@ -1232,8 +2534,14 @@ impl GrossInvestedInvestorLossNetNuplProfitSentimentPattern2 { Self { gross_pnl: CentsUsdPattern3::new(client.clone(), _m(&acc, "unrealized_gross_pnl")), invested_capital: InPattern::new(client.clone(), _m(&acc, "invested_capital_in")), - investor_cap_in_loss_raw: SeriesPattern18::new(client.clone(), _m(&acc, "investor_cap_in_loss_raw")), - investor_cap_in_profit_raw: SeriesPattern18::new(client.clone(), _m(&acc, "investor_cap_in_profit_raw")), + investor_cap_in_loss_raw: SeriesPattern18::new( + client.clone(), + _m(&acc, "investor_cap_in_loss_raw"), + ), + investor_cap_in_profit_raw: SeriesPattern18::new( + client.clone(), + _m(&acc, "investor_cap_in_profit_raw"), + ), loss: CentsNegativeToUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss")), net_pnl: CentsToUsdPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl")), nupl: BpsRatioPattern::new(client.clone(), _m(&acc, "nupl")), @@ -1353,7 +2661,10 @@ impl CapLossMvrvNetPriceProfitSoprPattern { cap: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), loss: BlockCumulativeNegativeSumPattern::new(client.clone(), _m(&acc, "realized_loss")), mvrv: SeriesPattern1::new(client.clone(), _m(&acc, "mvrv")), - net_pnl: BlockCumulativeDeltaSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), + net_pnl: BlockCumulativeDeltaSumPattern::new( + client.clone(), + _m(&acc, "net_realized_pnl"), + ), price: BpsCentsRatioSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), profit: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit")), sopr: RatioValuePattern::new(client.clone(), acc.clone()), @@ -1505,7 +2816,10 @@ impl AverageBlockCumulativeInSumPattern { block: BtcCentsSatsUsdPattern2::new(client.clone(), acc.clone()), cumulative: BtcCentsSatsUsdPattern3::new(client.clone(), _m(&acc, "cumulative")), in_loss: AverageBlockCumulativeSumPattern3::new(client.clone(), _m(&acc, "in_loss")), - in_profit: AverageBlockCumulativeSumPattern3::new(client.clone(), _m(&acc, "in_profit")), + in_profit: AverageBlockCumulativeSumPattern3::new( + client.clone(), + _m(&acc, "in_profit"), + ), sum: _1m1w1y24hPattern4::new(client.clone(), _m(&acc, "sum")), } } @@ -1552,7 +2866,10 @@ impl BtcCentsSatsToUsdPattern3 { btc: SeriesPattern1::new(client.clone(), acc.clone()), cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), - to_circulating: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_circulating")), + to_circulating: BpsPercentRatioPattern3::new( + client.clone(), + _m(&acc, "to_circulating"), + ), to_own: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_own")), usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), } @@ -1576,7 +2893,10 @@ impl CentsNegativeToUsdPattern2 { cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), negative: SeriesPattern1::new(client.clone(), _m(&acc, "neg")), to_mcap: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_mcap")), - to_own_gross_pnl: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_own_gross_pnl")), + to_own_gross_pnl: BpsPercentRatioPattern3::new( + client.clone(), + _m(&acc, "to_own_gross_pnl"), + ), to_own_mcap: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "to_own_mcap")), usd: SeriesPattern1::new(client.clone(), acc.clone()), } @@ -1601,7 +2921,10 @@ impl DeltaHalfInToTotalPattern { half: BtcCentsSatsUsdPattern3::new(client.clone(), _m(&acc, "half")), in_loss: BtcCentsSatsToUsdPattern::new(client.clone(), _m(&acc, "in_loss")), in_profit: BtcCentsSatsToUsdPattern::new(client.clone(), _m(&acc, "in_profit")), - to_circulating: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_circulating")), + to_circulating: BpsPercentRatioPattern3::new( + client.clone(), + _m(&acc, "to_circulating"), + ), total: BtcCentsSatsUsdPattern3::new(client.clone(), acc.clone()), } } @@ -1625,7 +2948,10 @@ impl DeltaHalfInToTotalPattern2 { half: BtcCentsSatsUsdPattern3::new(client.clone(), _m(&acc, "half")), in_loss: BtcCentsSatsToUsdPattern3::new(client.clone(), _m(&acc, "in_loss")), in_profit: BtcCentsSatsToUsdPattern3::new(client.clone(), _m(&acc, "in_profit")), - to_circulating: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_circulating")), + to_circulating: BpsPercentRatioPattern3::new( + client.clone(), + _m(&acc, "to_circulating"), + ), total: BtcCentsSatsUsdPattern3::new(client.clone(), acc.clone()), } } @@ -1801,7 +3127,10 @@ impl BtcCentsSatsToUsdPattern { btc: SeriesPattern1::new(client.clone(), acc.clone()), cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), - to_circulating: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_circulating")), + to_circulating: BpsPercentRatioPattern3::new( + client.clone(), + _m(&acc, "to_circulating"), + ), usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), } } @@ -1866,7 +3195,10 @@ impl CentsToUsdPattern4 { Self { cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), to_mcap: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_mcap")), - to_own_gross_pnl: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_own_gross_pnl")), + to_own_gross_pnl: BpsPercentRatioPattern3::new( + client.clone(), + _m(&acc, "to_own_gross_pnl"), + ), to_own_mcap: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "to_own_mcap")), usd: SeriesPattern1::new(client.clone(), acc.clone()), } @@ -2267,7 +3599,10 @@ impl CentsToUsdPattern3 { pub fn new(client: Arc, acc: String) -> Self { Self { cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "to_own_gross_pnl")), + to_own_gross_pnl: BpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "to_own_gross_pnl"), + ), to_own_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "to_own_mcap")), usd: SeriesPattern1::new(client.clone(), acc.clone()), } @@ -2286,10 +3621,19 @@ impl CoindaysCoinyearsDormancyTransferPattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - coindays_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), - coinyears_destroyed: SeriesPattern1::new(client.clone(), _m(&acc, "coinyears_destroyed")), + coindays_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "coindays_destroyed"), + ), + coinyears_destroyed: SeriesPattern1::new( + client.clone(), + _m(&acc, "coinyears_destroyed"), + ), dormancy: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "dormancy")), - transfer_volume: AverageBlockCumulativeInSumPattern::new(client.clone(), _m(&acc, "transfer_volume")), + transfer_volume: AverageBlockCumulativeInSumPattern::new( + client.clone(), + _m(&acc, "transfer_volume"), + ), } } } @@ -2327,9 +3671,17 @@ impl NuplRealizedSupplyUnrealizedPattern { pub fn new(client: Arc, acc: String) -> Self { Self { nupl: BpsRatioPattern::new(client.clone(), _m(&acc, "nupl")), - realized_cap: AllSthPattern::new(client.clone(), acc.clone(), "realized_cap".to_string()), + realized_cap: AllSthPattern::new( + client.clone(), + acc.clone(), + "realized_cap".to_string(), + ), supply: AllSthPattern2::new(client.clone(), acc.clone()), - unrealized_pnl: AllSthPattern::new(client.clone(), acc.clone(), "unrealized_pnl".to_string()), + unrealized_pnl: AllSthPattern::new( + client.clone(), + acc.clone(), + "unrealized_pnl".to_string(), + ), } } } @@ -2387,7 +3739,10 @@ impl AdjustedRatioValuePattern { Self { adjusted: RatioTransferValuePattern::new(client.clone(), acc.clone()), ratio: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "value_destroyed")), + value_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "value_destroyed"), + ), } } } @@ -2421,7 +3776,10 @@ impl BlocksDominanceRewardsPattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - blocks_mined: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "blocks_mined")), + blocks_mined: AverageBlockCumulativeSumPattern2::new( + client.clone(), + _m(&acc, "blocks_mined"), + ), dominance: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "dominance")), rewards: AverageBlockCumulativeSumPattern3::new(client.clone(), _m(&acc, "rewards")), } @@ -2475,9 +3833,15 @@ impl BpsPriceRatioPattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { - bps: SeriesPattern1::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: SeriesPattern1::new(client.clone(), _m(&acc, &format!("ratio_{disc}", disc=disc))), + ratio: SeriesPattern1::new( + client.clone(), + _m(&acc, &format!("ratio_{disc}", disc = disc)), + ), } } } @@ -2602,7 +3966,10 @@ impl CumulativeRollingSumPattern { pub fn new(client: Arc, acc: String) -> Self { Self { cumulative: SeriesPattern1::new(client.clone(), _m(&acc, "cumulative")), - rolling: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), acc.clone()), + rolling: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new( + client.clone(), + acc.clone(), + ), sum: SeriesPattern18::new(client.clone(), _m(&acc, "sum")), } } @@ -2656,8 +4023,14 @@ impl RatioTransferValuePattern { pub fn new(client: Arc, acc: String) -> Self { Self { ratio: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "asopr")), - transfer_volume: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "adj_value_created")), - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "adj_value_destroyed")), + transfer_volume: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "adj_value_created"), + ), + value_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "adj_value_destroyed"), + ), } } } @@ -2674,8 +4047,14 @@ impl RsiStochPattern { pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { rsi: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, &disc)), - stoch_rsi_d: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, &format!("stoch_d_{disc}", disc=disc))), - stoch_rsi_k: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, &format!("stoch_k_{disc}", disc=disc))), + stoch_rsi_d: BpsPercentRatioPattern3::new( + client.clone(), + _m(&acc, &format!("stoch_d_{disc}", disc = disc)), + ), + stoch_rsi_k: BpsPercentRatioPattern3::new( + client.clone(), + _m(&acc, &format!("stoch_k_{disc}", disc = disc)), + ), } } } @@ -2692,7 +4071,10 @@ impl SpendingSpentUnspentPattern { pub fn new(client: Arc, acc: String) -> Self { Self { spending_rate: SeriesPattern1::new(client.clone(), _m(&acc, "spending_rate")), - spent_count: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "spent_utxo_count")), + spent_count: AverageBlockCumulativeSumPattern2::new( + client.clone(), + _m(&acc, "spent_utxo_count"), + ), unspent_count: BaseDeltaPattern::new(client.clone(), _m(&acc, "utxo_count")), } } @@ -2775,7 +4157,10 @@ impl AllSthPattern { pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { all: SeriesPattern1::new(client.clone(), _m(&acc, &disc)), - sth: SeriesPattern1::new(client.clone(), _m(&acc, &format!("sth_{disc}", disc=disc))), + sth: SeriesPattern1::new( + client.clone(), + _m(&acc, &format!("sth_{disc}", disc = disc)), + ), } } } @@ -2838,7 +4223,10 @@ impl BlocksDominancePattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - blocks_mined: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "blocks_mined")), + blocks_mined: AverageBlockCumulativeSumPattern2::new( + client.clone(), + _m(&acc, "blocks_mined"), + ), dominance: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "dominance")), } } @@ -2950,8 +4338,14 @@ impl CoindaysTransferPattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - coindays_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), - transfer_volume: AverageBlockCumulativeInSumPattern::new(client.clone(), _m(&acc, "transfer_volume")), + coindays_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "coindays_destroyed"), + ), + transfer_volume: AverageBlockCumulativeInSumPattern::new( + client.clone(), + _m(&acc, "transfer_volume"), + ), } } } @@ -3015,7 +4409,10 @@ impl PriceRatioPattern { pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, &disc)), - ratio: SeriesPattern1::new(client.clone(), _m(&acc, &format!("ratio_{disc}", disc=disc))), + ratio: SeriesPattern1::new( + client.clone(), + _m(&acc, &format!("ratio_{disc}", disc = disc)), + ), } } } @@ -3031,7 +4428,10 @@ impl RatioValuePattern { pub fn new(client: Arc, acc: String) -> Self { Self { ratio: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")), - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "value_destroyed")), + value_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "value_destroyed"), + ), } } } @@ -3141,7 +4541,10 @@ impl SeriesTree { pub fn new(client: Arc, base_path: String) -> Self { Self { blocks: SeriesTree_Blocks::new(client.clone(), format!("{base_path}_blocks")), - transactions: SeriesTree_Transactions::new(client.clone(), format!("{base_path}_transactions")), + 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")), addrs: SeriesTree_Addrs::new(client.clone(), format!("{base_path}_addrs")), @@ -3150,7 +4553,10 @@ impl SeriesTree { 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")), + indicators: SeriesTree_Indicators::new( + client.clone(), + format!("{base_path}_indicators"), + ), investing: SeriesTree_Investing::new(client.clone(), format!("{base_path}_investing")), market: SeriesTree_Market::new(client.clone(), format!("{base_path}_market")), pools: SeriesTree_Pools::new(client.clone(), format!("{base_path}_pools")), @@ -3185,18 +4591,36 @@ impl SeriesTree_Blocks { Self { blockhash: SeriesPattern18::new(client.clone(), "blockhash".to_string()), coinbase_tag: SeriesPattern18::new(client.clone(), "coinbase_tag".to_string()), - difficulty: SeriesTree_Blocks_Difficulty::new(client.clone(), format!("{base_path}_difficulty")), + 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: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "block_weight".to_string()), + weight: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new( + client.clone(), + "block_weight".to_string(), + ), segwit_txs: SeriesPattern18::new(client.clone(), "segwit_txs".to_string()), segwit_size: SeriesPattern18::new(client.clone(), "segwit_size".to_string()), segwit_weight: SeriesPattern18::new(client.clone(), "segwit_weight".to_string()), count: SeriesTree_Blocks_Count::new(client.clone(), format!("{base_path}_count")), - lookback: SeriesTree_Blocks_Lookback::new(client.clone(), format!("{base_path}_lookback")), - interval: SeriesTree_Blocks_Interval::new(client.clone(), format!("{base_path}_interval")), - vbytes: AverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "block_vbytes".to_string()), - fullness: SeriesTree_Blocks_Fullness::new(client.clone(), format!("{base_path}_fullness")), + lookback: SeriesTree_Blocks_Lookback::new( + client.clone(), + format!("{base_path}_lookback"), + ), + interval: SeriesTree_Blocks_Interval::new( + client.clone(), + format!("{base_path}_interval"), + ), + vbytes: AverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new( + client.clone(), + "block_vbytes".to_string(), + ), + fullness: SeriesTree_Blocks_Fullness::new( + client.clone(), + format!("{base_path}_fullness"), + ), halving: SeriesTree_Blocks_Halving::new(client.clone(), format!("{base_path}_halving")), } } @@ -3217,9 +4641,15 @@ impl SeriesTree_Blocks_Difficulty { Self { value: SeriesPattern1::new(client.clone(), "difficulty".to_string()), hashrate: SeriesPattern1::new(client.clone(), "difficulty_hashrate".to_string()), - adjustment: BpsPercentRatioPattern::new(client.clone(), "difficulty_adjustment".to_string()), + adjustment: BpsPercentRatioPattern::new( + client.clone(), + "difficulty_adjustment".to_string(), + ), epoch: SeriesPattern1::new(client.clone(), "difficulty_epoch".to_string()), - blocks_to_retarget: SeriesPattern1::new(client.clone(), "blocks_to_retarget".to_string()), + blocks_to_retarget: SeriesPattern1::new( + client.clone(), + "blocks_to_retarget".to_string(), + ), days_to_retarget: SeriesPattern1::new(client.clone(), "days_to_retarget".to_string()), } } @@ -3281,7 +4711,10 @@ impl SeriesTree_Blocks_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { target: _1m1w1y24hPattern::new(client.clone(), "block_count_target".to_string()), - total: AverageBlockCumulativeSumPattern2::new(client.clone(), "block_count".to_string()), + total: AverageBlockCumulativeSumPattern2::new( + client.clone(), + "block_count".to_string(), + ), } } } @@ -3455,8 +4888,14 @@ impl SeriesTree_Transactions { 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")), + versions: SeriesTree_Transactions_Versions::new( + client.clone(), + format!("{base_path}_versions"), + ), + volume: SeriesTree_Transactions_Volume::new( + client.clone(), + format!("{base_path}_volume"), + ), } } } @@ -3485,9 +4924,15 @@ impl SeriesTree_Transactions_Raw { 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()), + 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()), + first_txout_index: SeriesPattern19::new( + client.clone(), + "first_txout_index".to_string(), + ), } } } @@ -3501,7 +4946,10 @@ pub struct SeriesTree_Transactions_Count { impl SeriesTree_Transactions_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { - total: AverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "tx_count".to_string()), + total: AverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new( + client.clone(), + "tx_count".to_string(), + ), is_coinbase: SeriesPattern19::new(client.clone(), "is_coinbase".to_string()), } } @@ -3517,7 +4965,10 @@ impl SeriesTree_Transactions_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { vsize: _6bBlockTxPattern::new(client.clone(), "tx_vsize".to_string()), - weight: SeriesTree_Transactions_Size_Weight::new(client.clone(), format!("{base_path}_weight")), + weight: SeriesTree_Transactions_Size_Weight::new( + client.clone(), + format!("{base_path}_weight"), + ), } } } @@ -3533,8 +4984,14 @@ impl SeriesTree_Transactions_Size_Weight { pub fn new(client: Arc, base_path: String) -> Self { Self { tx_index: SeriesPattern19::new(client.clone(), "tx_weight".to_string()), - block: MaxMedianMinPct10Pct25Pct75Pct90Pattern2::new(client.clone(), "tx_weight".to_string()), - _6b: MaxMedianMinPct10Pct25Pct75Pct90Pattern2::new(client.clone(), "tx_weight_6b".to_string()), + block: MaxMedianMinPct10Pct25Pct75Pct90Pattern2::new( + client.clone(), + "tx_weight".to_string(), + ), + _6b: MaxMedianMinPct10Pct25Pct75Pct90Pattern2::new( + client.clone(), + "tx_weight_6b".to_string(), + ), } } } @@ -3555,7 +5012,10 @@ impl SeriesTree_Transactions_Fees { 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()), - effective_fee_rate: _6bBlockTxPattern::new(client.clone(), "effective_fee_rate".to_string()), + effective_fee_rate: _6bBlockTxPattern::new( + client.clone(), + "effective_fee_rate".to_string(), + ), } } } @@ -3588,7 +5048,10 @@ pub struct SeriesTree_Transactions_Volume { impl SeriesTree_Transactions_Volume { pub fn new(client: Arc, base_path: String) -> Self { Self { - transfer_volume: AverageBlockCumulativeSumPattern3::new(client.clone(), "transfer_volume_bis".to_string()), + transfer_volume: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "transfer_volume_bis".to_string(), + ), tx_per_sec: _1m1w1y24hPattern::new(client.clone(), "tx_per_sec".to_string()), outputs_per_sec: _1m1w1y24hPattern::new(client.clone(), "outputs_per_sec".to_string()), inputs_per_sec: _1m1w1y24hPattern::new(client.clone(), "inputs_per_sec".to_string()), @@ -3678,7 +5141,10 @@ pub struct SeriesTree_Outputs_Raw { impl SeriesTree_Outputs_Raw { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_txout_index: SeriesPattern18::new(client.clone(), "first_txout_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()), @@ -3734,10 +5200,22 @@ impl SeriesTree_Addrs { raw: SeriesTree_Addrs_Raw::new(client.clone(), format!("{base_path}_raw")), indexes: SeriesTree_Addrs_Indexes::new(client.clone(), format!("{base_path}_indexes")), data: SeriesTree_Addrs_Data::new(client.clone(), format!("{base_path}_data")), - funded: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new(client.clone(), "addr_count".to_string()), - empty: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new(client.clone(), "empty_addr_count".to_string()), - activity: SeriesTree_Addrs_Activity::new(client.clone(), format!("{base_path}_activity")), - total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new(client.clone(), "total_addr_count".to_string()), + funded: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new( + client.clone(), + "addr_count".to_string(), + ), + empty: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new( + client.clone(), + "empty_addr_count".to_string(), + ), + activity: SeriesTree_Addrs_Activity::new( + client.clone(), + format!("{base_path}_activity"), + ), + total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new( + client.clone(), + "total_addr_count".to_string(), + ), new: SeriesTree_Addrs_New::new(client.clone(), format!("{base_path}_new")), delta: SeriesTree_Addrs_Delta::new(client.clone(), format!("{base_path}_delta")), } @@ -3780,7 +5258,10 @@ pub struct SeriesTree_Addrs_Raw_P2pk65 { impl SeriesTree_Addrs_Raw_P2pk65 { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: SeriesPattern18::new(client.clone(), "first_p2pk65_addr_index".to_string()), + first_index: SeriesPattern18::new( + client.clone(), + "first_p2pk65_addr_index".to_string(), + ), bytes: SeriesPattern27::new(client.clone(), "p2pk65_bytes".to_string()), } } @@ -3795,7 +5276,10 @@ pub struct SeriesTree_Addrs_Raw_P2pk33 { impl SeriesTree_Addrs_Raw_P2pk33 { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: SeriesPattern18::new(client.clone(), "first_p2pk33_addr_index".to_string()), + first_index: SeriesPattern18::new( + client.clone(), + "first_p2pk33_addr_index".to_string(), + ), bytes: SeriesPattern26::new(client.clone(), "p2pk33_bytes".to_string()), } } @@ -3840,7 +5324,10 @@ pub struct SeriesTree_Addrs_Raw_P2wpkh { impl SeriesTree_Addrs_Raw_P2wpkh { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: SeriesPattern18::new(client.clone(), "first_p2wpkh_addr_index".to_string()), + first_index: SeriesPattern18::new( + client.clone(), + "first_p2wpkh_addr_index".to_string(), + ), bytes: SeriesPattern31::new(client.clone(), "p2wpkh_bytes".to_string()), } } @@ -3953,15 +5440,42 @@ pub struct SeriesTree_Addrs_Activity { impl SeriesTree_Addrs_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: BothReactivatedReceivingSendingPattern::new(client.clone(), "addr_activity".to_string()), - p2pk65: BothReactivatedReceivingSendingPattern::new(client.clone(), "p2pk65_addr_activity".to_string()), - p2pk33: BothReactivatedReceivingSendingPattern::new(client.clone(), "p2pk33_addr_activity".to_string()), - p2pkh: BothReactivatedReceivingSendingPattern::new(client.clone(), "p2pkh_addr_activity".to_string()), - p2sh: BothReactivatedReceivingSendingPattern::new(client.clone(), "p2sh_addr_activity".to_string()), - p2wpkh: BothReactivatedReceivingSendingPattern::new(client.clone(), "p2wpkh_addr_activity".to_string()), - p2wsh: BothReactivatedReceivingSendingPattern::new(client.clone(), "p2wsh_addr_activity".to_string()), - p2tr: BothReactivatedReceivingSendingPattern::new(client.clone(), "p2tr_addr_activity".to_string()), - p2a: BothReactivatedReceivingSendingPattern::new(client.clone(), "p2a_addr_activity".to_string()), + all: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "addr_activity".to_string(), + ), + p2pk65: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "p2pk65_addr_activity".to_string(), + ), + p2pk33: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "p2pk33_addr_activity".to_string(), + ), + p2pkh: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "p2pkh_addr_activity".to_string(), + ), + p2sh: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "p2sh_addr_activity".to_string(), + ), + p2wpkh: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "p2wpkh_addr_activity".to_string(), + ), + p2wsh: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "p2wsh_addr_activity".to_string(), + ), + p2tr: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "p2tr_addr_activity".to_string(), + ), + p2a: BothReactivatedReceivingSendingPattern::new( + client.clone(), + "p2a_addr_activity".to_string(), + ), } } } @@ -3982,15 +5496,42 @@ pub struct SeriesTree_Addrs_New { impl SeriesTree_Addrs_New { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: AverageBlockCumulativeSumPattern::new(client.clone(), "new_addr_count".to_string()), - p2pk65: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk65_new_addr_count".to_string()), - p2pk33: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk33_new_addr_count".to_string()), - p2pkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pkh_new_addr_count".to_string()), - p2sh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2sh_new_addr_count".to_string()), - p2wpkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wpkh_new_addr_count".to_string()), - p2wsh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wsh_new_addr_count".to_string()), - p2tr: AverageBlockCumulativeSumPattern::new(client.clone(), "p2tr_new_addr_count".to_string()), - p2a: AverageBlockCumulativeSumPattern::new(client.clone(), "p2a_new_addr_count".to_string()), + all: AverageBlockCumulativeSumPattern::new( + client.clone(), + "new_addr_count".to_string(), + ), + p2pk65: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pk65_new_addr_count".to_string(), + ), + p2pk33: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pk33_new_addr_count".to_string(), + ), + p2pkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pkh_new_addr_count".to_string(), + ), + p2sh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2sh_new_addr_count".to_string(), + ), + p2wpkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2wpkh_new_addr_count".to_string(), + ), + p2wsh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2wsh_new_addr_count".to_string(), + ), + p2tr: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2tr_new_addr_count".to_string(), + ), + p2a: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2a_new_addr_count".to_string(), + ), } } } @@ -4053,9 +5594,15 @@ impl SeriesTree_Scripts_Raw { pub fn new(client: Arc, base_path: String) -> Self { Self { 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")), + 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")), + unknown: SeriesTree_Scripts_Raw_Unknown::new( + client.clone(), + format!("{base_path}_unknown"), + ), } } } @@ -4069,7 +5616,10 @@ pub struct SeriesTree_Scripts_Raw_Empty { impl SeriesTree_Scripts_Raw_Empty { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: SeriesPattern18::new(client.clone(), "first_empty_output_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()), } } @@ -4099,7 +5649,10 @@ pub struct SeriesTree_Scripts_Raw_P2ms { impl SeriesTree_Scripts_Raw_P2ms { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: SeriesPattern18::new(client.clone(), "first_p2ms_output_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()), } } @@ -4114,7 +5667,10 @@ pub struct SeriesTree_Scripts_Raw_Unknown { impl SeriesTree_Scripts_Raw_Unknown { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: SeriesPattern18::new(client.clone(), "first_unknown_output_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()), } } @@ -4141,16 +5697,34 @@ impl SeriesTree_Scripts_Count { Self { p2a: AverageBlockCumulativeSumPattern::new(client.clone(), "p2a_count".to_string()), p2ms: AverageBlockCumulativeSumPattern::new(client.clone(), "p2ms_count".to_string()), - p2pk33: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk33_count".to_string()), - p2pk65: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk65_count".to_string()), + p2pk33: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pk33_count".to_string(), + ), + p2pk65: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pk65_count".to_string(), + ), p2pkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pkh_count".to_string()), p2sh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2sh_count".to_string()), p2tr: AverageBlockCumulativeSumPattern::new(client.clone(), "p2tr_count".to_string()), - p2wpkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wpkh_count".to_string()), + p2wpkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2wpkh_count".to_string(), + ), p2wsh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wsh_count".to_string()), - op_return: AverageBlockCumulativeSumPattern::new(client.clone(), "op_return_count".to_string()), - empty_output: AverageBlockCumulativeSumPattern::new(client.clone(), "empty_output_count".to_string()), - unknown_output: AverageBlockCumulativeSumPattern::new(client.clone(), "unknown_output_count".to_string()), + op_return: AverageBlockCumulativeSumPattern::new( + client.clone(), + "op_return_count".to_string(), + ), + empty_output: AverageBlockCumulativeSumPattern::new( + client.clone(), + "empty_output_count".to_string(), + ), + unknown_output: AverageBlockCumulativeSumPattern::new( + client.clone(), + "unknown_output_count".to_string(), + ), } } } @@ -4178,7 +5752,10 @@ impl SeriesTree_Mining { pub fn new(client: Arc, base_path: String) -> Self { Self { rewards: SeriesTree_Mining_Rewards::new(client.clone(), format!("{base_path}_rewards")), - hashrate: SeriesTree_Mining_Hashrate::new(client.clone(), format!("{base_path}_hashrate")), + hashrate: SeriesTree_Mining_Hashrate::new( + client.clone(), + format!("{base_path}_hashrate"), + ), } } } @@ -4195,8 +5772,14 @@ pub struct SeriesTree_Mining_Rewards { impl SeriesTree_Mining_Rewards { pub fn new(client: Arc, base_path: String) -> Self { Self { - coinbase: AverageBlockCumulativeSumPattern3::new(client.clone(), "coinbase".to_string()), - subsidy: SeriesTree_Mining_Rewards_Subsidy::new(client.clone(), format!("{base_path}_subsidy")), + coinbase: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "coinbase".to_string(), + ), + subsidy: SeriesTree_Mining_Rewards_Subsidy::new( + client.clone(), + format!("{base_path}_subsidy"), + ), fees: SeriesTree_Mining_Rewards_Fees::new(client.clone(), format!("{base_path}_fees")), output_volume: SeriesPattern18::new(client.clone(), "output_volume".to_string()), unclaimed: BlockCumulativePattern::new(client.clone(), "unclaimed_rewards".to_string()), @@ -4217,10 +5800,16 @@ impl SeriesTree_Mining_Rewards_Subsidy { pub fn new(client: Arc, base_path: String) -> Self { Self { block: BtcCentsSatsUsdPattern2::new(client.clone(), "subsidy".to_string()), - cumulative: BtcCentsSatsUsdPattern3::new(client.clone(), "subsidy_cumulative".to_string()), + cumulative: BtcCentsSatsUsdPattern3::new( + client.clone(), + "subsidy_cumulative".to_string(), + ), sum: _1m1w1y24hPattern4::new(client.clone(), "subsidy_sum".to_string()), average: _1m1w1y24hPattern3::new(client.clone(), "subsidy_average".to_string()), - dominance: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "subsidy_dominance".to_string()), + dominance: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "subsidy_dominance".to_string(), + ), } } } @@ -4256,8 +5845,14 @@ impl SeriesTree_Mining_Rewards_Fees { median: _1m1w1y24hPattern4::new(client.clone(), "fees_median".to_string()), pct75: _1m1w1y24hPattern4::new(client.clone(), "fees_pct75".to_string()), pct90: _1m1w1y24hPattern4::new(client.clone(), "fees_pct90".to_string()), - dominance: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "fee_dominance".to_string()), - to_subsidy_ratio: SeriesTree_Mining_Rewards_Fees_ToSubsidyRatio::new(client.clone(), format!("{base_path}_to_subsidy_ratio")), + dominance: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "fee_dominance".to_string(), + ), + to_subsidy_ratio: SeriesTree_Mining_Rewards_Fees_ToSubsidyRatio::new( + client.clone(), + format!("{base_path}_to_subsidy_ratio"), + ), } } } @@ -4310,9 +5905,15 @@ impl SeriesTree_Mining_Hashrate_Rate { pub fn new(client: Arc, base_path: String) -> Self { Self { base: SeriesPattern1::new(client.clone(), "hash_rate".to_string()), - sma: SeriesTree_Mining_Hashrate_Rate_Sma::new(client.clone(), format!("{base_path}_sma")), + 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()), + drawdown: BpsPercentRatioPattern5::new( + client.clone(), + "hash_rate_drawdown".to_string(), + ), } } } @@ -4350,13 +5951,22 @@ pub struct SeriesTree_Cointime { impl SeriesTree_Cointime { pub fn new(client: Arc, base_path: String) -> Self { Self { - activity: SeriesTree_Cointime_Activity::new(client.clone(), format!("{base_path}_activity")), + 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")), + adjusted: SeriesTree_Cointime_Adjusted::new( + client.clone(), + format!("{base_path}_adjusted"), + ), + reserve_risk: SeriesTree_Cointime_ReserveRisk::new( + client.clone(), + format!("{base_path}_reserve_risk"), + ), } } } @@ -4374,12 +5984,21 @@ pub struct SeriesTree_Cointime_Activity { impl SeriesTree_Cointime_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { - coinblocks_created: AverageBlockCumulativeSumPattern::new(client.clone(), "coinblocks_created".to_string()), - coinblocks_stored: AverageBlockCumulativeSumPattern::new(client.clone(), "coinblocks_stored".to_string()), + coinblocks_created: AverageBlockCumulativeSumPattern::new( + client.clone(), + "coinblocks_created".to_string(), + ), + coinblocks_stored: AverageBlockCumulativeSumPattern::new( + client.clone(), + "coinblocks_stored".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".to_string()), - coinblocks_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "coinblocks_destroyed".to_string()), + coinblocks_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + "coinblocks_destroyed".to_string(), + ), } } } @@ -4410,9 +6029,18 @@ pub struct SeriesTree_Cointime_Value { impl SeriesTree_Cointime_Value { pub fn new(client: Arc, base_path: String) -> Self { Self { - destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "cointime_value_destroyed".to_string()), - created: AverageBlockCumulativeSumPattern::new(client.clone(), "cointime_value_created".to_string()), - stored: AverageBlockCumulativeSumPattern::new(client.clone(), "cointime_value_stored".to_string()), + destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + "cointime_value_destroyed".to_string(), + ), + created: AverageBlockCumulativeSumPattern::new( + client.clone(), + "cointime_value_created".to_string(), + ), + stored: AverageBlockCumulativeSumPattern::new( + client.clone(), + "cointime_value_stored".to_string(), + ), vocdd: AverageBlockCumulativeSumPattern::new(client.clone(), "vocdd".to_string()), } } @@ -4452,10 +6080,22 @@ pub struct SeriesTree_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()), - active: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "active_price".to_string()), - true_market_mean: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "true_market_mean".to_string()), - cointime: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "cointime_price".to_string()), + vaulted: BpsCentsPercentilesRatioSatsUsdPattern::new( + client.clone(), + "vaulted_price".to_string(), + ), + active: BpsCentsPercentilesRatioSatsUsdPattern::new( + client.clone(), + "active_price".to_string(), + ), + true_market_mean: BpsCentsPercentilesRatioSatsUsdPattern::new( + client.clone(), + "true_market_mean".to_string(), + ), + cointime: BpsCentsPercentilesRatioSatsUsdPattern::new( + client.clone(), + "cointime_price".to_string(), + ), } } } @@ -4470,9 +6110,18 @@ pub struct SeriesTree_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: SeriesPattern1::new(client.clone(), "cointime_adj_tx_velocity_btc".to_string()), - tx_velocity_fiat: SeriesPattern1::new(client.clone(), "cointime_adj_tx_velocity_usd".to_string()), + inflation_rate: BpsPercentRatioPattern::new( + client.clone(), + "cointime_adj_inflation_rate".to_string(), + ), + tx_velocity_native: SeriesPattern1::new( + client.clone(), + "cointime_adj_tx_velocity_btc".to_string(), + ), + tx_velocity_fiat: SeriesPattern1::new( + client.clone(), + "cointime_adj_tx_velocity_usd".to_string(), + ), } } } @@ -4572,9 +6221,18 @@ impl SeriesTree_Indexes { addr: SeriesTree_Indexes_Addr::new(client.clone(), format!("{base_path}_addr")), 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")), + 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")), @@ -4586,10 +6244,22 @@ impl SeriesTree_Indexes { 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")), - timestamp: SeriesTree_Indexes_Timestamp::new(client.clone(), format!("{base_path}_timestamp")), + 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"), + ), + timestamp: SeriesTree_Indexes_Timestamp::new( + client.clone(), + format!("{base_path}_timestamp"), + ), } } } @@ -4613,18 +6283,33 @@ pub struct SeriesTree_Indexes_Addr { impl SeriesTree_Indexes_Addr { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2pk33: SeriesTree_Indexes_Addr_P2pk33::new(client.clone(), format!("{base_path}_p2pk33")), - p2pk65: SeriesTree_Indexes_Addr_P2pk65::new(client.clone(), format!("{base_path}_p2pk65")), + p2pk33: SeriesTree_Indexes_Addr_P2pk33::new( + client.clone(), + format!("{base_path}_p2pk33"), + ), + p2pk65: SeriesTree_Indexes_Addr_P2pk65::new( + client.clone(), + format!("{base_path}_p2pk65"), + ), p2pkh: SeriesTree_Indexes_Addr_P2pkh::new(client.clone(), format!("{base_path}_p2pkh")), p2sh: SeriesTree_Indexes_Addr_P2sh::new(client.clone(), format!("{base_path}_p2sh")), p2tr: SeriesTree_Indexes_Addr_P2tr::new(client.clone(), format!("{base_path}_p2tr")), - p2wpkh: SeriesTree_Indexes_Addr_P2wpkh::new(client.clone(), format!("{base_path}_p2wpkh")), + p2wpkh: SeriesTree_Indexes_Addr_P2wpkh::new( + client.clone(), + format!("{base_path}_p2wpkh"), + ), p2wsh: SeriesTree_Indexes_Addr_P2wsh::new(client.clone(), format!("{base_path}_p2wsh")), p2a: SeriesTree_Indexes_Addr_P2a::new(client.clone(), format!("{base_path}_p2a")), p2ms: SeriesTree_Indexes_Addr_P2ms::new(client.clone(), format!("{base_path}_p2ms")), empty: SeriesTree_Indexes_Addr_Empty::new(client.clone(), format!("{base_path}_empty")), - unknown: SeriesTree_Indexes_Addr_Unknown::new(client.clone(), format!("{base_path}_unknown")), - op_return: SeriesTree_Indexes_Addr_OpReturn::new(client.clone(), format!("{base_path}_op_return")), + unknown: SeriesTree_Indexes_Addr_Unknown::new( + client.clone(), + format!("{base_path}_unknown"), + ), + op_return: SeriesTree_Indexes_Addr_OpReturn::new( + client.clone(), + format!("{base_path}_op_return"), + ), } } } @@ -5169,13 +6854,28 @@ impl SeriesTree_Indicators { nvt: BpsRatioPattern2::new(client.clone(), "nvt".to_string()), gini: BpsPercentRatioPattern3::new(client.clone(), "gini".to_string()), rhodl_ratio: BpsRatioPattern2::new(client.clone(), "rhodl_ratio".to_string()), - thermo_cap_multiple: BpsRatioPattern2::new(client.clone(), "thermo_cap_multiple".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")), + thermo_cap_multiple: BpsRatioPattern2::new( + client.clone(), + "thermo_cap_multiple".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: SeriesPattern1::new(client.clone(), "seller_exhaustion".to_string()), - realized_envelope: SeriesTree_Indicators_RealizedEnvelope::new(client.clone(), format!("{base_path}_realized_envelope")), + realized_envelope: SeriesTree_Indicators_RealizedEnvelope::new( + client.clone(), + format!("{base_path}_realized_envelope"), + ), } } } @@ -5189,7 +6889,10 @@ pub struct SeriesTree_Indicators_Dormancy { impl SeriesTree_Indicators_Dormancy { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply_adjusted: SeriesPattern1::new(client.clone(), "dormancy_supply_adjusted".to_string()), + supply_adjusted: SeriesPattern1::new( + client.clone(), + "dormancy_supply_adjusted".to_string(), + ), flow: SeriesPattern1::new(client.clone(), "dormancy_flow".to_string()), } } @@ -5212,14 +6915,20 @@ pub struct SeriesTree_Indicators_RealizedEnvelope { impl SeriesTree_Indicators_RealizedEnvelope { pub fn new(client: Arc, base_path: String) -> Self { Self { - pct0_5: CentsSatsUsdPattern::new(client.clone(), "realized_envelope_pct0_5".to_string()), + pct0_5: CentsSatsUsdPattern::new( + client.clone(), + "realized_envelope_pct0_5".to_string(), + ), pct1: CentsSatsUsdPattern::new(client.clone(), "realized_envelope_pct01".to_string()), pct2: CentsSatsUsdPattern::new(client.clone(), "realized_envelope_pct02".to_string()), pct5: CentsSatsUsdPattern::new(client.clone(), "realized_envelope_pct05".to_string()), pct95: CentsSatsUsdPattern::new(client.clone(), "realized_envelope_pct95".to_string()), pct98: CentsSatsUsdPattern::new(client.clone(), "realized_envelope_pct98".to_string()), pct99: CentsSatsUsdPattern::new(client.clone(), "realized_envelope_pct99".to_string()), - pct99_5: CentsSatsUsdPattern::new(client.clone(), "realized_envelope_pct99_5".to_string()), + pct99_5: CentsSatsUsdPattern::new( + client.clone(), + "realized_envelope_pct99_5".to_string(), + ), index: SeriesPattern1::new(client.clone(), "realized_envelope_index".to_string()), score: SeriesPattern1::new(client.clone(), "realized_envelope_score".to_string()), } @@ -5256,12 +6965,27 @@ pub struct SeriesTree_Investing_Period { impl SeriesTree_Investing_Period { pub fn new(client: Arc, base_path: String) -> Self { Self { - dca_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3::new(client.clone(), "dca_stack".to_string()), - dca_cost_basis: SeriesTree_Investing_Period_DcaCostBasis::new(client.clone(), format!("{base_path}_dca_cost_basis")), - dca_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new(client.clone(), "dca_return".to_string()), + dca_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3::new( + client.clone(), + "dca_stack".to_string(), + ), + dca_cost_basis: SeriesTree_Investing_Period_DcaCostBasis::new( + client.clone(), + format!("{base_path}_dca_cost_basis"), + ), + dca_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new( + client.clone(), + "dca_return".to_string(), + ), dca_cagr: _10y2y3y4y5y6y8yPattern::new(client.clone(), "dca_cagr".to_string()), - lump_sum_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3::new(client.clone(), "lump_sum_stack".to_string()), - lump_sum_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new(client.clone(), "lump_sum_return".to_string()), + lump_sum_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3::new( + client.clone(), + "lump_sum_stack".to_string(), + ), + lump_sum_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new( + client.clone(), + "lump_sum_return".to_string(), + ), } } } @@ -5311,9 +7035,18 @@ pub struct SeriesTree_Investing_Class { impl SeriesTree_Investing_Class { pub fn new(client: Arc, base_path: String) -> Self { Self { - dca_stack: SeriesTree_Investing_Class_DcaStack::new(client.clone(), format!("{base_path}_dca_stack")), - dca_cost_basis: SeriesTree_Investing_Class_DcaCostBasis::new(client.clone(), format!("{base_path}_dca_cost_basis")), - dca_return: SeriesTree_Investing_Class_DcaReturn::new(client.clone(), format!("{base_path}_dca_return")), + dca_stack: SeriesTree_Investing_Class_DcaStack::new( + client.clone(), + format!("{base_path}_dca_stack"), + ), + dca_cost_basis: SeriesTree_Investing_Class_DcaCostBasis::new( + client.clone(), + format!("{base_path}_dca_cost_basis"), + ), + dca_return: SeriesTree_Investing_Class_DcaReturn::new( + client.clone(), + format!("{base_path}_dca_return"), + ), } } } @@ -5337,18 +7070,54 @@ pub struct SeriesTree_Investing_Class_DcaStack { impl SeriesTree_Investing_Class_DcaStack { pub fn new(client: Arc, base_path: String) -> Self { Self { - from_2015: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2015".to_string()), - from_2016: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2016".to_string()), - from_2017: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2017".to_string()), - from_2018: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2018".to_string()), - from_2019: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2019".to_string()), - from_2020: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2020".to_string()), - from_2021: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2021".to_string()), - from_2022: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2022".to_string()), - from_2023: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2023".to_string()), - from_2024: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2024".to_string()), - from_2025: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2025".to_string()), - from_2026: BtcCentsSatsUsdPattern3::new(client.clone(), "dca_stack_from_2026".to_string()), + from_2015: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2015".to_string(), + ), + from_2016: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2016".to_string(), + ), + from_2017: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2017".to_string(), + ), + from_2018: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2018".to_string(), + ), + from_2019: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2019".to_string(), + ), + from_2020: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2020".to_string(), + ), + from_2021: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2021".to_string(), + ), + from_2022: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2022".to_string(), + ), + from_2023: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2023".to_string(), + ), + from_2024: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2024".to_string(), + ), + from_2025: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2025".to_string(), + ), + from_2026: BtcCentsSatsUsdPattern3::new( + client.clone(), + "dca_stack_from_2026".to_string(), + ), } } } @@ -5372,18 +7141,54 @@ pub struct SeriesTree_Investing_Class_DcaCostBasis { impl SeriesTree_Investing_Class_DcaCostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { - from_2015: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2015".to_string()), - from_2016: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2016".to_string()), - from_2017: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2017".to_string()), - from_2018: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2018".to_string()), - from_2019: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2019".to_string()), - from_2020: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2020".to_string()), - from_2021: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2021".to_string()), - from_2022: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2022".to_string()), - from_2023: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2023".to_string()), - from_2024: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2024".to_string()), - from_2025: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2025".to_string()), - from_2026: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2026".to_string()), + from_2015: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2015".to_string(), + ), + from_2016: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2016".to_string(), + ), + from_2017: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2017".to_string(), + ), + from_2018: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2018".to_string(), + ), + from_2019: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2019".to_string(), + ), + from_2020: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2020".to_string(), + ), + from_2021: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2021".to_string(), + ), + from_2022: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2022".to_string(), + ), + from_2023: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2023".to_string(), + ), + from_2024: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2024".to_string(), + ), + from_2025: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2025".to_string(), + ), + from_2026: CentsSatsUsdPattern::new( + client.clone(), + "dca_cost_basis_from_2026".to_string(), + ), } } } @@ -5407,18 +7212,54 @@ pub struct SeriesTree_Investing_Class_DcaReturn { impl SeriesTree_Investing_Class_DcaReturn { pub fn new(client: Arc, base_path: String) -> Self { Self { - from_2015: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2015".to_string()), - from_2016: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2016".to_string()), - from_2017: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2017".to_string()), - from_2018: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2018".to_string()), - from_2019: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2019".to_string()), - from_2020: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2020".to_string()), - from_2021: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2021".to_string()), - from_2022: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2022".to_string()), - from_2023: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2023".to_string()), - from_2024: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2024".to_string()), - from_2025: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2025".to_string()), - from_2026: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2026".to_string()), + from_2015: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2015".to_string(), + ), + from_2016: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2016".to_string(), + ), + from_2017: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2017".to_string(), + ), + from_2018: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2018".to_string(), + ), + from_2019: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2019".to_string(), + ), + from_2020: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2020".to_string(), + ), + from_2021: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2021".to_string(), + ), + from_2022: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2022".to_string(), + ), + from_2023: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2023".to_string(), + ), + from_2024: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2024".to_string(), + ), + from_2025: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2025".to_string(), + ), + from_2026: BpsPercentRatioPattern::new( + client.clone(), + "dca_return_from_2026".to_string(), + ), } } } @@ -5438,12 +7279,21 @@ impl SeriesTree_Market { pub fn new(client: Arc, base_path: String) -> Self { Self { ath: SeriesTree_Market_Ath::new(client.clone(), format!("{base_path}_ath")), - lookback: SeriesTree_Market_Lookback::new(client.clone(), format!("{base_path}_lookback")), + lookback: SeriesTree_Market_Lookback::new( + client.clone(), + format!("{base_path}_lookback"), + ), returns: SeriesTree_Market_Returns::new(client.clone(), format!("{base_path}_returns")), volatility: _1m1w1y24hPattern::new(client.clone(), "price_volatility".to_string()), range: SeriesTree_Market_Range::new(client.clone(), format!("{base_path}_range")), - moving_average: SeriesTree_Market_MovingAverage::new(client.clone(), format!("{base_path}_moving_average")), - technical: SeriesTree_Market_Technical::new(client.clone(), format!("{base_path}_technical")), + moving_average: SeriesTree_Market_MovingAverage::new( + client.clone(), + format!("{base_path}_moving_average"), + ), + technical: SeriesTree_Market_Technical::new( + client.clone(), + format!("{base_path}_technical"), + ), } } } @@ -5465,8 +7315,14 @@ impl SeriesTree_Market_Ath { drawdown: BpsPercentRatioPattern5::new(client.clone(), "price_drawdown".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()), + 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(), + ), } } } @@ -5518,9 +7374,15 @@ pub struct SeriesTree_Market_Returns { impl SeriesTree_Market_Returns { pub fn new(client: Arc, base_path: String) -> Self { Self { - periods: SeriesTree_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: SeriesTree_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"), + ), } } } @@ -5573,7 +7435,10 @@ pub struct SeriesTree_Market_Returns_Sd24h { impl SeriesTree_Market_Returns_Sd24h { pub fn new(client: Arc, base_path: String) -> Self { Self { - _24h: SeriesTree_Market_Returns_Sd24h_24h::new(client.clone(), format!("{base_path}_24h")), + _24h: SeriesTree_Market_Returns_Sd24h_24h::new( + client.clone(), + format!("{base_path}_24h"), + ), _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")), @@ -5656,8 +7521,14 @@ impl SeriesTree_Market_Range { min: _1m1w1y2wPattern::new(client.clone(), "price_min".to_string()), max: _1m1w1y2wPattern::new(client.clone(), "price_max".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()), + 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(), + ), } } } @@ -5671,8 +7542,14 @@ pub struct SeriesTree_Market_MovingAverage { impl SeriesTree_Market_MovingAverage { pub fn new(client: Arc, base_path: String) -> Self { Self { - sma: SeriesTree_Market_MovingAverage_Sma::new(client.clone(), format!("{base_path}_sma")), - ema: SeriesTree_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"), + ), } } } @@ -5710,8 +7587,14 @@ impl SeriesTree_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: 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")), + _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()), @@ -5823,7 +7706,10 @@ impl SeriesTree_Market_Technical { Self { rsi: SeriesTree_Market_Technical_Rsi::new(client.clone(), format!("{base_path}_rsi")), pi_cycle: BpsRatioPattern2::new(client.clone(), "pi_cycle".to_string()), - macd: SeriesTree_Market_Technical_Macd::new(client.clone(), format!("{base_path}_macd")), + macd: SeriesTree_Market_Technical_Macd::new( + client.clone(), + format!("{base_path}_macd"), + ), } } } @@ -5855,9 +7741,18 @@ pub struct SeriesTree_Market_Technical_Macd { impl SeriesTree_Market_Technical_Macd { pub fn new(client: Arc, base_path: String) -> Self { Self { - _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")), + _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"), + ), } } } @@ -5978,16 +7873,28 @@ impl SeriesTree_Pools_Major { btcguild: BlocksDominanceRewardsPattern::new(client.clone(), "btcguild".to_string()), eligius: BlocksDominanceRewardsPattern::new(client.clone(), "eligius".to_string()), f2pool: BlocksDominanceRewardsPattern::new(client.clone(), "f2pool".to_string()), - braiinspool: BlocksDominanceRewardsPattern::new(client.clone(), "braiinspool".to_string()), + braiinspool: BlocksDominanceRewardsPattern::new( + client.clone(), + "braiinspool".to_string(), + ), antpool: BlocksDominanceRewardsPattern::new(client.clone(), "antpool".to_string()), btcc: BlocksDominanceRewardsPattern::new(client.clone(), "btcc".to_string()), bwpool: BlocksDominanceRewardsPattern::new(client.clone(), "bwpool".to_string()), bitfury: BlocksDominanceRewardsPattern::new(client.clone(), "bitfury".to_string()), viabtc: BlocksDominanceRewardsPattern::new(client.clone(), "viabtc".to_string()), poolin: BlocksDominanceRewardsPattern::new(client.clone(), "poolin".to_string()), - spiderpool: BlocksDominanceRewardsPattern::new(client.clone(), "spiderpool".to_string()), - binancepool: BlocksDominanceRewardsPattern::new(client.clone(), "binancepool".to_string()), - foundryusa: BlocksDominanceRewardsPattern::new(client.clone(), "foundryusa".to_string()), + spiderpool: BlocksDominanceRewardsPattern::new( + client.clone(), + "spiderpool".to_string(), + ), + binancepool: BlocksDominanceRewardsPattern::new( + client.clone(), + "binancepool".to_string(), + ), + foundryusa: BlocksDominanceRewardsPattern::new( + client.clone(), + "foundryusa".to_string(), + ), sbicrypto: BlocksDominanceRewardsPattern::new(client.clone(), "sbicrypto".to_string()), marapool: BlocksDominanceRewardsPattern::new(client.clone(), "marapool".to_string()), secpool: BlocksDominanceRewardsPattern::new(client.clone(), "secpool".to_string()), @@ -6190,7 +8097,10 @@ impl SeriesTree_Pools_Minor { ckpool: BlocksDominancePattern::new(client.clone(), "ckpool".to_string()), nicehash: BlocksDominancePattern::new(client.clone(), "nicehash".to_string()), bitclub: BlocksDominancePattern::new(client.clone(), "bitclub".to_string()), - bitcoinaffiliatenetwork: BlocksDominancePattern::new(client.clone(), "bitcoinaffiliatenetwork".to_string()), + bitcoinaffiliatenetwork: BlocksDominancePattern::new( + client.clone(), + "bitcoinaffiliatenetwork".to_string(), + ), exxbw: BlocksDominancePattern::new(client.clone(), "exxbw".to_string()), bitsolo: BlocksDominancePattern::new(client.clone(), "bitsolo".to_string()), twentyoneinc: BlocksDominancePattern::new(client.clone(), "twentyoneinc".to_string()), @@ -6213,7 +8123,10 @@ impl SeriesTree_Pools_Minor { dcexploration: BlocksDominancePattern::new(client.clone(), "dcexploration".to_string()), dcex: BlocksDominancePattern::new(client.clone(), "dcex".to_string()), btpool: BlocksDominancePattern::new(client.clone(), "btpool".to_string()), - fiftyeightcoin: BlocksDominancePattern::new(client.clone(), "fiftyeightcoin".to_string()), + fiftyeightcoin: BlocksDominancePattern::new( + client.clone(), + "fiftyeightcoin".to_string(), + ), bitcoinindia: BlocksDominancePattern::new(client.clone(), "bitcoinindia".to_string()), shawnp0wers: BlocksDominancePattern::new(client.clone(), "shawnp0wers".to_string()), phashio: BlocksDominancePattern::new(client.clone(), "phashio".to_string()), @@ -6226,8 +8139,14 @@ impl SeriesTree_Pools_Minor { rawpool: BlocksDominancePattern::new(client.clone(), "rawpool".to_string()), haominer: BlocksDominancePattern::new(client.clone(), "haominer".to_string()), helix: BlocksDominancePattern::new(client.clone(), "helix".to_string()), - bitcoinukraine: BlocksDominancePattern::new(client.clone(), "bitcoinukraine".to_string()), - secretsuperstar: BlocksDominancePattern::new(client.clone(), "secretsuperstar".to_string()), + bitcoinukraine: BlocksDominancePattern::new( + client.clone(), + "bitcoinukraine".to_string(), + ), + secretsuperstar: BlocksDominancePattern::new( + client.clone(), + "secretsuperstar".to_string(), + ), tigerpoolnet: BlocksDominancePattern::new(client.clone(), "tigerpoolnet".to_string()), sigmapoolcom: BlocksDominancePattern::new(client.clone(), "sigmapoolcom".to_string()), okpooltop: BlocksDominancePattern::new(client.clone(), "okpooltop".to_string()), @@ -6244,25 +8163,40 @@ impl SeriesTree_Pools_Minor { arkpool: BlocksDominancePattern::new(client.clone(), "arkpool".to_string()), purebtccom: BlocksDominancePattern::new(client.clone(), "purebtccom".to_string()), kucoinpool: BlocksDominancePattern::new(client.clone(), "kucoinpool".to_string()), - entrustcharitypool: BlocksDominancePattern::new(client.clone(), "entrustcharitypool".to_string()), + entrustcharitypool: BlocksDominancePattern::new( + client.clone(), + "entrustcharitypool".to_string(), + ), okminer: BlocksDominancePattern::new(client.clone(), "okminer".to_string()), titan: BlocksDominancePattern::new(client.clone(), "titan".to_string()), pegapool: BlocksDominancePattern::new(client.clone(), "pegapool".to_string()), btcnuggets: BlocksDominancePattern::new(client.clone(), "btcnuggets".to_string()), cloudhashing: BlocksDominancePattern::new(client.clone(), "cloudhashing".to_string()), - digitalxmintsy: BlocksDominancePattern::new(client.clone(), "digitalxmintsy".to_string()), + digitalxmintsy: BlocksDominancePattern::new( + client.clone(), + "digitalxmintsy".to_string(), + ), telco214: BlocksDominancePattern::new(client.clone(), "telco214".to_string()), btcpoolparty: BlocksDominancePattern::new(client.clone(), "btcpoolparty".to_string()), multipool: BlocksDominancePattern::new(client.clone(), "multipool".to_string()), - transactioncoinmining: BlocksDominancePattern::new(client.clone(), "transactioncoinmining".to_string()), + transactioncoinmining: BlocksDominancePattern::new( + client.clone(), + "transactioncoinmining".to_string(), + ), btcdig: BlocksDominancePattern::new(client.clone(), "btcdig".to_string()), - trickysbtcpool: BlocksDominancePattern::new(client.clone(), "trickysbtcpool".to_string()), + trickysbtcpool: BlocksDominancePattern::new( + client.clone(), + "trickysbtcpool".to_string(), + ), btcmp: BlocksDominancePattern::new(client.clone(), "btcmp".to_string()), eobot: BlocksDominancePattern::new(client.clone(), "eobot".to_string()), unomp: BlocksDominancePattern::new(client.clone(), "unomp".to_string()), patels: BlocksDominancePattern::new(client.clone(), "patels".to_string()), gogreenlight: BlocksDominancePattern::new(client.clone(), "gogreenlight".to_string()), - bitcoinindiapool: BlocksDominancePattern::new(client.clone(), "bitcoinindiapool".to_string()), + bitcoinindiapool: BlocksDominancePattern::new( + client.clone(), + "bitcoinindiapool".to_string(), + ), ekanembtc: BlocksDominancePattern::new(client.clone(), "ekanembtc".to_string()), canoe: BlocksDominancePattern::new(client.clone(), "canoe".to_string()), tiger: BlocksDominancePattern::new(client.clone(), "tiger".to_string()), @@ -6270,8 +8204,14 @@ impl SeriesTree_Pools_Minor { zulupool: BlocksDominancePattern::new(client.clone(), "zulupool".to_string()), wiz: BlocksDominancePattern::new(client.clone(), "wiz".to_string()), wk057: BlocksDominancePattern::new(client.clone(), "wk057".to_string()), - futurebitapollosolo: BlocksDominancePattern::new(client.clone(), "futurebitapollosolo".to_string()), - carbonnegative: BlocksDominancePattern::new(client.clone(), "carbonnegative".to_string()), + futurebitapollosolo: BlocksDominancePattern::new( + client.clone(), + "futurebitapollosolo".to_string(), + ), + carbonnegative: BlocksDominancePattern::new( + client.clone(), + "carbonnegative".to_string(), + ), portlandhodl: BlocksDominancePattern::new(client.clone(), "portlandhodl".to_string()), phoenix: BlocksDominancePattern::new(client.clone(), "phoenix".to_string()), neopool: BlocksDominancePattern::new(client.clone(), "neopool".to_string()), @@ -6378,13 +8318,28 @@ impl SeriesTree_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { state: SeriesPattern18::new(client.clone(), "supply_state".to_string()), - circulating: BtcCentsSatsUsdPattern3::new(client.clone(), "circulating_supply".to_string()), + circulating: BtcCentsSatsUsdPattern3::new( + client.clone(), + "circulating_supply".to_string(), + ), burned: BlockCumulativePattern::new(client.clone(), "unspendable_supply".to_string()), - inflation_rate: BpsPercentRatioPattern::new(client.clone(), "inflation_rate".to_string()), - velocity: SeriesTree_Supply_Velocity::new(client.clone(), format!("{base_path}_velocity")), + inflation_rate: BpsPercentRatioPattern::new( + client.clone(), + "inflation_rate".to_string(), + ), + 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: BtcCentsSatsUsdPattern3::new(client.clone(), "hodled_or_lost_supply".to_string()), + market_minus_realized_cap_growth_rate: _1m1w1y24hPattern::new( + client.clone(), + "market_minus_realized_cap_growth_rate".to_string(), + ), + hodled_or_lost: BtcCentsSatsUsdPattern3::new( + client.clone(), + "hodled_or_lost_supply".to_string(), + ), } } } @@ -6443,17 +8398,41 @@ impl SeriesTree_Cohorts_Utxo { 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")), + 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")), + 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")), + profitability: SeriesTree_Cohorts_Utxo_Profitability::new( + client.clone(), + format!("{base_path}_profitability"), + ), + matured: SeriesTree_Cohorts_Utxo_Matured::new( + client.clone(), + format!("{base_path}_matured"), + ), } } } @@ -6471,12 +8450,30 @@ pub struct SeriesTree_Cohorts_Utxo_All { impl SeriesTree_Cohorts_Utxo_All { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply: SeriesTree_Cohorts_Utxo_All_Supply::new(client.clone(), format!("{base_path}_supply")), - outputs: SeriesTree_Cohorts_Utxo_All_Outputs::new(client.clone(), format!("{base_path}_outputs")), - 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")), + supply: SeriesTree_Cohorts_Utxo_All_Supply::new( + client.clone(), + format!("{base_path}_supply"), + ), + outputs: SeriesTree_Cohorts_Utxo_All_Outputs::new( + client.clone(), + format!("{base_path}_outputs"), + ), + 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"), + ), } } } @@ -6496,7 +8493,10 @@ impl SeriesTree_Cohorts_Utxo_All_Supply { total: BtcCentsSatsUsdPattern3::new(client.clone(), "supply".to_string()), delta: AbsoluteRatePattern::new(client.clone(), "supply_delta".to_string()), half: BtcCentsSatsUsdPattern3::new(client.clone(), "supply_half".to_string()), - in_profit: BtcCentsSatsToUsdPattern2::new(client.clone(), "supply_in_profit".to_string()), + in_profit: BtcCentsSatsToUsdPattern2::new( + client.clone(), + "supply_in_profit".to_string(), + ), in_loss: BtcCentsSatsToUsdPattern2::new(client.clone(), "supply_in_loss".to_string()), } } @@ -6513,7 +8513,10 @@ impl SeriesTree_Cohorts_Utxo_All_Outputs { pub fn new(client: Arc, base_path: String) -> Self { Self { unspent_count: BaseDeltaPattern::new(client.clone(), "utxo_count".to_string()), - spent_count: AverageBlockCumulativeSumPattern2::new(client.clone(), "spent_utxo_count".to_string()), + spent_count: AverageBlockCumulativeSumPattern2::new( + client.clone(), + "spent_utxo_count".to_string(), + ), spending_rate: SeriesPattern1::new(client.clone(), "spending_rate".to_string()), } } @@ -6530,9 +8533,18 @@ pub struct SeriesTree_Cohorts_Utxo_All_Activity { impl SeriesTree_Cohorts_Utxo_All_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { - transfer_volume: AverageBlockCumulativeInSumPattern::new(client.clone(), "transfer_volume".to_string()), - coindays_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "coindays_destroyed".to_string()), - coinyears_destroyed: SeriesPattern1::new(client.clone(), "coinyears_destroyed".to_string()), + transfer_volume: AverageBlockCumulativeInSumPattern::new( + client.clone(), + "transfer_volume".to_string(), + ), + coindays_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + "coindays_destroyed".to_string(), + ), + coinyears_destroyed: SeriesPattern1::new( + client.clone(), + "coinyears_destroyed".to_string(), + ), dormancy: _1m1w1y24hPattern::new(client.clone(), "dormancy".to_string()), } } @@ -6559,16 +8571,37 @@ impl SeriesTree_Cohorts_Utxo_All_Realized { Self { cap: CentsDeltaToUsdPattern::new(client.clone(), "realized_cap".to_string()), profit: BlockCumulativeSumPattern::new(client.clone(), "realized_profit".to_string()), - loss: BlockCumulativeNegativeSumPattern::new(client.clone(), "realized_loss".to_string()), - price: SeriesTree_Cohorts_Utxo_All_Realized_Price::new(client.clone(), format!("{base_path}_price")), + loss: BlockCumulativeNegativeSumPattern::new( + client.clone(), + "realized_loss".to_string(), + ), + price: SeriesTree_Cohorts_Utxo_All_Realized_Price::new( + client.clone(), + format!("{base_path}_price"), + ), mvrv: SeriesPattern1::new(client.clone(), "mvrv".to_string()), net_pnl: BlockChangeCumulativeDeltaSumPattern::new(client.clone(), "net".to_string()), - sopr: SeriesTree_Cohorts_Utxo_All_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), - gross_pnl: BlockCumulativeSumPattern::new(client.clone(), "realized_gross_pnl".to_string()), - sell_side_risk_ratio: _1m1w1y24hPattern7::new(client.clone(), "sell_side_risk_ratio".to_string()), - peak_regret: BlockCumulativeSumPattern::new(client.clone(), "realized_peak_regret".to_string()), + sopr: SeriesTree_Cohorts_Utxo_All_Realized_Sopr::new( + client.clone(), + format!("{base_path}_sopr"), + ), + gross_pnl: BlockCumulativeSumPattern::new( + client.clone(), + "realized_gross_pnl".to_string(), + ), + sell_side_risk_ratio: _1m1w1y24hPattern7::new( + client.clone(), + "sell_side_risk_ratio".to_string(), + ), + peak_regret: BlockCumulativeSumPattern::new( + client.clone(), + "realized_peak_regret".to_string(), + ), investor: PricePattern::new(client.clone(), "investor_price".to_string()), - profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), "realized_profit_to_loss_ratio".to_string()), + profit_to_loss_ratio: _1m1w1y24hPattern::new( + client.clone(), + "realized_profit_to_loss_ratio".to_string(), + ), } } } @@ -6593,9 +8626,15 @@ impl SeriesTree_Cohorts_Utxo_All_Realized_Price { 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: Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new(client.clone(), "realized_price".to_string()), + percentiles: Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new( + client.clone(), + "realized_price".to_string(), + ), sma: _1m1w1y2y4yAllPattern::new(client.clone(), "realized_price_ratio_sma".to_string()), - std_dev: SeriesTree_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"), + ), } } } @@ -6611,10 +8650,22 @@ pub struct SeriesTree_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: 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")), + 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"), + ), } } } @@ -6644,18 +8695,66 @@ impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All { 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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p1_5sd".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p2sd".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p2_5sd".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p3sd".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m0_5sd".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m1sd".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m1_5sd".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m2sd".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m2_5sd".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m3sd".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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p1_5sd".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p2sd".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p2_5sd".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p3sd".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m0_5sd".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m1sd".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m1_5sd".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m2sd".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m2_5sd".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m3sd".to_string(), + ), } } } @@ -6683,20 +8782,71 @@ impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y { pub fn new(client: Arc, base_path: String) -> Self { Self { sd: SeriesPattern1::new(client.clone(), "realized_price_ratio_sd_4y".to_string()), - zscore: SeriesPattern1::new(client.clone(), "realized_price_ratio_zscore_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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p1_5sd_4y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p2sd_4y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p2_5sd_4y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p3sd_4y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m0_5sd_4y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m1sd_4y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m1_5sd_4y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m2sd_4y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m2_5sd_4y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p1_5sd_4y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p2sd_4y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p2_5sd_4y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p3sd_4y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m0_5sd_4y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m1sd_4y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m1_5sd_4y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m2sd_4y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m2_5sd_4y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m3sd_4y".to_string(), + ), } } } @@ -6724,20 +8874,71 @@ impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y { pub fn new(client: Arc, base_path: String) -> Self { Self { sd: SeriesPattern1::new(client.clone(), "realized_price_ratio_sd_2y".to_string()), - zscore: SeriesPattern1::new(client.clone(), "realized_price_ratio_zscore_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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p1_5sd_2y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p2sd_2y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p2_5sd_2y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p3sd_2y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m0_5sd_2y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m1sd_2y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m1_5sd_2y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m2sd_2y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m2_5sd_2y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p1_5sd_2y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p2sd_2y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p2_5sd_2y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p3sd_2y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m0_5sd_2y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m1sd_2y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m1_5sd_2y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m2sd_2y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m2_5sd_2y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m3sd_2y".to_string(), + ), } } } @@ -6765,20 +8966,71 @@ impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y { pub fn new(client: Arc, base_path: String) -> Self { Self { sd: SeriesPattern1::new(client.clone(), "realized_price_ratio_sd_1y".to_string()), - zscore: SeriesPattern1::new(client.clone(), "realized_price_ratio_zscore_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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p1_5sd_1y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p2sd_1y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p2_5sd_1y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p3sd_1y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m0_5sd_1y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m1sd_1y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m1_5sd_1y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m2sd_1y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m2_5sd_1y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p1_5sd_1y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p2sd_1y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p2_5sd_1y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "p3sd_1y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m0_5sd_1y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m1sd_1y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m1_5sd_1y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m2sd_1y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m2_5sd_1y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "realized_price".to_string(), + "m3sd_1y".to_string(), + ), } } } @@ -6793,9 +9045,15 @@ pub struct SeriesTree_Cohorts_Utxo_All_Realized_Sopr { impl SeriesTree_Cohorts_Utxo_All_Realized_Sopr { pub fn new(client: Arc, base_path: String) -> Self { Self { - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "value_destroyed".to_string()), + value_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + "value_destroyed".to_string(), + ), ratio: _1m1w1y24hPattern::new(client.clone(), "sopr".to_string()), - adjusted: SeriesTree_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"), + ), } } } @@ -6811,8 +9069,14 @@ 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()), - transfer_volume: AverageBlockCumulativeSumPattern::new(client.clone(), "adj_value_created".to_string()), - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "adj_value_destroyed".to_string()), + transfer_volume: AverageBlockCumulativeSumPattern::new( + client.clone(), + "adj_value_created".to_string(), + ), + value_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + "adj_value_destroyed".to_string(), + ), } } } @@ -6859,14 +9123,32 @@ 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: 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")), + 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: CentsUsdPattern3::new(client.clone(), "unrealized_gross_pnl".to_string()), invested_capital: InPattern::new(client.clone(), "invested_capital_in".to_string()), - investor_cap_in_profit_raw: SeriesPattern18::new(client.clone(), "investor_cap_in_profit_raw".to_string()), - investor_cap_in_loss_raw: SeriesPattern18::new(client.clone(), "investor_cap_in_loss_raw".to_string()), - sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), + investor_cap_in_profit_raw: SeriesPattern18::new( + client.clone(), + "investor_cap_in_profit_raw".to_string(), + ), + investor_cap_in_loss_raw: SeriesPattern18::new( + client.clone(), + "investor_cap_in_loss_raw".to_string(), + ), + sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment::new( + client.clone(), + format!("{base_path}_sentiment"), + ), } } } @@ -6884,8 +9166,14 @@ impl SeriesTree_Cohorts_Utxo_All_Unrealized_Profit { Self { usd: SeriesPattern1::new(client.clone(), "unrealized_profit".to_string()), cents: SeriesPattern1::new(client.clone(), "unrealized_profit_cents".to_string()), - to_mcap: BpsPercentRatioPattern3::new(client.clone(), "unrealized_profit_to_mcap".to_string()), - to_own_gross_pnl: BpsPercentRatioPattern3::new(client.clone(), "unrealized_profit_to_own_gross_pnl".to_string()), + to_mcap: BpsPercentRatioPattern3::new( + client.clone(), + "unrealized_profit_to_mcap".to_string(), + ), + to_own_gross_pnl: BpsPercentRatioPattern3::new( + client.clone(), + "unrealized_profit_to_own_gross_pnl".to_string(), + ), } } } @@ -6905,8 +9193,14 @@ impl SeriesTree_Cohorts_Utxo_All_Unrealized_Loss { usd: SeriesPattern1::new(client.clone(), "unrealized_loss".to_string()), cents: SeriesPattern1::new(client.clone(), "unrealized_loss_cents".to_string()), negative: SeriesPattern1::new(client.clone(), "unrealized_loss_neg".to_string()), - to_mcap: BpsPercentRatioPattern3::new(client.clone(), "unrealized_loss_to_mcap".to_string()), - to_own_gross_pnl: BpsPercentRatioPattern3::new(client.clone(), "unrealized_loss_to_own_gross_pnl".to_string()), + to_mcap: BpsPercentRatioPattern3::new( + client.clone(), + "unrealized_loss_to_mcap".to_string(), + ), + to_own_gross_pnl: BpsPercentRatioPattern3::new( + client.clone(), + "unrealized_loss_to_own_gross_pnl".to_string(), + ), } } } @@ -6923,7 +9217,10 @@ impl SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl { Self { usd: SeriesPattern1::new(client.clone(), "net_unrealized_pnl".to_string()), cents: SeriesPattern1::new(client.clone(), "net_unrealized_pnl_cents".to_string()), - to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), "net_unrealized_pnl_to_own_gross_pnl".to_string()), + to_own_gross_pnl: BpsPercentRatioPattern::new( + client.clone(), + "net_unrealized_pnl_to_own_gross_pnl".to_string(), + ), } } } @@ -6960,10 +9257,19 @@ impl SeriesTree_Cohorts_Utxo_Sth { Self { supply: DeltaHalfInToTotalPattern2::new(client.clone(), "sth_supply".to_string()), outputs: SpendingSpentUnspentPattern::new(client.clone(), "sth".to_string()), - activity: CoindaysCoinyearsDormancyTransferPattern::new(client.clone(), "sth".to_string()), - realized: SeriesTree_Cohorts_Utxo_Sth_Realized::new(client.clone(), format!("{base_path}_realized")), + activity: CoindaysCoinyearsDormancyTransferPattern::new( + client.clone(), + "sth".to_string(), + ), + realized: SeriesTree_Cohorts_Utxo_Sth_Realized::new( + client.clone(), + format!("{base_path}_realized"), + ), cost_basis: InMaxMinPerSupplyPattern::new(client.clone(), "sth".to_string()), - unrealized: GrossInvestedInvestorLossNetNuplProfitSentimentPattern2::new(client.clone(), "sth".to_string()), + unrealized: GrossInvestedInvestorLossNetNuplProfitSentimentPattern2::new( + client.clone(), + "sth".to_string(), + ), } } } @@ -6988,17 +9294,41 @@ impl SeriesTree_Cohorts_Utxo_Sth_Realized { pub fn new(client: Arc, base_path: String) -> Self { Self { cap: CentsDeltaToUsdPattern::new(client.clone(), "sth_realized_cap".to_string()), - profit: BlockCumulativeSumPattern::new(client.clone(), "sth_realized_profit".to_string()), - loss: BlockCumulativeNegativeSumPattern::new(client.clone(), "sth_realized_loss".to_string()), - price: SeriesTree_Cohorts_Utxo_Sth_Realized_Price::new(client.clone(), format!("{base_path}_price")), + profit: BlockCumulativeSumPattern::new( + client.clone(), + "sth_realized_profit".to_string(), + ), + loss: BlockCumulativeNegativeSumPattern::new( + client.clone(), + "sth_realized_loss".to_string(), + ), + price: SeriesTree_Cohorts_Utxo_Sth_Realized_Price::new( + client.clone(), + format!("{base_path}_price"), + ), mvrv: SeriesPattern1::new(client.clone(), "sth_mvrv".to_string()), - net_pnl: BlockChangeCumulativeDeltaSumPattern::new(client.clone(), "sth_net".to_string()), + net_pnl: BlockChangeCumulativeDeltaSumPattern::new( + client.clone(), + "sth_net".to_string(), + ), sopr: AdjustedRatioValuePattern::new(client.clone(), "sth".to_string()), - gross_pnl: BlockCumulativeSumPattern::new(client.clone(), "sth_realized_gross_pnl".to_string()), - sell_side_risk_ratio: _1m1w1y24hPattern7::new(client.clone(), "sth_sell_side_risk_ratio".to_string()), - peak_regret: BlockCumulativeSumPattern::new(client.clone(), "sth_realized_peak_regret".to_string()), + gross_pnl: BlockCumulativeSumPattern::new( + client.clone(), + "sth_realized_gross_pnl".to_string(), + ), + sell_side_risk_ratio: _1m1w1y24hPattern7::new( + client.clone(), + "sth_sell_side_risk_ratio".to_string(), + ), + peak_regret: BlockCumulativeSumPattern::new( + client.clone(), + "sth_realized_peak_regret".to_string(), + ), investor: PricePattern::new(client.clone(), "sth_investor_price".to_string()), - profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), "sth_realized_profit_to_loss_ratio".to_string()), + profit_to_loss_ratio: _1m1w1y24hPattern::new( + client.clone(), + "sth_realized_profit_to_loss_ratio".to_string(), + ), } } } @@ -7023,9 +9353,18 @@ impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price { 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: Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new(client.clone(), "sth_realized_price".to_string()), - sma: _1m1w1y2y4yAllPattern::new(client.clone(), "sth_realized_price_ratio_sma".to_string()), - std_dev: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev::new(client.clone(), format!("{base_path}_std_dev")), + percentiles: Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new( + client.clone(), + "sth_realized_price".to_string(), + ), + sma: _1m1w1y2y4yAllPattern::new( + client.clone(), + "sth_realized_price_ratio_sma".to_string(), + ), + std_dev: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev::new( + client.clone(), + format!("{base_path}_std_dev"), + ), } } } @@ -7041,10 +9380,22 @@ pub struct SeriesTree_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: 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")), + 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"), + ), } } } @@ -7072,20 +9423,71 @@ impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All { pub fn new(client: Arc, base_path: String) -> Self { Self { sd: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_sd".to_string()), - zscore: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_zscore".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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p1_5sd".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p2sd".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p2_5sd".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p3sd".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m0_5sd".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m1sd".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m1_5sd".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m2sd".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m2_5sd".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m3sd".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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p1_5sd".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p2sd".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p2_5sd".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p3sd".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m0_5sd".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m1sd".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m1_5sd".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m2sd".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m2_5sd".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m3sd".to_string(), + ), } } } @@ -7113,20 +9515,71 @@ impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y { pub fn new(client: Arc, base_path: String) -> Self { Self { 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()), + 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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p1_5sd_4y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p2sd_4y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p2_5sd_4y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p3sd_4y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m0_5sd_4y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m1sd_4y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m1_5sd_4y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m2sd_4y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m2_5sd_4y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p1_5sd_4y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p2sd_4y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p2_5sd_4y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p3sd_4y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m0_5sd_4y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m1sd_4y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m1_5sd_4y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m2sd_4y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m2_5sd_4y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m3sd_4y".to_string(), + ), } } } @@ -7154,20 +9607,71 @@ impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y { pub fn new(client: Arc, base_path: String) -> Self { Self { 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()), + 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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p1_5sd_2y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p2sd_2y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p2_5sd_2y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p3sd_2y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m0_5sd_2y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m1sd_2y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m1_5sd_2y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m2sd_2y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m2_5sd_2y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p1_5sd_2y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p2sd_2y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p2_5sd_2y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p3sd_2y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m0_5sd_2y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m1sd_2y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m1_5sd_2y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m2sd_2y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m2_5sd_2y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m3sd_2y".to_string(), + ), } } } @@ -7195,20 +9699,71 @@ impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y { pub fn new(client: Arc, base_path: String) -> Self { Self { 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()), + 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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p1_5sd_1y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p2sd_1y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p2_5sd_1y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p3sd_1y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m0_5sd_1y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m1sd_1y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m1_5sd_1y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m2sd_1y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m2_5sd_1y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p1_5sd_1y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p2sd_1y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p2_5sd_1y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "p3sd_1y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m0_5sd_1y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m1sd_1y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m1_5sd_1y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m2sd_1y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m2_5sd_1y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "sth_realized_price".to_string(), + "m3sd_1y".to_string(), + ), } } } @@ -7228,10 +9783,19 @@ impl SeriesTree_Cohorts_Utxo_Lth { Self { supply: DeltaHalfInToTotalPattern2::new(client.clone(), "lth_supply".to_string()), outputs: SpendingSpentUnspentPattern::new(client.clone(), "lth".to_string()), - activity: CoindaysCoinyearsDormancyTransferPattern::new(client.clone(), "lth".to_string()), - realized: SeriesTree_Cohorts_Utxo_Lth_Realized::new(client.clone(), format!("{base_path}_realized")), + activity: CoindaysCoinyearsDormancyTransferPattern::new( + client.clone(), + "lth".to_string(), + ), + realized: SeriesTree_Cohorts_Utxo_Lth_Realized::new( + client.clone(), + format!("{base_path}_realized"), + ), cost_basis: InMaxMinPerSupplyPattern::new(client.clone(), "lth".to_string()), - unrealized: GrossInvestedInvestorLossNetNuplProfitSentimentPattern2::new(client.clone(), "lth".to_string()), + unrealized: GrossInvestedInvestorLossNetNuplProfitSentimentPattern2::new( + client.clone(), + "lth".to_string(), + ), } } } @@ -7256,17 +9820,44 @@ impl SeriesTree_Cohorts_Utxo_Lth_Realized { pub fn new(client: Arc, base_path: String) -> Self { Self { cap: CentsDeltaToUsdPattern::new(client.clone(), "lth_realized_cap".to_string()), - profit: BlockCumulativeSumPattern::new(client.clone(), "lth_realized_profit".to_string()), - loss: BlockCumulativeNegativeSumPattern::new(client.clone(), "lth_realized_loss".to_string()), - price: SeriesTree_Cohorts_Utxo_Lth_Realized_Price::new(client.clone(), format!("{base_path}_price")), + profit: BlockCumulativeSumPattern::new( + client.clone(), + "lth_realized_profit".to_string(), + ), + loss: BlockCumulativeNegativeSumPattern::new( + client.clone(), + "lth_realized_loss".to_string(), + ), + price: SeriesTree_Cohorts_Utxo_Lth_Realized_Price::new( + client.clone(), + format!("{base_path}_price"), + ), mvrv: SeriesPattern1::new(client.clone(), "lth_mvrv".to_string()), - net_pnl: BlockChangeCumulativeDeltaSumPattern::new(client.clone(), "lth_net".to_string()), - sopr: SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), - gross_pnl: BlockCumulativeSumPattern::new(client.clone(), "lth_realized_gross_pnl".to_string()), - sell_side_risk_ratio: _1m1w1y24hPattern7::new(client.clone(), "lth_sell_side_risk_ratio".to_string()), - peak_regret: BlockCumulativeSumPattern::new(client.clone(), "lth_realized_peak_regret".to_string()), + net_pnl: BlockChangeCumulativeDeltaSumPattern::new( + client.clone(), + "lth_net".to_string(), + ), + sopr: SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr::new( + client.clone(), + format!("{base_path}_sopr"), + ), + gross_pnl: BlockCumulativeSumPattern::new( + client.clone(), + "lth_realized_gross_pnl".to_string(), + ), + sell_side_risk_ratio: _1m1w1y24hPattern7::new( + client.clone(), + "lth_sell_side_risk_ratio".to_string(), + ), + peak_regret: BlockCumulativeSumPattern::new( + client.clone(), + "lth_realized_peak_regret".to_string(), + ), investor: PricePattern::new(client.clone(), "lth_investor_price".to_string()), - profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), "lth_realized_profit_to_loss_ratio".to_string()), + profit_to_loss_ratio: _1m1w1y24hPattern::new( + client.clone(), + "lth_realized_profit_to_loss_ratio".to_string(), + ), } } } @@ -7291,9 +9882,18 @@ impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price { 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: Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new(client.clone(), "lth_realized_price".to_string()), - sma: _1m1w1y2y4yAllPattern::new(client.clone(), "lth_realized_price_ratio_sma".to_string()), - std_dev: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev::new(client.clone(), format!("{base_path}_std_dev")), + percentiles: Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new( + client.clone(), + "lth_realized_price".to_string(), + ), + sma: _1m1w1y2y4yAllPattern::new( + client.clone(), + "lth_realized_price_ratio_sma".to_string(), + ), + std_dev: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev::new( + client.clone(), + format!("{base_path}_std_dev"), + ), } } } @@ -7309,10 +9909,22 @@ pub struct SeriesTree_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: 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")), + 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"), + ), } } } @@ -7340,20 +9952,71 @@ impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All { pub fn new(client: Arc, base_path: String) -> Self { Self { sd: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_sd".to_string()), - zscore: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_zscore".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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p1_5sd".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p2sd".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p2_5sd".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p3sd".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m0_5sd".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m1sd".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m1_5sd".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m2sd".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m2_5sd".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m3sd".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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p1_5sd".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p2sd".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p2_5sd".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p3sd".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m0_5sd".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m1sd".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m1_5sd".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m2sd".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m2_5sd".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m3sd".to_string(), + ), } } } @@ -7381,20 +10044,71 @@ impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y { pub fn new(client: Arc, base_path: String) -> Self { Self { 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()), + 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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p1_5sd_4y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p2sd_4y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p2_5sd_4y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p3sd_4y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m0_5sd_4y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m1sd_4y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m1_5sd_4y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m2sd_4y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m2_5sd_4y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p1_5sd_4y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p2sd_4y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p2_5sd_4y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p3sd_4y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m0_5sd_4y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m1sd_4y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m1_5sd_4y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m2sd_4y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m2_5sd_4y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m3sd_4y".to_string(), + ), } } } @@ -7422,20 +10136,71 @@ impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y { pub fn new(client: Arc, base_path: String) -> Self { Self { 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()), + 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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p1_5sd_2y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p2sd_2y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p2_5sd_2y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p3sd_2y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m0_5sd_2y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m1sd_2y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m1_5sd_2y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m2sd_2y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m2_5sd_2y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p1_5sd_2y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p2sd_2y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p2_5sd_2y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p3sd_2y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m0_5sd_2y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m1sd_2y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m1_5sd_2y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m2sd_2y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m2_5sd_2y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m3sd_2y".to_string(), + ), } } } @@ -7463,20 +10228,71 @@ impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y { pub fn new(client: Arc, base_path: String) -> Self { Self { 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()), + 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()), - p1_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p1_5sd_1y".to_string()), - p2sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p2sd_1y".to_string()), - p2_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p2_5sd_1y".to_string()), - p3sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p3sd_1y".to_string()), - m0_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m0_5sd_1y".to_string()), - m1sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m1sd_1y".to_string()), - m1_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m1_5sd_1y".to_string()), - m2sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m2sd_1y".to_string()), - m2_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m2_5sd_1y".to_string()), - m3sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "m3sd_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(), + ), + p1_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p1_5sd_1y".to_string(), + ), + p2sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p2sd_1y".to_string(), + ), + p2_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p2_5sd_1y".to_string(), + ), + p3sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "p3sd_1y".to_string(), + ), + m0_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m0_5sd_1y".to_string(), + ), + m1sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m1sd_1y".to_string(), + ), + m1_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m1_5sd_1y".to_string(), + ), + m2sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m2sd_1y".to_string(), + ), + m2_5sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m2_5sd_1y".to_string(), + ), + m3sd: PriceRatioPattern::new( + client.clone(), + "lth_realized_price".to_string(), + "m3sd_1y".to_string(), + ), } } } @@ -7490,7 +10306,10 @@ pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr { impl SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr { pub fn new(client: Arc, base_path: String) -> Self { Self { - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "lth_value_destroyed".to_string()), + value_destroyed: AverageBlockCumulativeSumPattern::new( + client.clone(), + "lth_value_destroyed".to_string(), + ), ratio: _1m1w1y24hPattern::new(client.clone(), "lth_sopr".to_string()), } } @@ -7524,27 +10343,90 @@ pub struct SeriesTree_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()), - _1h_to_1d: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1h_to_1d_old".to_string()), - _1d_to_1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1d_to_1w_old".to_string()), - _1w_to_1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1w_to_1m_old".to_string()), - _1m_to_2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1m_to_2m_old".to_string()), - _2m_to_3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_2m_to_3m_old".to_string()), - _3m_to_4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_3m_to_4m_old".to_string()), - _4m_to_5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_4m_to_5m_old".to_string()), - _5m_to_6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_5m_to_6m_old".to_string()), - _6m_to_1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_6m_to_1y_old".to_string()), - _1y_to_2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1y_to_2y_old".to_string()), - _2y_to_3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_2y_to_3y_old".to_string()), - _3y_to_4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_3y_to_4y_old".to_string()), - _4y_to_5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_4y_to_5y_old".to_string()), - _5y_to_6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_5y_to_6y_old".to_string()), - _6y_to_7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_6y_to_7y_old".to_string()), - _7y_to_8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_7y_to_8y_old".to_string()), - _8y_to_10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_8y_to_10y_old".to_string()), - _10y_to_12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_10y_to_12y_old".to_string()), - _12y_to_15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_12y_to_15y_old".to_string()), - over_15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_15y_old".to_string()), + under_1h: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_1h_old".to_string(), + ), + _1h_to_1d: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_1h_to_1d_old".to_string(), + ), + _1d_to_1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_1d_to_1w_old".to_string(), + ), + _1w_to_1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_1w_to_1m_old".to_string(), + ), + _1m_to_2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_1m_to_2m_old".to_string(), + ), + _2m_to_3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_2m_to_3m_old".to_string(), + ), + _3m_to_4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_3m_to_4m_old".to_string(), + ), + _4m_to_5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_4m_to_5m_old".to_string(), + ), + _5m_to_6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_5m_to_6m_old".to_string(), + ), + _6m_to_1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_6m_to_1y_old".to_string(), + ), + _1y_to_2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_1y_to_2y_old".to_string(), + ), + _2y_to_3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_2y_to_3y_old".to_string(), + ), + _3y_to_4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_3y_to_4y_old".to_string(), + ), + _4y_to_5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_4y_to_5y_old".to_string(), + ), + _5y_to_6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_5y_to_6y_old".to_string(), + ), + _6y_to_7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_6y_to_7y_old".to_string(), + ), + _7y_to_8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_7y_to_8y_old".to_string(), + ), + _8y_to_10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_8y_to_10y_old".to_string(), + ), + _10y_to_12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_10y_to_12y_old".to_string(), + ), + _12y_to_15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_12y_to_15y_old".to_string(), + ), + over_15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_15y_old".to_string(), + ), } } } @@ -7574,24 +10456,78 @@ pub struct SeriesTree_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()), - _1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1m_old".to_string()), - _2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_2m_old".to_string()), - _3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_3m_old".to_string()), - _4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_4m_old".to_string()), - _5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_5m_old".to_string()), - _6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_6m_old".to_string()), - _1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1y_old".to_string()), - _2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_2y_old".to_string()), - _3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_3y_old".to_string()), - _4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_4y_old".to_string()), - _5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_5y_old".to_string()), - _6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_6y_old".to_string()), - _7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_7y_old".to_string()), - _8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_8y_old".to_string()), - _10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_10y_old".to_string()), - _12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_12y_old".to_string()), - _15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_15y_old".to_string()), + _1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_1w_old".to_string(), + ), + _1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_1m_old".to_string(), + ), + _2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_2m_old".to_string(), + ), + _3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_3m_old".to_string(), + ), + _4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_4m_old".to_string(), + ), + _5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_5m_old".to_string(), + ), + _6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_6m_old".to_string(), + ), + _1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_1y_old".to_string(), + ), + _2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_2y_old".to_string(), + ), + _3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_3y_old".to_string(), + ), + _4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_4y_old".to_string(), + ), + _5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_5y_old".to_string(), + ), + _6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_6y_old".to_string(), + ), + _7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_7y_old".to_string(), + ), + _8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_8y_old".to_string(), + ), + _10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_10y_old".to_string(), + ), + _12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_12y_old".to_string(), + ), + _15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_under_15y_old".to_string(), + ), } } } @@ -7621,24 +10557,78 @@ pub struct SeriesTree_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()), - _1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1w_old".to_string()), - _1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1m_old".to_string()), - _2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_2m_old".to_string()), - _3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_3m_old".to_string()), - _4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_4m_old".to_string()), - _5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_5m_old".to_string()), - _6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_6m_old".to_string()), - _1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1y_old".to_string()), - _2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_2y_old".to_string()), - _3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_3y_old".to_string()), - _4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_4y_old".to_string()), - _5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_5y_old".to_string()), - _6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_6y_old".to_string()), - _7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_7y_old".to_string()), - _8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_8y_old".to_string()), - _10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10y_old".to_string()), - _12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_12y_old".to_string()), + _1d: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_1d_old".to_string(), + ), + _1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_1w_old".to_string(), + ), + _1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_1m_old".to_string(), + ), + _2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_2m_old".to_string(), + ), + _3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_3m_old".to_string(), + ), + _4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_4m_old".to_string(), + ), + _5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_5m_old".to_string(), + ), + _6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_6m_old".to_string(), + ), + _1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_1y_old".to_string(), + ), + _2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_2y_old".to_string(), + ), + _3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_3y_old".to_string(), + ), + _4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_4y_old".to_string(), + ), + _5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_5y_old".to_string(), + ), + _6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_6y_old".to_string(), + ), + _7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_7y_old".to_string(), + ), + _8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_8y_old".to_string(), + ), + _10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_10y_old".to_string(), + ), + _12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_12y_old".to_string(), + ), } } } @@ -7655,11 +10645,26 @@ pub struct SeriesTree_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()), - _1: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_1".to_string()), - _2: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_2".to_string()), - _3: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_3".to_string()), - _4: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_4".to_string()), + _0: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "epoch_0".to_string(), + ), + _1: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "epoch_1".to_string(), + ), + _2: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "epoch_2".to_string(), + ), + _3: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "epoch_3".to_string(), + ), + _4: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "epoch_4".to_string(), + ), } } } @@ -7689,24 +10694,78 @@ pub struct SeriesTree_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()), - _2010: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2010".to_string()), - _2011: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2011".to_string()), - _2012: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2012".to_string()), - _2013: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2013".to_string()), - _2014: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2014".to_string()), - _2015: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2015".to_string()), - _2016: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2016".to_string()), - _2017: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2017".to_string()), - _2018: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2018".to_string()), - _2019: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2019".to_string()), - _2020: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2020".to_string()), - _2021: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2021".to_string()), - _2022: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2022".to_string()), - _2023: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2023".to_string()), - _2024: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2024".to_string()), - _2025: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2025".to_string()), - _2026: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2026".to_string()), + _2009: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2009".to_string(), + ), + _2010: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2010".to_string(), + ), + _2011: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2011".to_string(), + ), + _2012: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2012".to_string(), + ), + _2013: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2013".to_string(), + ), + _2014: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2014".to_string(), + ), + _2015: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2015".to_string(), + ), + _2016: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2016".to_string(), + ), + _2017: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2017".to_string(), + ), + _2018: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2018".to_string(), + ), + _2019: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2019".to_string(), + ), + _2020: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2020".to_string(), + ), + _2021: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2021".to_string(), + ), + _2022: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2022".to_string(), + ), + _2023: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2023".to_string(), + ), + _2024: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2024".to_string(), + ), + _2025: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2025".to_string(), + ), + _2026: ActivityOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "class_2026".to_string(), + ), } } } @@ -7731,19 +10790,58 @@ pub struct SeriesTree_Cohorts_Utxo_OverAmount { impl SeriesTree_Cohorts_Utxo_OverAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1sat: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1sat".to_string()), - _10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10sats".to_string()), - _100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_100sats".to_string()), - _1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1k_sats".to_string()), - _10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10k_sats".to_string()), - _100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_100k_sats".to_string()), - _1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1m_sats".to_string()), - _10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10m_sats".to_string()), - _1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1btc".to_string()), - _10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10btc".to_string()), - _100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_100btc".to_string()), - _1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1k_btc".to_string()), - _10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10k_btc".to_string()), + _1sat: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_1sat".to_string(), + ), + _10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_10sats".to_string(), + ), + _100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_100sats".to_string(), + ), + _1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_1k_sats".to_string(), + ), + _10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_10k_sats".to_string(), + ), + _100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_100k_sats".to_string(), + ), + _1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_1m_sats".to_string(), + ), + _10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_10m_sats".to_string(), + ), + _1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_1btc".to_string(), + ), + _10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_10btc".to_string(), + ), + _100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_100btc".to_string(), + ), + _1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_1k_btc".to_string(), + ), + _10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_10k_btc".to_string(), + ), } } } @@ -7770,21 +10868,66 @@ pub struct SeriesTree_Cohorts_Utxo_AmountRange { impl SeriesTree_Cohorts_Utxo_AmountRange { pub fn new(client: Arc, base_path: String) -> Self { Self { - _0sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_0sats".to_string()), - _1sat_to_10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1sat_to_10sats".to_string()), - _10sats_to_100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10sats_to_100sats".to_string()), - _100sats_to_1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_100sats_to_1k_sats".to_string()), - _1k_sats_to_10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1k_sats_to_10k_sats".to_string()), - _10k_sats_to_100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10k_sats_to_100k_sats".to_string()), - _100k_sats_to_1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_100k_sats_to_1m_sats".to_string()), - _1m_sats_to_10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1m_sats_to_10m_sats".to_string()), - _10m_sats_to_1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10m_sats_to_1btc".to_string()), - _1btc_to_10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1btc_to_10btc".to_string()), - _10btc_to_100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10btc_to_100btc".to_string()), - _100btc_to_1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_100btc_to_1k_btc".to_string()), - _1k_btc_to_10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1k_btc_to_10k_btc".to_string()), - _10k_btc_to_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10k_btc_to_100k_btc".to_string()), - over_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_100k_btc".to_string()), + _0sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_0sats".to_string(), + ), + _1sat_to_10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_1sat_to_10sats".to_string(), + ), + _10sats_to_100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_10sats_to_100sats".to_string(), + ), + _100sats_to_1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_100sats_to_1k_sats".to_string(), + ), + _1k_sats_to_10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_1k_sats_to_10k_sats".to_string(), + ), + _10k_sats_to_100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_10k_sats_to_100k_sats".to_string(), + ), + _100k_sats_to_1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_100k_sats_to_1m_sats".to_string(), + ), + _1m_sats_to_10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_1m_sats_to_10m_sats".to_string(), + ), + _10m_sats_to_1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_10m_sats_to_1btc".to_string(), + ), + _1btc_to_10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_1btc_to_10btc".to_string(), + ), + _10btc_to_100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_10btc_to_100btc".to_string(), + ), + _100btc_to_1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_100btc_to_1k_btc".to_string(), + ), + _1k_btc_to_10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_1k_btc_to_10k_btc".to_string(), + ), + _10k_btc_to_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_10k_btc_to_100k_btc".to_string(), + ), + over_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_over_100k_btc".to_string(), + ), } } } @@ -7809,19 +10952,58 @@ pub struct SeriesTree_Cohorts_Utxo_UnderAmount { impl SeriesTree_Cohorts_Utxo_UnderAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10sats".to_string()), - _100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_100sats".to_string()), - _1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_1k_sats".to_string()), - _10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10k_sats".to_string()), - _100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_100k_sats".to_string()), - _1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_1m_sats".to_string()), - _10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10m_sats".to_string()), - _1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_1btc".to_string()), - _10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10btc".to_string()), - _100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_100btc".to_string()), - _1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_1k_btc".to_string()), - _10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10k_btc".to_string()), - _100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_100k_btc".to_string()), + _10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_10sats".to_string(), + ), + _100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_100sats".to_string(), + ), + _1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_1k_sats".to_string(), + ), + _10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_10k_sats".to_string(), + ), + _100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_100k_sats".to_string(), + ), + _1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_1m_sats".to_string(), + ), + _10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_10m_sats".to_string(), + ), + _1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_1btc".to_string(), + ), + _10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_10btc".to_string(), + ), + _100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_100btc".to_string(), + ), + _1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_1k_btc".to_string(), + ), + _10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_10k_btc".to_string(), + ), + _100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new( + client.clone(), + "utxos_under_100k_btc".to_string(), + ), } } } @@ -7844,17 +11026,50 @@ pub struct SeriesTree_Cohorts_Utxo_Type { impl SeriesTree_Cohorts_Utxo_Type { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2pk65: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2pk65".to_string()), - p2pk33: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2pk33".to_string()), - p2pkh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2pkh".to_string()), - p2ms: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2ms".to_string()), - p2sh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2sh".to_string()), - p2wpkh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2wpkh".to_string()), - p2wsh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2wsh".to_string()), - p2tr: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2tr".to_string()), - p2a: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2a".to_string()), - unknown: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "unknown_outputs".to_string()), - empty: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "empty_outputs".to_string()), + p2pk65: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2pk65".to_string(), + ), + p2pk33: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2pk33".to_string(), + ), + p2pkh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2pkh".to_string(), + ), + p2ms: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2ms".to_string(), + ), + p2sh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2sh".to_string(), + ), + p2wpkh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2wpkh".to_string(), + ), + p2wsh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2wsh".to_string(), + ), + p2tr: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2tr".to_string(), + ), + p2a: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "p2a".to_string(), + ), + unknown: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "unknown_outputs".to_string(), + ), + empty: ActivityOutputsRealizedSupplyUnrealizedPattern3::new( + client.clone(), + "empty_outputs".to_string(), + ), } } } @@ -7869,9 +11084,18 @@ pub struct SeriesTree_Cohorts_Utxo_Profitability { impl SeriesTree_Cohorts_Utxo_Profitability { pub fn new(client: Arc, base_path: String) -> Self { Self { - 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")), + 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"), + ), } } } @@ -7908,31 +11132,106 @@ pub struct SeriesTree_Cohorts_Utxo_Profitability_Range { impl SeriesTree_Cohorts_Utxo_Profitability_Range { pub fn new(client: Arc, base_path: String) -> Self { Self { - over_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1000pct_in_profit".to_string()), - _500pct_to_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_500pct_to_1000pct_in_profit".to_string()), - _300pct_to_500pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_300pct_to_500pct_in_profit".to_string()), - _200pct_to_300pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_200pct_to_300pct_in_profit".to_string()), - _100pct_to_200pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_100pct_to_200pct_in_profit".to_string()), - _90pct_to_100pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_90pct_to_100pct_in_profit".to_string()), - _80pct_to_90pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_80pct_to_90pct_in_profit".to_string()), - _70pct_to_80pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_70pct_to_80pct_in_profit".to_string()), - _60pct_to_70pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_60pct_to_70pct_in_profit".to_string()), - _50pct_to_60pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_50pct_to_60pct_in_profit".to_string()), - _40pct_to_50pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_40pct_to_50pct_in_profit".to_string()), - _30pct_to_40pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_30pct_to_40pct_in_profit".to_string()), - _20pct_to_30pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_20pct_to_30pct_in_profit".to_string()), - _10pct_to_20pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_10pct_to_20pct_in_profit".to_string()), - _0pct_to_10pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_0pct_to_10pct_in_profit".to_string()), - _0pct_to_10pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_0pct_to_10pct_in_loss".to_string()), - _10pct_to_20pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_10pct_to_20pct_in_loss".to_string()), - _20pct_to_30pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_20pct_to_30pct_in_loss".to_string()), - _30pct_to_40pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_30pct_to_40pct_in_loss".to_string()), - _40pct_to_50pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_40pct_to_50pct_in_loss".to_string()), - _50pct_to_60pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_50pct_to_60pct_in_loss".to_string()), - _60pct_to_70pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_60pct_to_70pct_in_loss".to_string()), - _70pct_to_80pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_70pct_to_80pct_in_loss".to_string()), - _80pct_to_90pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_80pct_to_90pct_in_loss".to_string()), - _90pct_to_100pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_90pct_to_100pct_in_loss".to_string()), + over_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_1000pct_in_profit".to_string(), + ), + _500pct_to_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_500pct_to_1000pct_in_profit".to_string(), + ), + _300pct_to_500pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_300pct_to_500pct_in_profit".to_string(), + ), + _200pct_to_300pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_200pct_to_300pct_in_profit".to_string(), + ), + _100pct_to_200pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_100pct_to_200pct_in_profit".to_string(), + ), + _90pct_to_100pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_90pct_to_100pct_in_profit".to_string(), + ), + _80pct_to_90pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_80pct_to_90pct_in_profit".to_string(), + ), + _70pct_to_80pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_70pct_to_80pct_in_profit".to_string(), + ), + _60pct_to_70pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_60pct_to_70pct_in_profit".to_string(), + ), + _50pct_to_60pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_50pct_to_60pct_in_profit".to_string(), + ), + _40pct_to_50pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_40pct_to_50pct_in_profit".to_string(), + ), + _30pct_to_40pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_30pct_to_40pct_in_profit".to_string(), + ), + _20pct_to_30pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_20pct_to_30pct_in_profit".to_string(), + ), + _10pct_to_20pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_10pct_to_20pct_in_profit".to_string(), + ), + _0pct_to_10pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_0pct_to_10pct_in_profit".to_string(), + ), + _0pct_to_10pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_0pct_to_10pct_in_loss".to_string(), + ), + _10pct_to_20pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_10pct_to_20pct_in_loss".to_string(), + ), + _20pct_to_30pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_20pct_to_30pct_in_loss".to_string(), + ), + _30pct_to_40pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_30pct_to_40pct_in_loss".to_string(), + ), + _40pct_to_50pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_40pct_to_50pct_in_loss".to_string(), + ), + _50pct_to_60pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_50pct_to_60pct_in_loss".to_string(), + ), + _60pct_to_70pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_60pct_to_70pct_in_loss".to_string(), + ), + _70pct_to_80pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_70pct_to_80pct_in_loss".to_string(), + ), + _80pct_to_90pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_80pct_to_90pct_in_loss".to_string(), + ), + _90pct_to_100pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_90pct_to_100pct_in_loss".to_string(), + ), } } } @@ -7958,20 +11257,62 @@ pub struct SeriesTree_Cohorts_Utxo_Profitability_Profit { impl SeriesTree_Cohorts_Utxo_Profitability_Profit { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_in_profit".to_string()), - _10pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10pct_in_profit".to_string()), - _20pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_20pct_in_profit".to_string()), - _30pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_30pct_in_profit".to_string()), - _40pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_40pct_in_profit".to_string()), - _50pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_50pct_in_profit".to_string()), - _60pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_60pct_in_profit".to_string()), - _70pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_70pct_in_profit".to_string()), - _80pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_80pct_in_profit".to_string()), - _90pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_90pct_in_profit".to_string()), - _100pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_100pct_in_profit".to_string()), - _200pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_200pct_in_profit".to_string()), - _300pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_300pct_in_profit".to_string()), - _500pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_500pct_in_profit".to_string()), + all: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_in_profit".to_string(), + ), + _10pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_10pct_in_profit".to_string(), + ), + _20pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_20pct_in_profit".to_string(), + ), + _30pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_30pct_in_profit".to_string(), + ), + _40pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_40pct_in_profit".to_string(), + ), + _50pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_50pct_in_profit".to_string(), + ), + _60pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_60pct_in_profit".to_string(), + ), + _70pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_70pct_in_profit".to_string(), + ), + _80pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_80pct_in_profit".to_string(), + ), + _90pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_90pct_in_profit".to_string(), + ), + _100pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_100pct_in_profit".to_string(), + ), + _200pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_200pct_in_profit".to_string(), + ), + _300pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_300pct_in_profit".to_string(), + ), + _500pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_500pct_in_profit".to_string(), + ), } } } @@ -7992,15 +11333,42 @@ pub struct SeriesTree_Cohorts_Utxo_Profitability_Loss { impl SeriesTree_Cohorts_Utxo_Profitability_Loss { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_in_loss".to_string()), - _10pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10pct_in_loss".to_string()), - _20pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_20pct_in_loss".to_string()), - _30pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_30pct_in_loss".to_string()), - _40pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_40pct_in_loss".to_string()), - _50pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_50pct_in_loss".to_string()), - _60pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_60pct_in_loss".to_string()), - _70pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_70pct_in_loss".to_string()), - _80pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_80pct_in_loss".to_string()), + all: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_in_loss".to_string(), + ), + _10pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_10pct_in_loss".to_string(), + ), + _20pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_20pct_in_loss".to_string(), + ), + _30pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_30pct_in_loss".to_string(), + ), + _40pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_40pct_in_loss".to_string(), + ), + _50pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_50pct_in_loss".to_string(), + ), + _60pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_60pct_in_loss".to_string(), + ), + _70pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_70pct_in_loss".to_string(), + ), + _80pct: NuplRealizedSupplyUnrealizedPattern::new( + client.clone(), + "utxos_over_80pct_in_loss".to_string(), + ), } } } @@ -8033,27 +11401,90 @@ pub struct SeriesTree_Cohorts_Utxo_Matured { impl SeriesTree_Cohorts_Utxo_Matured { pub fn new(client: Arc, base_path: String) -> Self { Self { - under_1h: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_under_1h_old_matured_supply".to_string()), - _1h_to_1d: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_1h_to_1d_old_matured_supply".to_string()), - _1d_to_1w: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_1d_to_1w_old_matured_supply".to_string()), - _1w_to_1m: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_1w_to_1m_old_matured_supply".to_string()), - _1m_to_2m: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_1m_to_2m_old_matured_supply".to_string()), - _2m_to_3m: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_2m_to_3m_old_matured_supply".to_string()), - _3m_to_4m: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_3m_to_4m_old_matured_supply".to_string()), - _4m_to_5m: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_4m_to_5m_old_matured_supply".to_string()), - _5m_to_6m: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_5m_to_6m_old_matured_supply".to_string()), - _6m_to_1y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_6m_to_1y_old_matured_supply".to_string()), - _1y_to_2y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_1y_to_2y_old_matured_supply".to_string()), - _2y_to_3y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_2y_to_3y_old_matured_supply".to_string()), - _3y_to_4y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_3y_to_4y_old_matured_supply".to_string()), - _4y_to_5y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_4y_to_5y_old_matured_supply".to_string()), - _5y_to_6y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_5y_to_6y_old_matured_supply".to_string()), - _6y_to_7y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_6y_to_7y_old_matured_supply".to_string()), - _7y_to_8y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_7y_to_8y_old_matured_supply".to_string()), - _8y_to_10y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_8y_to_10y_old_matured_supply".to_string()), - _10y_to_12y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_10y_to_12y_old_matured_supply".to_string()), - _12y_to_15y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_12y_to_15y_old_matured_supply".to_string()), - over_15y: AverageBlockCumulativeSumPattern3::new(client.clone(), "utxos_over_15y_old_matured_supply".to_string()), + under_1h: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_under_1h_old_matured_supply".to_string(), + ), + _1h_to_1d: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_1h_to_1d_old_matured_supply".to_string(), + ), + _1d_to_1w: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_1d_to_1w_old_matured_supply".to_string(), + ), + _1w_to_1m: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_1w_to_1m_old_matured_supply".to_string(), + ), + _1m_to_2m: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_1m_to_2m_old_matured_supply".to_string(), + ), + _2m_to_3m: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_2m_to_3m_old_matured_supply".to_string(), + ), + _3m_to_4m: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_3m_to_4m_old_matured_supply".to_string(), + ), + _4m_to_5m: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_4m_to_5m_old_matured_supply".to_string(), + ), + _5m_to_6m: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_5m_to_6m_old_matured_supply".to_string(), + ), + _6m_to_1y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_6m_to_1y_old_matured_supply".to_string(), + ), + _1y_to_2y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_1y_to_2y_old_matured_supply".to_string(), + ), + _2y_to_3y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_2y_to_3y_old_matured_supply".to_string(), + ), + _3y_to_4y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_3y_to_4y_old_matured_supply".to_string(), + ), + _4y_to_5y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_4y_to_5y_old_matured_supply".to_string(), + ), + _5y_to_6y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_5y_to_6y_old_matured_supply".to_string(), + ), + _6y_to_7y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_6y_to_7y_old_matured_supply".to_string(), + ), + _7y_to_8y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_7y_to_8y_old_matured_supply".to_string(), + ), + _8y_to_10y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_8y_to_10y_old_matured_supply".to_string(), + ), + _10y_to_12y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_10y_to_12y_old_matured_supply".to_string(), + ), + _12y_to_15y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_12y_to_15y_old_matured_supply".to_string(), + ), + over_15y: AverageBlockCumulativeSumPattern3::new( + client.clone(), + "utxos_over_15y_old_matured_supply".to_string(), + ), } } } @@ -8068,9 +11499,18 @@ pub struct SeriesTree_Cohorts_Addr { impl SeriesTree_Cohorts_Addr { pub fn new(client: Arc, base_path: String) -> Self { Self { - over_amount: SeriesTree_Cohorts_Addr_OverAmount::new(client.clone(), format!("{base_path}_over_amount")), - amount_range: SeriesTree_Cohorts_Addr_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), - under_amount: SeriesTree_Cohorts_Addr_UnderAmount::new(client.clone(), format!("{base_path}_under_amount")), + over_amount: SeriesTree_Cohorts_Addr_OverAmount::new( + client.clone(), + format!("{base_path}_over_amount"), + ), + amount_range: SeriesTree_Cohorts_Addr_AmountRange::new( + client.clone(), + format!("{base_path}_amount_range"), + ), + under_amount: SeriesTree_Cohorts_Addr_UnderAmount::new( + client.clone(), + format!("{base_path}_under_amount"), + ), } } } @@ -8095,19 +11535,58 @@ pub struct SeriesTree_Cohorts_Addr_OverAmount { impl SeriesTree_Cohorts_Addr_OverAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1sat: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1sat".to_string()), - _10sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10sats".to_string()), - _100sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100sats".to_string()), - _1k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1k_sats".to_string()), - _10k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10k_sats".to_string()), - _100k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100k_sats".to_string()), - _1m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1m_sats".to_string()), - _10m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10m_sats".to_string()), - _1btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1btc".to_string()), - _10btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10btc".to_string()), - _100btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100btc".to_string()), - _1k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1k_btc".to_string()), - _10k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10k_btc".to_string()), + _1sat: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_1sat".to_string(), + ), + _10sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_10sats".to_string(), + ), + _100sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_100sats".to_string(), + ), + _1k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_1k_sats".to_string(), + ), + _10k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_10k_sats".to_string(), + ), + _100k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_100k_sats".to_string(), + ), + _1m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_1m_sats".to_string(), + ), + _10m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_10m_sats".to_string(), + ), + _1btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_1btc".to_string(), + ), + _10btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_10btc".to_string(), + ), + _100btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_100btc".to_string(), + ), + _1k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_1k_btc".to_string(), + ), + _10k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_10k_btc".to_string(), + ), } } } @@ -8134,21 +11613,66 @@ pub struct SeriesTree_Cohorts_Addr_AmountRange { impl SeriesTree_Cohorts_Addr_AmountRange { pub fn new(client: Arc, base_path: String) -> Self { Self { - _0sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_0sats".to_string()), - _1sat_to_10sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_1sat_to_10sats".to_string()), - _10sats_to_100sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_10sats_to_100sats".to_string()), - _100sats_to_1k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_100sats_to_1k_sats".to_string()), - _1k_sats_to_10k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_1k_sats_to_10k_sats".to_string()), - _10k_sats_to_100k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_10k_sats_to_100k_sats".to_string()), - _100k_sats_to_1m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_100k_sats_to_1m_sats".to_string()), - _1m_sats_to_10m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_1m_sats_to_10m_sats".to_string()), - _10m_sats_to_1btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_10m_sats_to_1btc".to_string()), - _1btc_to_10btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_1btc_to_10btc".to_string()), - _10btc_to_100btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_10btc_to_100btc".to_string()), - _100btc_to_1k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_100btc_to_1k_btc".to_string()), - _1k_btc_to_10k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_1k_btc_to_10k_btc".to_string()), - _10k_btc_to_100k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_10k_btc_to_100k_btc".to_string()), - over_100k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100k_btc".to_string()), + _0sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_0sats".to_string(), + ), + _1sat_to_10sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_1sat_to_10sats".to_string(), + ), + _10sats_to_100sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_10sats_to_100sats".to_string(), + ), + _100sats_to_1k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_100sats_to_1k_sats".to_string(), + ), + _1k_sats_to_10k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_1k_sats_to_10k_sats".to_string(), + ), + _10k_sats_to_100k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_10k_sats_to_100k_sats".to_string(), + ), + _100k_sats_to_1m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_100k_sats_to_1m_sats".to_string(), + ), + _1m_sats_to_10m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_1m_sats_to_10m_sats".to_string(), + ), + _10m_sats_to_1btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_10m_sats_to_1btc".to_string(), + ), + _1btc_to_10btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_1btc_to_10btc".to_string(), + ), + _10btc_to_100btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_10btc_to_100btc".to_string(), + ), + _100btc_to_1k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_100btc_to_1k_btc".to_string(), + ), + _1k_btc_to_10k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_1k_btc_to_10k_btc".to_string(), + ), + _10k_btc_to_100k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_10k_btc_to_100k_btc".to_string(), + ), + over_100k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_over_100k_btc".to_string(), + ), } } } @@ -8173,19 +11697,58 @@ pub struct SeriesTree_Cohorts_Addr_UnderAmount { impl SeriesTree_Cohorts_Addr_UnderAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10sats".to_string()), - _100sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100sats".to_string()), - _1k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1k_sats".to_string()), - _10k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10k_sats".to_string()), - _100k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100k_sats".to_string()), - _1m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1m_sats".to_string()), - _10m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10m_sats".to_string()), - _1btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1btc".to_string()), - _10btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10btc".to_string()), - _100btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100btc".to_string()), - _1k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1k_btc".to_string()), - _10k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10k_btc".to_string()), - _100k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100k_btc".to_string()), + _10sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_10sats".to_string(), + ), + _100sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_100sats".to_string(), + ), + _1k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_1k_sats".to_string(), + ), + _10k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_10k_sats".to_string(), + ), + _100k_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_100k_sats".to_string(), + ), + _1m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_1m_sats".to_string(), + ), + _10m_sats: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_10m_sats".to_string(), + ), + _1btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_1btc".to_string(), + ), + _10btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_10btc".to_string(), + ), + _100btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_100btc".to_string(), + ), + _1k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_1k_btc".to_string(), + ), + _10k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_10k_btc".to_string(), + ), + _100k_btc: ActivityAddrOutputsRealizedSupplyUnrealizedPattern::new( + client.clone(), + "addrs_under_100k_btc".to_string(), + ), } } } @@ -8230,20 +11793,26 @@ impl BrkClient { /// .last(10) /// .json::()?; /// ``` - pub fn series_endpoint(&self, series: impl Into, index: Index) -> SeriesEndpoint { - SeriesEndpoint::new( - self.base.clone(), - Arc::from(series.into().as_str()), - index, - ) + pub fn series_endpoint( + &self, + series: impl Into, + index: Index, + ) -> SeriesEndpoint { + SeriesEndpoint::new(self.base.clone(), Arc::from(series.into().as_str()), index) } /// Create a dynamic date-based series endpoint builder. /// /// Returns `Err` if the index is not date-based. - pub fn date_series_endpoint(&self, series: 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()) }); + return Err(BrkError { + message: format!("{} is not a date-based index", index.name()), + }); } Ok(DateSeriesEndpoint::new( self.base.clone(), @@ -8279,10 +11848,20 @@ impl BrkClient { /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)* /// /// Endpoint: `GET /api/address/{address}/txs` - pub fn get_address_txs(&self, address: Addr, after_txid: Option) -> Result> { + pub fn get_address_txs( + &self, + address: Addr, + after_txid: Option, + ) -> Result> { let mut query = Vec::new(); - if let Some(v) = after_txid { query.push(format!("after_txid={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; + if let Some(v) = after_txid { + query.push(format!("after_txid={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; let path = format!("/api/address/{address}/txs{}", query_str); self.base.get_json(&path) } @@ -8294,10 +11873,20 @@ impl BrkClient { /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)* /// /// Endpoint: `GET /api/address/{address}/txs/chain` - pub fn get_address_confirmed_txs(&self, address: Addr, after_txid: Option) -> Result> { + pub fn get_address_confirmed_txs( + &self, + address: Addr, + after_txid: Option, + ) -> Result> { let mut query = Vec::new(); - if let Some(v) = after_txid { query.push(format!("after_txid={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; + if let Some(v) = after_txid { + query.push(format!("after_txid={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; let path = format!("/api/address/{address}/txs/chain{}", query_str); self.base.get_json(&path) } @@ -8310,7 +11899,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/address/{address}/txs/mempool` pub fn get_address_mempool_txs(&self, address: Addr) -> Result> { - self.base.get_json(&format!("/api/address/{address}/txs/mempool")) + self.base + .get_json(&format!("/api/address/{address}/txs/mempool")) } /// Address UTXOs @@ -8387,7 +11977,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/block/{hash}/txid/{index}` pub fn get_block_txid(&self, hash: BlockHash, index: TxIndex) -> Result { - self.base.get_text(&format!("/api/block/{hash}/txid/{index}")) + self.base + .get_text(&format!("/api/block/{hash}/txid/{index}")) } /// Block transaction IDs @@ -8419,8 +12010,13 @@ impl BrkClient { /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)* /// /// Endpoint: `GET /api/block/{hash}/txs/{start_index}` - pub fn get_block_txs_from_index(&self, hash: BlockHash, start_index: TxIndex) -> Result> { - self.base.get_json(&format!("/api/block/{hash}/txs/{start_index}")) + pub fn get_block_txs_from_index( + &self, + hash: BlockHash, + start_index: TxIndex, + ) -> Result> { + self.base + .get_json(&format!("/api/block/{hash}/txs/{start_index}")) } /// Recent blocks @@ -8523,15 +12119,35 @@ impl BrkClient { /// 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/series/bulk` - pub fn get_series_bulk(&self, series: SeriesList, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result>> { + pub fn get_series_bulk( + &self, + series: SeriesList, + index: Index, + start: Option, + end: Option, + limit: Option, + format: Option, + ) -> Result>> { let mut query = Vec::new(); 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("&")) }; + 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/bulk{}", query_str); if format == Some(Format::CSV) { self.base.get_text(&path).map(FormatResponse::Csv) @@ -8555,7 +12171,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/series/cost-basis/{cohort}/dates` pub fn get_cost_basis_dates(&self, cohort: Cohort) -> Result> { - self.base.get_json(&format!("/api/series/cost-basis/{cohort}/dates")) + self.base + .get_json(&format!("/api/series/cost-basis/{cohort}/dates")) } /// Cost basis distribution @@ -8567,11 +12184,25 @@ impl BrkClient { /// - `value`: supply (default, in BTC), realized (USD), unrealized (USD) /// /// Endpoint: `GET /api/series/cost-basis/{cohort}/{date}` - pub fn get_cost_basis(&self, cohort: Cohort, date: &str, bucket: Option, value: Option) -> Result { + 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("&")) }; + 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/series/cost-basis/{cohort}/{date}{}", query_str); self.base.get_json(&path) } @@ -8601,9 +12232,17 @@ impl BrkClient { /// 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("&")) }; + 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/series/list{}", query_str); self.base.get_json(&path) } @@ -8616,8 +12255,14 @@ impl BrkClient { pub fn search_series(&self, q: SeriesName, 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("&")) }; + 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/series/search{}", query_str); self.base.get_json(&path) } @@ -8636,13 +12281,33 @@ impl BrkClient { /// 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: SeriesName, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result> { + pub fn get_series( + &self, + series: SeriesName, + 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("&")) }; + 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) @@ -8656,13 +12321,33 @@ impl BrkClient { /// 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: SeriesName, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result>> { + pub fn get_series_data( + &self, + series: SeriesName, + 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("&")) }; + 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) @@ -8677,7 +12362,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/series/{series}/{index}/latest` pub fn get_series_latest(&self, series: SeriesName, index: Index) -> Result { - self.base.get_text(&format!("/api/series/{series}/{}/latest", index.name())) + self.base + .get_text(&format!("/api/series/{series}/{}/latest", index.name())) } /// Get series data length @@ -8686,7 +12372,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/series/{series}/{index}/len` pub fn get_series_len(&self, series: SeriesName, index: Index) -> Result { - self.base.get_json(&format!("/api/series/{series}/{}/len", index.name())) + self.base + .get_json(&format!("/api/series/{series}/{}/len", index.name())) } /// Get series version @@ -8695,7 +12382,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/series/{series}/{index}/version` pub fn get_series_version(&self, series: SeriesName, index: Index) -> Result { - self.base.get_json(&format!("/api/series/{series}/{}/version", index.name())) + self.base + .get_json(&format!("/api/series/{series}/{}/version", index.name())) } /// Disk usage @@ -8757,7 +12445,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/tx/{txid}/merkleblock-proof` pub fn get_tx_merkleblock_proof(&self, txid: Txid) -> Result { - self.base.get_text(&format!("/api/tx/{txid}/merkleblock-proof")) + self.base + .get_text(&format!("/api/tx/{txid}/merkleblock-proof")) } /// Output spend status @@ -8768,7 +12457,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/tx/{txid}/outspend/{vout}` pub fn get_tx_outspend(&self, txid: Txid, vout: Vout) -> Result { - self.base.get_json(&format!("/api/tx/{txid}/outspend/{vout}")) + self.base + .get_json(&format!("/api/tx/{txid}/outspend/{vout}")) } /// All output spend statuses @@ -8856,7 +12546,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/difficulty-adjustment` pub fn get_difficulty_adjustment(&self) -> Result { - self.base.get_json(&format!("/api/v1/difficulty-adjustment")) + self.base + .get_json(&format!("/api/v1/difficulty-adjustment")) } /// Projected mempool blocks @@ -8901,8 +12592,14 @@ impl BrkClient { /// Endpoint: `GET /api/v1/historical-price` pub fn get_historical_price(&self, timestamp: Option) -> Result { let mut query = Vec::new(); - if let Some(v) = timestamp { query.push(format!("timestamp={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; + if let Some(v) = timestamp { + query.push(format!("timestamp={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; let path = format!("/api/v1/historical-price{}", query_str); self.base.get_json(&path) } @@ -8915,7 +12612,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/blocks/fee-rates/{time_period}` pub fn get_block_fee_rates(&self, time_period: TimePeriod) -> Result> { - self.base.get_json(&format!("/api/v1/mining/blocks/fee-rates/{time_period}")) + self.base + .get_json(&format!("/api/v1/mining/blocks/fee-rates/{time_period}")) } /// Block fees @@ -8926,7 +12624,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/blocks/fees/{time_period}` pub fn get_block_fees(&self, time_period: TimePeriod) -> Result> { - self.base.get_json(&format!("/api/v1/mining/blocks/fees/{time_period}")) + self.base + .get_json(&format!("/api/v1/mining/blocks/fees/{time_period}")) } /// Block rewards @@ -8937,7 +12636,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}` pub fn get_block_rewards(&self, time_period: TimePeriod) -> Result> { - self.base.get_json(&format!("/api/v1/mining/blocks/rewards/{time_period}")) + self.base + .get_json(&format!("/api/v1/mining/blocks/rewards/{time_period}")) } /// Block sizes and weights @@ -8948,7 +12648,9 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}` pub fn get_block_sizes_weights(&self, time_period: TimePeriod) -> Result { - self.base.get_json(&format!("/api/v1/mining/blocks/sizes-weights/{time_period}")) + self.base.get_json(&format!( + "/api/v1/mining/blocks/sizes-weights/{time_period}" + )) } /// Block by timestamp @@ -8959,7 +12661,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/blocks/timestamp/{timestamp}` pub fn get_block_by_timestamp(&self, timestamp: Timestamp) -> Result { - self.base.get_json(&format!("/api/v1/mining/blocks/timestamp/{timestamp}")) + self.base + .get_json(&format!("/api/v1/mining/blocks/timestamp/{timestamp}")) } /// Difficulty adjustments (all time) @@ -8970,7 +12673,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/difficulty-adjustments` pub fn get_difficulty_adjustments(&self) -> Result> { - self.base.get_json(&format!("/api/v1/mining/difficulty-adjustments")) + self.base + .get_json(&format!("/api/v1/mining/difficulty-adjustments")) } /// Difficulty adjustments @@ -8980,8 +12684,13 @@ impl BrkClient { /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* /// /// Endpoint: `GET /api/v1/mining/difficulty-adjustments/{time_period}` - pub fn get_difficulty_adjustments_by_period(&self, time_period: TimePeriod) -> Result> { - self.base.get_json(&format!("/api/v1/mining/difficulty-adjustments/{time_period}")) + pub fn get_difficulty_adjustments_by_period( + &self, + time_period: TimePeriod, + ) -> Result> { + self.base.get_json(&format!( + "/api/v1/mining/difficulty-adjustments/{time_period}" + )) } /// Network hashrate (all time) @@ -9003,7 +12712,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/hashrate/pools` pub fn get_pools_hashrate(&self) -> Result> { - self.base.get_json(&format!("/api/v1/mining/hashrate/pools")) + self.base + .get_json(&format!("/api/v1/mining/hashrate/pools")) } /// All pools hashrate @@ -9013,8 +12723,12 @@ impl BrkClient { /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)* /// /// Endpoint: `GET /api/v1/mining/hashrate/pools/{time_period}` - pub fn get_pools_hashrate_by_period(&self, time_period: TimePeriod) -> Result> { - self.base.get_json(&format!("/api/v1/mining/hashrate/pools/{time_period}")) + pub fn get_pools_hashrate_by_period( + &self, + time_period: TimePeriod, + ) -> Result> { + self.base + .get_json(&format!("/api/v1/mining/hashrate/pools/{time_period}")) } /// Network hashrate @@ -9025,7 +12739,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/hashrate/{time_period}` pub fn get_hashrate_by_period(&self, time_period: TimePeriod) -> Result { - self.base.get_json(&format!("/api/v1/mining/hashrate/{time_period}")) + self.base + .get_json(&format!("/api/v1/mining/hashrate/{time_period}")) } /// Mining pool details @@ -9047,7 +12762,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/pool/{slug}/blocks` pub fn get_pool_blocks(&self, slug: PoolSlug) -> Result> { - self.base.get_json(&format!("/api/v1/mining/pool/{slug}/blocks")) + self.base + .get_json(&format!("/api/v1/mining/pool/{slug}/blocks")) } /// Mining pool blocks from height @@ -9058,7 +12774,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/pool/{slug}/blocks/{height}` pub fn get_pool_blocks_from(&self, slug: PoolSlug, height: Height) -> Result> { - self.base.get_json(&format!("/api/v1/mining/pool/{slug}/blocks/{height}")) + self.base + .get_json(&format!("/api/v1/mining/pool/{slug}/blocks/{height}")) } /// Mining pool hashrate @@ -9069,7 +12786,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/pool/{slug}/hashrate` pub fn get_pool_hashrate(&self, slug: PoolSlug) -> Result> { - self.base.get_json(&format!("/api/v1/mining/pool/{slug}/hashrate")) + self.base + .get_json(&format!("/api/v1/mining/pool/{slug}/hashrate")) } /// List all mining pools @@ -9091,7 +12809,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/pools/{time_period}` pub fn get_pool_stats(&self, time_period: TimePeriod) -> Result { - self.base.get_json(&format!("/api/v1/mining/pools/{time_period}")) + self.base + .get_json(&format!("/api/v1/mining/pools/{time_period}")) } /// Mining reward statistics @@ -9102,7 +12821,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/mining/reward-stats/{block_count}` pub fn get_reward_stats(&self, block_count: i64) -> Result { - self.base.get_json(&format!("/api/v1/mining/reward-stats/{block_count}")) + self.base + .get_json(&format!("/api/v1/mining/reward-stats/{block_count}")) } /// Current BTC price @@ -9135,7 +12855,8 @@ impl BrkClient { /// /// Endpoint: `GET /api/v1/validate-address/{address}` pub fn validate_address(&self, address: &str) -> Result { - self.base.get_json(&format!("/api/v1/validate-address/{address}")) + self.base + .get_json(&format!("/api/v1/validate-address/{address}")) } /// Health check @@ -9164,5 +12885,4 @@ impl BrkClient { pub fn get_version(&self) -> Result { self.base.get_json(&format!("/version")) } - } diff --git a/crates/brk_indexer/src/stores.rs b/crates/brk_indexer/src/stores.rs index dd61478b3..868dee05f 100644 --- a/crates/brk_indexer/src/stores.rs +++ b/crates/brk_indexer/src/stores.rs @@ -401,6 +401,4 @@ impl Stores { .remove(AddrIndexTxIndex::from((addr_index, tx_index))); } } - } - diff --git a/crates/brk_query/src/impl/block/info.rs b/crates/brk_query/src/impl/block/info.rs index 989970e30..5b8bf1959 100644 --- a/crates/brk_query/src/impl/block/info.rs +++ b/crates/brk_query/src/impl/block/info.rs @@ -252,7 +252,6 @@ impl Query { let fa_pct90 = fad.pct90.height.collect_range_at(begin, end); let fa_max = fad.max.height.collect_range_at(begin, end); - // Bulk read median time window let median_start = begin.saturating_sub(10); let median_timestamps = indexer @@ -272,20 +271,47 @@ impl Query { // Single reader for header + coinbase (adjacent in blk file) let varint_len = Self::compact_size_len(tx_count) as usize; - let (raw_header, coinbase_raw, coinbase_address, coinbase_addresses, coinbase_signature, coinbase_signature_ascii, scriptsig_bytes) = match reader.reader_at(positions[i]) { + let ( + raw_header, + coinbase_raw, + coinbase_address, + coinbase_addresses, + coinbase_signature, + coinbase_signature_ascii, + scriptsig_bytes, + ) = match reader.reader_at(positions[i]) { Ok(mut blk) => { let mut header_buf = [0u8; HEADER_SIZE]; if blk.read_exact(&mut header_buf).is_err() { - ([0u8; HEADER_SIZE], String::new(), None, vec![], String::new(), String::new(), vec![]) + ( + [0u8; HEADER_SIZE], + String::new(), + None, + vec![], + String::new(), + String::new(), + vec![], + ) } else { // Skip tx count varint let mut skip = [0u8; 5]; let _ = blk.read_exact(&mut skip[..varint_len]); let coinbase = Self::parse_coinbase_from_read(blk); - (header_buf, coinbase.0, coinbase.1, coinbase.2, coinbase.3, coinbase.4, coinbase.5) + ( + header_buf, coinbase.0, coinbase.1, coinbase.2, coinbase.3, coinbase.4, + coinbase.5, + ) } } - Err(_) => ([0u8; HEADER_SIZE], String::new(), None, vec![], String::new(), String::new(), vec![]), + Err(_) => ( + [0u8; HEADER_SIZE], + String::new(), + None, + vec![], + String::new(), + String::new(), + vec![], + ), }; let header = Self::decode_header(&raw_header)?; @@ -517,12 +543,20 @@ impl Query { fn parse_coinbase_from_read( reader: impl Read, ) -> (String, Option, Vec, String, String, Vec) { - let empty = (String::new(), None, vec![], String::new(), String::new(), vec![]); + let empty = ( + String::new(), + None, + vec![], + String::new(), + String::new(), + vec![], + ); - let tx = match bitcoin::Transaction::consensus_decode(&mut bitcoin::io::FromStd::new(reader)) { - Ok(tx) => tx, - Err(_) => return empty, - }; + let tx = + match bitcoin::Transaction::consensus_decode(&mut bitcoin::io::FromStd::new(reader)) { + Ok(tx) => tx, + Err(_) => return empty, + }; let scriptsig_bytes: Vec = tx .input @@ -532,10 +566,7 @@ impl Query { let coinbase_raw = scriptsig_bytes.to_lower_hex_string(); - let coinbase_signature_ascii: String = scriptsig_bytes - .iter() - .map(|&b| b as char) - .collect(); + let coinbase_signature_ascii: String = scriptsig_bytes.iter().map(|&b| b as char).collect(); let mut coinbase_addresses: Vec = tx .output diff --git a/crates/brk_query/src/impl/mining/block_fee_rates.rs b/crates/brk_query/src/impl/mining/block_fee_rates.rs index 444d0f0e6..055b22e07 100644 --- a/crates/brk_query/src/impl/mining/block_fee_rates.rs +++ b/crates/brk_query/src/impl/mining/block_fee_rates.rs @@ -9,7 +9,12 @@ impl Query { pub fn block_fee_rates(&self, time_period: TimePeriod) -> Result> { let bw = BlockWindow::new(self, time_period); let computer = self.computer(); - let frd = &computer.transactions.fees.effective_fee_rate.distribution.block; + let frd = &computer + .transactions + .fees + .effective_fee_rate + .distribution + .block; let min = frd.min.height.collect_range_at(bw.start, bw.end); let pct10 = frd.pct10.height.collect_range_at(bw.start, bw.end); diff --git a/crates/brk_query/src/impl/mining/hashrate.rs b/crates/brk_query/src/impl/mining/hashrate.rs index 723d5f5d6..7a7e22c49 100644 --- a/crates/brk_query/src/impl/mining/hashrate.rs +++ b/crates/brk_query/src/impl/mining/hashrate.rs @@ -62,10 +62,7 @@ impl Query { let mut hashrates = Vec::with_capacity(total_days / step + 1); let mut di = start_day1.to_usize(); while di <= end_day1.to_usize() { - if let (Some(Some(hr)), Some(timestamp)) = ( - hr_cursor.get(di), - ts_cursor.get(di), - ) { + if let (Some(Some(hr)), Some(timestamp)) = (hr_cursor.get(di), ts_cursor.get(di)) { hashrates.push(HashrateEntry { timestamp, avg_hashrate: *hr as u128, diff --git a/crates/brk_query/src/impl/tx.rs b/crates/brk_query/src/impl/tx.rs index 1d7c5cf4f..6ef701acd 100644 --- a/crates/brk_query/src/impl/tx.rs +++ b/crates/brk_query/src/impl/tx.rs @@ -53,8 +53,18 @@ impl Query { }; // Get block info for status - let height = indexer.vecs.transactions.height.collect_one(tx_index).unwrap(); - let block_hash = indexer.vecs.blocks.blockhash.reader().get(height.to_usize()); + let height = indexer + .vecs + .transactions + .height + .collect_one(tx_index) + .unwrap(); + let block_hash = indexer + .vecs + .blocks + .blockhash + .reader() + .get(height.to_usize()); let block_time = indexer.vecs.blocks.timestamp.collect_one(height).unwrap(); Ok(TxStatus { @@ -110,7 +120,10 @@ impl Query { } pub fn outspend(&self, txid: &Txid, vout: Vout) -> Result { - if self.mempool().is_some_and(|m| m.get_txs().contains_key(txid)) { + if self + .mempool() + .is_some_and(|m| m.get_txs().contains_key(txid)) + { return Ok(TxOutspend::UNSPENT); } let (_, first_txout, output_count) = self.resolve_tx_outputs(txid)?; @@ -150,8 +163,7 @@ impl Query { } let spending_tx_index = input_tx_cursor.get(usize::from(txin_index)).unwrap(); - let spending_first_txin = - first_txin_cursor.get(spending_tx_index.to_usize()).unwrap(); + let spending_first_txin = first_txin_cursor.get(spending_tx_index.to_usize()).unwrap(); let vin = Vin::from(usize::from(txin_index) - usize::from(spending_first_txin)); let spending_txid = txid_reader.get(spending_tx_index.to_usize()); let spending_height = height_cursor.get(spending_tx_index.to_usize()).unwrap(); diff --git a/crates/brk_server/src/lib.rs b/crates/brk_server/src/lib.rs index 3b07e7d4a..bca1b2e11 100644 --- a/crates/brk_server/src/lib.rs +++ b/crates/brk_server/src/lib.rs @@ -4,10 +4,7 @@ use std::{ any::Any, net::SocketAddr, path::PathBuf, - sync::{ - Arc, - atomic::AtomicU64, - }, + sync::{Arc, atomic::AtomicU64}, time::{Duration, Instant}, }; diff --git a/crates/brk_store/src/lib.rs b/crates/brk_store/src/lib.rs index 32a08e517..b5874ed90 100644 --- a/crates/brk_store/src/lib.rs +++ b/crates/brk_store/src/lib.rs @@ -377,5 +377,4 @@ where Ok(()) } - } diff --git a/crates/brk_types/src/cpfp.rs b/crates/brk_types/src/cpfp.rs index 84a340bf3..d09592487 100644 --- a/crates/brk_types/src/cpfp.rs +++ b/crates/brk_types/src/cpfp.rs @@ -26,7 +26,6 @@ pub struct CpfpInfo { pub adjusted_vsize: Option, } - /// A transaction in a CPFP relationship #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct CpfpEntry { diff --git a/crates/brk_types/src/dollars.rs b/crates/brk_types/src/dollars.rs index 3915fa850..8608375cd 100644 --- a/crates/brk_types/src/dollars.rs +++ b/crates/brk_types/src/dollars.rs @@ -17,7 +17,13 @@ use super::{Bitcoin, CentsSigned, Close, High, Sats, StoredF32, StoredF64}; /// US Dollar amount #[derive(Debug, Default, Clone, Copy, Deref, Serialize, Deserialize, Pco, JsonSchema)] -#[schemars(example = 0.0, example = 100.50, example = 30_000.0, example = 69_000.0, example = 84_342.12)] +#[schemars( + example = &0.0, + example = &100.50, + example = &30_000.0, + example = &69_000.0, + example = &84_342.12 +)] pub struct Dollars(f64); impl Hash for Dollars { diff --git a/crates/brk_types/src/feerate.rs b/crates/brk_types/src/feerate.rs index acd1345ac..b78c62915 100644 --- a/crates/brk_types/src/feerate.rs +++ b/crates/brk_types/src/feerate.rs @@ -11,7 +11,14 @@ use super::{Sats, VSize, Weight}; /// Fee rate in sat/vB #[derive(Debug, Default, Clone, Copy, Serialize, Deserialize, Pco, JsonSchema)] -#[schemars(example = 1.0, example = 2.5, example = 10.14, example = 25.0, example = 302.11)] +#[schemars( + example = &0.1, + example = &1.0, + example = &2.5, + example = &10.14, + example = &25.0, + example = &302.11 +)] pub struct FeeRate(f64); impl FeeRate { diff --git a/crates/brk_types/src/raw_locktime.rs b/crates/brk_types/src/raw_locktime.rs index 521ffdff9..0a2e4665c 100644 --- a/crates/brk_types/src/raw_locktime.rs +++ b/crates/brk_types/src/raw_locktime.rs @@ -5,7 +5,7 @@ use vecdb::{Formattable, Pco}; /// Transaction locktime. Values below 500,000,000 are interpreted as block heights; values at or above are Unix timestamps. #[derive(Debug, Clone, Copy, Serialize, Deserialize, Pco, JsonSchema)] -#[schemars(example = 0, example = 840000, example = 840001, example = 1713571200, example = 4294967295_u32)] +#[schemars(example = &0, example = &840000, example = &840001, example = &1713571200)] pub struct RawLockTime(u32); impl From for RawLockTime { diff --git a/crates/brk_types/src/sats.rs b/crates/brk_types/src/sats.rs index 398c2d23d..bd84d3ad1 100644 --- a/crates/brk_types/src/sats.rs +++ b/crates/brk_types/src/sats.rs @@ -31,11 +31,11 @@ use super::{Bitcoin, Cents, Dollars, Height}; JsonSchema, )] #[schemars( - example = 0, - example = 546, - example = 10000, - example = 100_000_000, - example = 2_100_000_000_000_000_u64 + example = &0, + example = &546, + example = &10000, + example = &100_000_000, + example = &2_100_000_000_000_000_u64 )] pub struct Sats(u64); diff --git a/crates/brk_types/src/timestamp.rs b/crates/brk_types/src/timestamp.rs index 9d16efb68..e6653c743 100644 --- a/crates/brk_types/src/timestamp.rs +++ b/crates/brk_types/src/timestamp.rs @@ -25,11 +25,11 @@ use super::Date; JsonSchema, )] #[schemars( - example = 1231006505, - example = 1672531200, - example = 1713571200, - example = 1743631892, - example = 1759000868 + example = &1231006505, + example = &1672531200, + example = &1713571200, + example = &1743631892, + example = &1759000868 )] pub struct Timestamp(u32); diff --git a/crates/brk_types/src/tx.rs b/crates/brk_types/src/tx.rs index d20b831be..a2f13deb5 100644 --- a/crates/brk_types/src/tx.rs +++ b/crates/brk_types/src/tx.rs @@ -1,6 +1,5 @@ use crate::{ - FeeRate, RawLockTime, Sats, TxIn, TxIndex, TxOut, TxStatus, TxVersionRaw, Txid, VSize, - Weight, + FeeRate, RawLockTime, Sats, TxIn, TxIndex, TxOut, TxStatus, TxVersionRaw, Txid, VSize, Weight, }; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/crates/brk_types/src/tx_version_raw.rs b/crates/brk_types/src/tx_version_raw.rs index 785b6753d..9fd3e5855 100644 --- a/crates/brk_types/src/tx_version_raw.rs +++ b/crates/brk_types/src/tx_version_raw.rs @@ -6,7 +6,13 @@ use serde::{Deserialize, Serialize}; /// Unlike TxVersion (u8, indexed), this preserves non-standard values /// used in coinbase txs for miner signaling/branding. #[derive(Debug, Deref, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] -#[schemars(example = 1, example = 2, example = 3, example = 536_870_912, example = 805_306_368)] +#[schemars( + example = &1, + example = &2, + example = &3, + example = &536_870_912, + example = &805_306_368 +)] pub struct TxVersionRaw(i32); impl From for TxVersionRaw { diff --git a/crates/brk_types/src/vin.rs b/crates/brk_types/src/vin.rs index 3f9ebe92d..0fd12c64f 100644 --- a/crates/brk_types/src/vin.rs +++ b/crates/brk_types/src/vin.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; #[derive( Debug, Deref, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, JsonSchema, )] -#[schemars(example = 0, example = 1, example = 2, example = 5, example = 10)] +#[schemars(example = &0, example = &1, example = &2, example = &5, example = &10)] pub struct Vin(u16); impl Vin { diff --git a/crates/brk_types/src/vout.rs b/crates/brk_types/src/vout.rs index 4c8a159d2..cd14c3885 100644 --- a/crates/brk_types/src/vout.rs +++ b/crates/brk_types/src/vout.rs @@ -20,7 +20,7 @@ use vecdb::{Bytes, Formattable}; Bytes, Hash, )] -#[schemars(example = 0, example = 1, example = 2, example = 5, example = 10)] +#[schemars(example = &0, example = &1, example = &2, example = &5, example = &10)] pub struct Vout(u16); impl Vout { diff --git a/crates/brk_types/src/vsize.rs b/crates/brk_types/src/vsize.rs index 22497348a..04c84fc94 100644 --- a/crates/brk_types/src/vsize.rs +++ b/crates/brk_types/src/vsize.rs @@ -23,7 +23,13 @@ use crate::Weight; Pco, JsonSchema, )] -#[schemars(example = 110, example = 140, example = 225, example = 500_000, example = 998_368)] +#[schemars( + example = &110, + example = &140, + example = &225, + example = &500_000, + example = &998_368 +)] pub struct VSize(u64); impl VSize { diff --git a/crates/brk_types/src/weight.rs b/crates/brk_types/src/weight.rs index 6d8ffd0bb..75f9eb0fe 100644 --- a/crates/brk_types/src/weight.rs +++ b/crates/brk_types/src/weight.rs @@ -23,7 +23,13 @@ use crate::VSize; Pco, JsonSchema, )] -#[schemars(example = 396, example = 561, example = 900, example = 2_000_000, example = 3_993_472)] +#[schemars( + example = &396, + example = &561, + example = &900, + example = &2_000_000, + example = &3_993_472 +)] pub struct Weight(u64); impl Weight { diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 336a6703d..32f185845 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -6628,7 +6628,7 @@ function createTransferPattern(client, acc) { * @extends BrkClientBase */ class BrkClient extends BrkClientBase { - VERSION = "v0.3.0-alpha.6"; + VERSION = "v0.3.0-beta.0"; INDEXES = /** @type {const} */ ([ "minute10", diff --git a/modules/brk-client/package.json b/modules/brk-client/package.json index ed349d4e4..622a062c4 100644 --- a/modules/brk-client/package.json +++ b/modules/brk-client/package.json @@ -40,5 +40,5 @@ "url": "git+https://github.com/bitcoinresearchkit/brk.git" }, "type": "module", - "version": "0.3.0-alpha.6" + "version": "0.3.0-beta.0" } diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index e507c522e..9e126ab46 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -6079,7 +6079,7 @@ class SeriesTree: class BrkClient(BrkClientBase): """Main BRK client with series tree and API methods.""" - VERSION = "v0.3.0-alpha.6" + VERSION = "v0.3.0-beta.0" INDEXES = [ "minute10", diff --git a/packages/brk_client/pyproject.toml b/packages/brk_client/pyproject.toml index 3be3b4f1f..b990c6912 100644 --- a/packages/brk_client/pyproject.toml +++ b/packages/brk_client/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "brk-client" -version = "0.3.0-alpha.6" +version = "0.3.0-beta.0" description = "Bitcoin on-chain analytics client — thousands of metrics, block explorer, and address index" readme = "README.md" requires-python = ">=3.9" diff --git a/website/scripts/explorer/address.js b/website/scripts/explorer/address.js index b21970e0a..5588289fc 100644 --- a/website/scripts/explorer/address.js +++ b/website/scripts/explorer/address.js @@ -1,32 +1,81 @@ import { brk } from "../utils/client.js"; import { createMapCache } from "../utils/cache.js"; import { latestPrice } from "../utils/price.js"; -import { formatBtc, renderRows, renderTx, TX_PAGE_SIZE } from "./render.js"; +import { formatBtc, renderTx, showPanel, hidePanel, TX_PAGE_SIZE } from "./render.js"; -/** @type {MapCache} */ -const addrTxCache = createMapCache(200); +/** @type {HTMLDivElement} */ let el; +/** @type {HTMLSpanElement[]} */ let valueEls; +/** @type {HTMLDivElement} */ let txSection; +/** @type {string} */ let currentAddr = ""; + +const statsCache = createMapCache(50); +const txCache = createMapCache(200); + +const ROW_LABELS = [ + "Address", + "Confirmed Balance", + "Pending", + "Confirmed UTXOs", + "Pending UTXOs", + "Total Received", + "Tx Count", + "Type", + "Avg Cost Basis", +]; + +/** @param {HTMLElement} parent @param {(e: MouseEvent) => void} linkHandler */ +export function initAddrDetails(parent, linkHandler) { + el = document.createElement("div"); + el.id = "addr-details"; + el.hidden = true; + parent.append(el); + el.addEventListener("click", linkHandler); + + const title = document.createElement("h1"); + title.textContent = "Address"; + el.append(title); + + valueEls = ROW_LABELS.map((label) => { + const row = document.createElement("div"); + row.classList.add("row"); + const labelEl = document.createElement("span"); + labelEl.classList.add("label"); + labelEl.textContent = label; + const valueEl = document.createElement("span"); + valueEl.classList.add("value"); + row.append(labelEl, valueEl); + el.append(row); + return valueEl; + }); + + txSection = document.createElement("div"); + txSection.classList.add("transactions"); + const heading = document.createElement("h2"); + heading.textContent = "Transactions"; + txSection.append(heading); + el.append(txSection); +} /** * @param {string} address - * @param {HTMLDivElement} el - * @param {{ signal: AbortSignal, cache: MapCache }} options + * @param {AbortSignal} signal */ -export async function showAddrDetail(address, el, { signal, cache }) { - el.hidden = false; - el.scrollTop = 0; - el.innerHTML = ""; +export async function update(address, signal) { + currentAddr = address; + valueEls[0].textContent = address; + for (let i = 1; i < valueEls.length; i++) { + valueEls[i].textContent = "..."; + valueEls[i].classList.add("dim"); + } + while (txSection.children.length > 1) txSection.lastChild?.remove(); try { - const cached = cache.get(address); + const cached = statsCache.get(address); const stats = cached ?? (await brk.getAddress(address, { signal })); - if (!cached) cache.set(address, stats); - if (signal.aborted) return; + if (!cached) statsCache.set(address, stats); + if (signal.aborted || currentAddr !== address) return; + const chain = stats.chainStats; - - const title = document.createElement("h1"); - title.textContent = "Address"; - el.append(title); - const balance = chain.fundedTxoSum - chain.spentTxoSum; const mempool = stats.mempoolStats; const pending = mempool ? mempool.fundedTxoSum - mempool.spentTxoSum : 0; @@ -40,40 +89,26 @@ export async function showAddrDetail(address, el, { signal, cache }) { ? ` $${((sats / 1e8) * price).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : ""; - renderRows( - [ - ["Address", address], - ["Confirmed Balance", `${formatBtc(balance)} BTC${fmtUsd(balance)}`], - [ - "Pending", - `${pending >= 0 ? "+" : ""}${formatBtc(pending)} BTC${fmtUsd(pending)}`, - ], - ["Confirmed UTXOs", confirmedUtxos.toLocaleString()], - ["Pending UTXOs", pendingUtxos.toLocaleString()], - ["Total Received", `${formatBtc(chain.fundedTxoSum)} BTC`], - ["Tx Count", chain.txCount.toLocaleString()], - [ - "Type", - /** @type {any} */ ((stats).addrType ?? "unknown") - .replace(/^v\d+_/, "") - .toUpperCase(), - ], - [ - "Avg Cost Basis", - chain.realizedPrice - ? `$${Number(chain.realizedPrice).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` - : "N/A", - ], - ], - el, - ); + const values = [ + address, + `${formatBtc(balance)} BTC${fmtUsd(balance)}`, + `${pending >= 0 ? "+" : ""}${formatBtc(pending)} BTC${fmtUsd(pending)}`, + confirmedUtxos.toLocaleString(), + pendingUtxos.toLocaleString(), + `${formatBtc(chain.fundedTxoSum)} BTC`, + chain.txCount.toLocaleString(), + (/** @type {any} */ (stats).addrType ?? "unknown") + .replace(/^v\d+_/, "") + .toUpperCase(), + chain.realizedPrice + ? `$${Number(chain.realizedPrice).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` + : "N/A", + ]; - const section = document.createElement("div"); - section.classList.add("transactions"); - const heading = document.createElement("h2"); - heading.textContent = "Transactions"; - section.append(heading); - el.append(section); + for (let i = 0; i < valueEls.length; i++) { + valueEls[i].textContent = values[i]; + valueEls[i].classList.remove("dim"); + } let loading = false; let pageIndex = 0; @@ -81,35 +116,44 @@ export async function showAddrDetail(address, el, { signal, cache }) { let afterTxid; const observer = new IntersectionObserver((entries) => { - if (entries[0].isIntersecting && !loading && pageIndex * TX_PAGE_SIZE < chain.txCount) + if ( + entries[0].isIntersecting && + !loading && + pageIndex * TX_PAGE_SIZE < chain.txCount + ) loadMore(); }); async function loadMore() { + if (currentAddr !== address) return; loading = true; const key = `${address}:${pageIndex}`; try { - const cached = addrTxCache.get(key); - const txs = cached ?? await brk.getAddressTxs(address, afterTxid, { signal }); - if (!cached) addrTxCache.set(key, txs); - for (const tx of txs) section.append(renderTx(tx)); + const cached = txCache.get(key); + const txs = + cached ?? (await brk.getAddressTxs(address, afterTxid, { signal })); + if (!cached) txCache.set(key, txs); + if (currentAddr !== address) return; + for (const tx of txs) txSection.append(renderTx(tx)); pageIndex++; if (txs.length) { afterTxid = txs[txs.length - 1].txid; observer.disconnect(); - const last = section.lastElementChild; + const last = txSection.lastElementChild; if (last) observer.observe(last); } } catch (e) { - console.error("explorer addr txs:", e); - pageIndex = chain.txCount; // stop loading + if (!signal.aborted) console.error("explorer addr txs:", e); + pageIndex = chain.txCount; } loading = false; } await loadMore(); } catch (e) { - console.error("explorer addr:", e); - el.textContent = "Address not found"; + if (!signal.aborted) console.error("explorer addr:", e); } } + +export function show() { showPanel(el); } +export function hide() { hidePanel(el); } diff --git a/website/scripts/explorer/block.js b/website/scripts/explorer/block.js index e13c83fc8..1981d3885 100644 --- a/website/scripts/explorer/block.js +++ b/website/scripts/explorer/block.js @@ -1,7 +1,7 @@ import { brk } from "../utils/client.js"; import { createMapCache } from "../utils/cache.js"; import { createPersistedValue } from "../utils/persisted.js"; -import { formatFeeRate, renderTx, TX_PAGE_SIZE } from "./render.js"; +import { formatFeeRate, renderTx, showPanel, hidePanel, TX_PAGE_SIZE } from "./render.js"; /** @typedef {[string, (b: BlockInfoV1) => string | null, ((b: BlockInfoV1) => string | null)?]} RowDef */ @@ -88,7 +88,7 @@ export function initBlockDetails(parent, linkHandler) { const code = document.createElement("code"); const container = document.createElement("span"); heightPrefix = document.createElement("span"); - heightPrefix.style.opacity = "0.5"; + heightPrefix.classList.add("dim"); heightPrefix.style.userSelect = "none"; heightNum = document.createElement("span"); container.append(heightPrefix, heightNum); @@ -170,9 +170,6 @@ function updateTxNavs(page) { /** @param {BlockInfoV1} block */ export function update(block) { - show(); - el.scrollTop = 0; - const str = block.height.toString(); heightPrefix.textContent = "#" + "0".repeat(7 - str.length); heightNum.textContent = str; @@ -200,13 +197,8 @@ export function update(block) { txObserver.observe(txSection); } -export function show() { - el.hidden = false; -} - -export function hide() { - el.hidden = true; -} +export function show() { showPanel(el); } +export function hide() { hidePanel(el); } /** @param {number} page @param {boolean} [pushUrl] */ async function loadTxPage(page, pushUrl = true) { diff --git a/website/scripts/explorer/chain.js b/website/scripts/explorer/chain.js index f9a5ec08e..46cfe7cb8 100644 --- a/website/scripts/explorer/chain.js +++ b/website/scripts/explorer/chain.js @@ -56,11 +56,6 @@ export function initChain(parent, callbacks) { ); } -/** @param {string} hash */ -export function getBlock(hash) { - return blocksByHash.get(hash); -} - /** @param {string} hash */ export function findCube(hash) { return /** @type {HTMLDivElement | null} */ ( @@ -68,12 +63,13 @@ export function findCube(hash) { ); } -export function lastCube() { - return /** @type {HTMLDivElement | null} */ (blocksEl.lastElementChild); +export function deselectCube() { + if (selectedCube) selectedCube.classList.remove("selected"); + selectedCube = null; } -/** @param {HTMLDivElement} cube @param {{ scroll?: "smooth" | "instant" }} [opts] */ -export function selectCube(cube, { scroll } = {}) { +/** @param {HTMLDivElement} cube @param {{ scroll?: "smooth" | "instant", silent?: boolean }} [opts] */ +export function selectCube(cube, { scroll, silent } = {}) { const changed = cube !== selectedCube; if (changed) { if (selectedCube) selectedCube.classList.remove("selected"); @@ -81,10 +77,12 @@ export function selectCube(cube, { scroll } = {}) { cube.classList.add("selected"); } if (scroll) cube.scrollIntoView({ behavior: scroll }); - const hash = cube.dataset.hash; - if (hash) { - const block = blocksByHash.get(hash); - if (block) onSelect(block); + if (!silent) { + const hash = cube.dataset.hash; + if (hash) { + const block = blocksByHash.get(hash); + if (block) onSelect(block); + } } } @@ -127,7 +125,7 @@ function appendNewerBlocks(blocks) { return true; } -/** @param {number | null} [height] */ +/** @param {number | null} [height] @returns {Promise} */ export async function loadInitial(height) { const blocks = height != null @@ -140,6 +138,7 @@ export async function loadInitial(height) { reachedTip = height == null; observeOldestEdge(); if (!reachedTip) await loadNewer(); + return blocks[0].id; } export async function poll() { @@ -206,14 +205,14 @@ function createBlockCube(block) { const min = document.createElement("span"); min.innerHTML = formatFeeRate(feeRange[0]); const dash = document.createElement("span"); - dash.style.opacity = "0.5"; + dash.classList.add("dim"); dash.innerHTML = `-`; const max = document.createElement("span"); max.innerHTML = formatFeeRate(feeRange[6]); range.append(min, dash, max); feesEl.append(range); const unit = document.createElement("p"); - unit.style.opacity = "0.5"; + unit.classList.add("dim"); unit.innerHTML = `sat/vB`; feesEl.append(unit); diff --git a/website/scripts/explorer/index.js b/website/scripts/explorer/index.js index cdeb04fd6..5f48b5586 100644 --- a/website/scripts/explorer/index.js +++ b/website/scripts/explorer/index.js @@ -6,8 +6,8 @@ import { loadInitial, poll, selectCube, + deselectCube, findCube, - lastCube, clear as clearChain, } from "./chain.js"; import { @@ -16,20 +16,28 @@ import { show as showBlock, hide as hideBlock, } from "./block.js"; -import { showTxFromData } from "./tx.js"; -import { showAddrDetail } from "./address.js"; +import { + initTxDetails, + update as updateTx, + clear as clearTx, + show as showTx, + hide as hideTx, +} from "./tx.js"; +import { + initAddrDetails, + update as updateAddr, + show as showAddr, + hide as hideAddr, +} from "./address.js"; /** @returns {string[]} */ function pathSegments() { return window.location.pathname.split("/").filter((v) => v); } -/** @type {HTMLDivElement} */ let secondaryPanel; /** @type {number | undefined} */ let pollInterval; -/** @type {Transaction | null} */ let pendingTx = null; let navController = new AbortController(); const txCache = createMapCache(50); -const addrCache = createMapCache(50); function navigate() { navController.abort(); @@ -37,14 +45,10 @@ function navigate() { return navController.signal; } -function showBlockPanel() { - showBlock(); - secondaryPanel.hidden = true; -} - -function showSecondaryPanel() { - hideBlock(); - secondaryPanel.hidden = false; +function showPanel(/** @type {"block" | "tx" | "addr"} */ which) { + which === "block" ? showBlock() : hideBlock(); + which === "tx" ? showTx() : hideTx(); + which === "addr" ? showAddr() : hideAddr(); } /** @param {MouseEvent} e */ @@ -71,9 +75,10 @@ export function init() { initChain(explorerElement, { onSelect: (block) => { updateBlock(block); - showBlockPanel(); + showPanel("block"); }, onCubeClick: (cube) => { + navigate(); const hash = cube.dataset.hash; if (hash) history.pushState(null, "", `/block/${hash}`); selectCube(cube); @@ -81,12 +86,8 @@ export function init() { }); initBlockDetails(explorerElement, handleLinkClick); - - secondaryPanel = document.createElement("div"); - secondaryPanel.id = "tx-details"; - secondaryPanel.hidden = true; - explorerElement.append(secondaryPanel); - secondaryPanel.addEventListener("click", handleLinkClick); + initTxDetails(explorerElement, handleLinkClick); + initAddrDetails(explorerElement, handleLinkClick); new MutationObserver(() => { if (explorerElement.hidden) stopPolling(); @@ -105,7 +106,7 @@ export function init() { if (kind === "block" && value) navigateToBlock(value, false); else if (kind === "tx" && value) navigateToTx(value); else if (kind === "address" && value) navigateToAddr(value); - else showBlockPanel(); + else showPanel("block"); }); load(); @@ -126,116 +127,97 @@ function stopPolling() { async function load() { try { - const height = await resolveStartHeight(); - await loadInitial(height); - route(); + const [kind, value] = pathSegments(); + + if (kind === "tx" && value) { + const tx = txCache.get(value) ?? (await brk.getTx(value)); + txCache.set(value, tx); + const startHash = await loadInitial(tx.status?.blockHeight ?? null); + const cube = tx.status?.blockHash ? findCube(tx.status.blockHash) : findCube(startHash); + if (cube) selectCube(cube, { silent: true }); + updateTx(tx); + showPanel("tx"); + return; + } + + if (kind === "address" && value) { + const startHash = await loadInitial(null); + const cube = findCube(startHash); + if (cube) selectCube(cube, { silent: true }); + navigateToAddr(value); + return; + } + + const height = + kind === "block" && value + ? /^\d+$/.test(value) + ? Number(value) + : (await brk.getBlockV1(value)).height + : null; + const startHash = await loadInitial(height); + const cube = findCube(startHash); + if (cube) selectCube(cube, { scroll: "instant" }); } catch (e) { console.error("explorer load:", e); } } -/** @param {AbortSignal} [signal] @returns {Promise} */ -async function resolveStartHeight(signal) { - const [kind, value] = pathSegments(); - if (!value) return null; - if (kind === "block") { - if (/^\d+$/.test(value)) return Number(value); - return (await brk.getBlockV1(value, { signal })).height; - } - if (kind === "tx") { - const tx = txCache.get(value) ?? (await brk.getTx(value, { signal })); - txCache.set(value, tx); - pendingTx = tx; - return tx.status?.blockHeight ?? null; - } - return null; -} - -function route() { - const [kind, value] = pathSegments(); - if (pendingTx) { - const hash = pendingTx.status?.blockHash; - const cube = hash ? findCube(hash) : null; - if (cube) selectCube(cube, { scroll: "instant" }); - showTxFromData(pendingTx, secondaryPanel); - showSecondaryPanel(); - pendingTx = null; - } else if (kind === "address" && value) { - const cube = lastCube(); - if (cube) selectCube(cube, { scroll: "instant" }); - navigateToAddr(value); - } else { - const cube = lastCube(); - if (cube) selectCube(cube, { scroll: "instant" }); - } -} - /** @param {string} hash @param {boolean} [pushUrl] */ async function navigateToBlock(hash, pushUrl = true) { if (pushUrl) history.pushState(null, "", `/block/${hash}`); - const cube = findCube(hash); - if (cube) { - selectCube(cube, { scroll: "smooth" }); - } else { - const signal = navigate(); - try { - clearChain(); - await loadInitial(await resolveStartHeight(signal)); - if (signal.aborted) return; - route(); - } catch (e) { - if (!signal.aborted) console.error("explorer block:", e); - } + const existing = findCube(hash); + if (existing) { + navigate(); + selectCube(existing, { scroll: "smooth" }); + return; + } + const signal = navigate(); + try { + clearChain(); + const height = /^\d+$/.test(hash) + ? Number(hash) + : (await brk.getBlockV1(hash, { signal })).height; + if (signal.aborted) return; + const startHash = await loadInitial(height); + if (signal.aborted) return; + const cube = findCube(hash) ?? findCube(startHash); + if (cube) selectCube(cube); + } catch (e) { + if (!signal.aborted) console.error("explorer block:", e); } } /** @param {string} txid */ async function navigateToTx(txid) { - const cached = txCache.get(txid); - if (cached) { - navigate(); - showTxAndSelectBlock(cached); - return; - } const signal = navigate(); + clearTx(); + showPanel("tx"); try { - const tx = await brk.getTx(txid, { - signal, - onUpdate: (tx) => { - txCache.set(txid, tx); - if (!signal.aborted) showTxAndSelectBlock(tx); - }, - }); + const tx = txCache.get(txid) ?? (await brk.getTx(txid, { signal })); + if (signal.aborted) return; txCache.set(txid, tx); + + if (tx.status?.blockHash) { + let cube = findCube(tx.status.blockHash); + if (!cube) { + clearChain(); + const startHash = await loadInitial(tx.status.blockHeight ?? null); + if (signal.aborted) return; + cube = findCube(tx.status.blockHash) ?? findCube(startHash); + } + if (cube) selectCube(cube, { scroll: "smooth", silent: true }); + } + + updateTx(tx); } catch (e) { if (!signal.aborted) console.error("explorer tx:", e); } } -/** @param {Transaction} tx */ -function showTxAndSelectBlock(tx) { - if (tx.status?.blockHash) { - const cube = findCube(tx.status.blockHash); - if (cube) { - selectCube(cube, { scroll: "smooth" }); - showTxFromData(tx, secondaryPanel); - showSecondaryPanel(); - return; - } - pendingTx = tx; - clearChain(); - loadInitial(tx.status.blockHeight ?? null).then(() => { - if (!navController.signal.aborted) route(); - }); - return; - } - showTxFromData(tx, secondaryPanel); - showSecondaryPanel(); -} - /** @param {string} address */ function navigateToAddr(address) { - const signal = navigate(); - showAddrDetail(address, secondaryPanel, { signal, cache: addrCache }); - showSecondaryPanel(); + navigate(); + deselectCube(); + updateAddr(address, navController.signal); + showPanel("addr"); } diff --git a/website/scripts/explorer/render.js b/website/scripts/explorer/render.js index 79a15dc55..98a244e7d 100644 --- a/website/scripts/explorer/render.js +++ b/website/scripts/explorer/render.js @@ -1,5 +1,16 @@ export const TX_PAGE_SIZE = 25; +/** @param {HTMLElement} el */ +export function showPanel(el) { + el.hidden = false; + el.scrollTop = 0; +} + +/** @param {HTMLElement} el */ +export function hidePanel(el) { + el.hidden = true; +} + /** @param {number} sats */ export function formatBtc(sats) { return (sats / 1e8).toFixed(8); @@ -33,7 +44,7 @@ export function createHeightElement(height) { const container = document.createElement("span"); const str = height.toString(); const prefix = document.createElement("span"); - prefix.style.opacity = "0.5"; + prefix.classList.add("dim"); prefix.style.userSelect = "none"; prefix.textContent = "#" + "0".repeat(7 - str.length); const num = document.createElement("span"); @@ -62,12 +73,6 @@ export function renderRows(rows, parent) { } } -/** - * @param {Transaction} tx - * @param {string} [coinbaseAscii] - */ -const IO_LIMIT = 10; - /** * @param {TxIn} vin * @param {string} [coinbaseAscii] @@ -142,16 +147,16 @@ function renderOutput(vout) { * @param {(item: T) => HTMLElement} render * @param {HTMLElement} container */ -function renderCapped(items, render, container) { - const limit = Math.min(items.length, IO_LIMIT); +function renderCapped(items, render, container, max = 10) { + const limit = Math.min(items.length, max); for (let i = 0; i < limit; i++) container.append(render(items[i])); - if (items.length > IO_LIMIT) { + if (items.length > max) { const btn = document.createElement("button"); btn.classList.add("show-more"); - btn.textContent = `Show ${items.length - IO_LIMIT} more`; + btn.textContent = `Show ${items.length - max} more`; btn.addEventListener("click", () => { btn.remove(); - for (let i = IO_LIMIT; i < items.length; i++) container.append(render(items[i])); + for (let i = max; i < items.length; i++) container.append(render(items[i])); }); container.append(btn); } diff --git a/website/scripts/explorer/tx.js b/website/scripts/explorer/tx.js index 00c256a37..d873af6c6 100644 --- a/website/scripts/explorer/tx.js +++ b/website/scripts/explorer/tx.js @@ -1,12 +1,34 @@ -import { formatBtc, formatFeeRate, renderRows, renderTx } from "./render.js"; +import { formatBtc, formatFeeRate, renderRows, renderTx, showPanel, hidePanel } from "./render.js"; -/** - * @param {Transaction} tx - * @param {HTMLDivElement} el - */ -export function showTxFromData(tx, el) { - el.hidden = false; - el.scrollTop = 0; +/** @type {HTMLDivElement} */ let el; + +/** @param {HTMLElement} parent @param {(e: MouseEvent) => void} linkHandler */ +export function initTxDetails(parent, linkHandler) { + el = document.createElement("div"); + el.id = "tx-details"; + el.hidden = true; + parent.append(el); + el.addEventListener("click", linkHandler); +} + +export function show() { showPanel(el); } +export function hide() { hidePanel(el); } + +export function clear() { + if (el.children.length) { + el.querySelector(".transactions")?.remove(); + for (const v of el.querySelectorAll(".row .value")) { + v.classList.add("dim"); + } + } else { + const title = document.createElement("h1"); + title.textContent = "Transaction"; + el.append(title); + } +} + +/** @param {Transaction} tx */ +export function update(tx) { el.innerHTML = ""; const title = document.createElement("h1"); diff --git a/website/scripts/utils/url.js b/website/scripts/utils/url.js index 34efa0dd1..ddb6a4486 100644 --- a/website/scripts/utils/url.js +++ b/website/scripts/utils/url.js @@ -10,15 +10,22 @@ function processPathname(pathname) { const chartParamsWhitelist = ["range"]; +/** + * @param {string | string[]} [pathname] + * @param {URLSearchParams} [urlParams] + */ +function buildUrl(pathname, urlParams) { + const path = processPathname(pathname); + const query = (urlParams ?? new URLSearchParams(window.location.search)).toString(); + return `/${path}${query ? `?${query}` : ""}`; +} + /** * @param {string | string[]} pathname */ export function pushHistory(pathname) { - const urlParams = new URLSearchParams(window.location.search); - pathname = processPathname(pathname); try { - const url = `/${pathname}?${urlParams.toString()}`; - window.history.pushState(null, "", url); + window.history.pushState(null, "", buildUrl(pathname)); } catch (_) {} } @@ -28,11 +35,8 @@ export function pushHistory(pathname) { * @param {string | string[]} [args.pathname] */ export function replaceHistory({ urlParams, pathname }) { - urlParams ||= new URLSearchParams(window.location.search); - pathname = processPathname(pathname); try { - const url = `/${pathname}?${urlParams.toString()}`; - window.history.replaceState(null, "", url); + window.history.replaceState(null, "", buildUrl(pathname, urlParams)); } catch (_) {} } diff --git a/website/styles/main.css b/website/styles/main.css index 911f3dc36..10027c5cb 100644 --- a/website/styles/main.css +++ b/website/styles/main.css @@ -98,7 +98,7 @@ main { > fieldset { display: flex; - gap: 1.25rem; + gap: 1.125rem; overflow-x: auto; scrollbar-width: thin; min-width: 0; diff --git a/website/styles/panes/explorer.css b/website/styles/panes/explorer.css index 47f64a07e..f5d7a5e9c 100644 --- a/website/styles/panes/explorer.css +++ b/website/styles/panes/explorer.css @@ -4,6 +4,10 @@ display: flex; overflow: hidden; + .dim { + opacity: 0.5; + } + @media (max-width: 767px) { overflow-y: auto; padding: var(--main-padding) 0; @@ -180,7 +184,8 @@ } #block-details, - #tx-details { + #tx-details, + #addr-details { flex: 1; font-size: var(--font-size-sm); line-height: var(--line-height-sm); diff --git a/website/styles/panes/sim.css b/website/styles/panes/sim.css deleted file mode 100644 index d20b7de46..000000000 --- a/website/styles/panes/sim.css +++ /dev/null @@ -1,75 +0,0 @@ -#simulation { - min-height: 0; - width: 100%; - - > div { - display: flex; - flex-direction: column; - gap: 2rem; - padding: var(--main-padding); - } - - @media (max-width: 767px) { - overflow-y: auto; - - > div:first-child { - border-bottom: 1px; - } - } - - @media (min-width: 768px) { - display: flex; - flex-direction: row; - height: 100%; - - > div { - flex: 1; - overflow-y: auto; - padding-bottom: var(--bottom-area); - } - - > div:first-child { - max-width: var(--default-main-width); - border-right: 1px; - } - } - - header { - margin-bottom: 0.5rem; - } - - > div:last-child { - display: flex; - flex-direction: column; - gap: 1.5rem; - overflow-x: hidden; - - p { - text-wrap: pretty; - } - } - - label { - > span { - display: block; - } - small { - font-size: var(--font-size-sm); - line-height: var(--line-height-sm); - display: block; - } - } - - .chart { - flex: none; - height: 400px; - - > div { - margin-left: calc(var(--negative-main-padding) * 0.75); - - fieldset { - margin-left: -0.5rem; - } - } - } -} diff --git a/website/styles/panes/table.css b/website/styles/panes/table.css deleted file mode 100644 index ae2d38248..000000000 --- a/website/styles/panes/table.css +++ /dev/null @@ -1,139 +0,0 @@ -#table { - width: 100%; - display: flex; - flex-direction: column; - gap: 2rem; - padding: var(--main-padding); - - > div { - display: flex; - font-size: var(--font-size-xs); - line-height: var(--line-height-xs); - font-weight: 450; - margin-left: var(--negative-main-padding); - margin-right: var(--negative-main-padding); - - table { - z-index: 10; - border-top-width: 1px; - border-style: dashed !important; - line-height: var(--line-height-sm); - text-transform: uppercase; - table-layout: auto; - border-collapse: separate; - border-spacing: 0; - } - - th { - font-weight: 600; - } - - th, - td { - border-right: 1px; - border-bottom: 1px; - border-color: var(--off-color); - border-style: dashed !important; - padding: 0.25rem 0.75rem; - } - - td { - text-transform: none; - } - - a { - margin: -0.2rem 0; - font-size: 1.2rem; - } - - th:first-child { - padding-left: var(--main-padding); - } - - th[scope="col"] { - position: sticky; - top: 0; - background-color: var(--background-color); - - > div { - display: flex; - flex-direction: column; - padding-top: 0.275rem; - - > div { - display: flex; - gap: 0.25rem; - text-transform: lowercase; - color: var(--off-color); - text-align: left; - - &:first-child { - gap: 0.5rem; - } - - &:last-child { - gap: 1rem; - } - - > span { - width: 100%; - } - - > button { - padding: 0 0.25rem; - margin: 0 -0.25rem; - font-size: 0.75rem; - line-height: 0; - } - } - } - - &:first-child { - button { - display: none; - } - } - - &:nth-child(2) { - button:nth-of-type(1) { - display: none; - } - } - - &:last-child { - button:nth-of-type(2) { - display: none; - } - } - } - - select { - margin-right: -4px; - } - - tbody { - text-align: right; - } - - > button { - padding: 1rem; - min-width: 10rem; - display: flex; - flex-direction: column; - flex: 1; - position: relative; - border-top-width: 1px; - width: 100%; - border-bottom-width: 1px; - border-style: dashed !important; - - > span { - text-align: left; - position: sticky; - top: 2rem; - left: 0; - right: 0; - } - } - } -}