diff --git a/crates/brk_bindgen/src/generators/javascript/api.rs b/crates/brk_bindgen/src/generators/javascript/api.rs index 147c7067d..a064d9aef 100644 --- a/crates/brk_bindgen/src/generators/javascript/api.rs +++ b/crates/brk_bindgen/src/generators/javascript/api.rs @@ -126,7 +126,11 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { } if endpoint.supports_csv { - writeln!(output, " if (format === 'csv') return this.getText(path, {{ signal, onUpdate }});").unwrap(); + writeln!( + output, + " if (format === 'csv') return this.getText(path, {{ signal, onUpdate }});" + ) + .unwrap(); } writeln!(output, " return {};", fetch_call).unwrap(); diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 40adc94ac..83a75d68f 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, @@ -1019,18 +2321,51 @@ impl AllEmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern { pub fn new(client: Arc, acc: String) -> Self { Self { all: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "bis")), - empty: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_empty_outputs_output")), - op_return: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_op_return_output")), + empty: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_empty_outputs_output"), + ), + op_return: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_op_return_output"), + ), p2a: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2a_output")), - p2ms: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2ms_output")), - p2pk33: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2pk33_output")), - p2pk65: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2pk65_output")), - p2pkh: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2pkh_output")), - p2sh: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2sh_output")), - p2tr: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2tr_output")), - p2wpkh: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2wpkh_output")), - p2wsh: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_p2wsh_output")), - unknown: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "with_unknown_outputs_output")), + p2ms: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_p2ms_output"), + ), + p2pk33: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_p2pk33_output"), + ), + p2pk65: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_p2pk65_output"), + ), + p2pkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_p2pkh_output"), + ), + p2sh: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_p2sh_output"), + ), + p2tr: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_p2tr_output"), + ), + p2wpkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_p2wpkh_output"), + ), + p2wsh: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_p2wsh_output"), + ), + unknown: AverageBlockCumulativeSumPattern::new( + client.clone(), + _m(&acc, "with_unknown_outputs_output"), + ), } } } @@ -1159,18 +2494,36 @@ impl EmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - empty: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "empty_outputs_output")), - op_return: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "op_return_output")), + empty: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "empty_outputs_output"), + ), + op_return: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "op_return_output"), + ), p2a: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2a_output")), p2ms: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2ms_output")), - p2pk33: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2pk33_output")), - p2pk65: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2pk65_output")), + p2pk33: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "p2pk33_output"), + ), + p2pk65: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "p2pk65_output"), + ), p2pkh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2pkh_output")), p2sh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2sh_output")), p2tr: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2tr_output")), - p2wpkh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2wpkh_output")), + p2wpkh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "p2wpkh_output"), + ), p2wsh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2wsh_output")), - unknown: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "unknown_outputs_output")), + unknown: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "unknown_outputs_output"), + ), } } } @@ -1228,17 +2581,32 @@ impl EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - empty: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "empty_outputs_prevout")), + empty: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "empty_outputs_prevout"), + ), p2a: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2a_prevout")), p2ms: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2ms_prevout")), - p2pk33: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2pk33_prevout")), - p2pk65: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2pk65_prevout")), + p2pk33: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "p2pk33_prevout"), + ), + p2pk65: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "p2pk65_prevout"), + ), p2pkh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2pkh_prevout")), p2sh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2sh_prevout")), p2tr: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2tr_prevout")), - p2wpkh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2wpkh_prevout")), + p2wpkh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "p2wpkh_prevout"), + ), p2wsh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "p2wsh_prevout")), - unknown: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "unknown_outputs_prevout")), + unknown: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + _m(&acc, "unknown_outputs_prevout"), + ), } } } @@ -1490,8 +2858,14 @@ impl CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - capitalized_cap_in_loss_raw: SeriesPattern18::new(client.clone(), _m(&acc, "capitalized_cap_in_loss_raw")), - capitalized_cap_in_profit_raw: SeriesPattern18::new(client.clone(), _m(&acc, "capitalized_cap_in_profit_raw")), + capitalized_cap_in_loss_raw: SeriesPattern18::new( + client.clone(), + _m(&acc, "capitalized_cap_in_loss_raw"), + ), + capitalized_cap_in_profit_raw: SeriesPattern18::new( + client.clone(), + _m(&acc, "capitalized_cap_in_profit_raw"), + ), gross_pnl: CentsUsdPattern3::new(client.clone(), _m(&acc, "unrealized_gross_pnl")), invested_capital: InPattern2::new(client.clone(), _m(&acc, "invested_capital_in")), loss: CentsNegativeToUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss")), @@ -1624,7 +2998,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()), @@ -1776,7 +3153,10 @@ impl AverageBlockCumulativeInSumPattern { block: BtcCentsSatsUsdPattern3::new(client.clone(), acc.clone()), cumulative: BtcCentsSatsUsdPattern::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")), } } @@ -1823,7 +3203,10 @@ impl CentsNegativeToUsdPattern2 { cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), negative: SeriesPattern1::new(client.clone(), _m(&acc, "neg")), to_mcap: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "to_mcap")), - to_own_gross_pnl: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "to_own_gross_pnl")), + to_own_gross_pnl: BpsPercentRatioPattern2::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()), } @@ -1936,7 +3319,10 @@ impl ActiveBidirectionalReactivatedReceivingSendingPattern { pub fn new(client: Arc, acc: String) -> Self { Self { active: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "active_addrs")), - bidirectional: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "bidirectional_addrs")), + bidirectional: _1m1w1y24hBlockPattern::new( + client.clone(), + _m(&acc, "bidirectional_addrs"), + ), reactivated: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "reactivated_addrs")), receiving: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "receiving_addrs")), sending: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "sending_addrs")), @@ -2135,7 +3521,10 @@ impl CentsToUsdPattern4 { Self { cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), to_mcap: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "to_mcap")), - to_own_gross_pnl: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "to_own_gross_pnl")), + to_own_gross_pnl: BpsPercentRatioPattern2::new( + client.clone(), + _m(&acc, "to_own_gross_pnl"), + ), to_own_mcap: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "to_own_mcap")), usd: SeriesPattern1::new(client.clone(), acc.clone()), } @@ -2514,7 +3903,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()), } @@ -2533,10 +3925,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"), + ), } } } @@ -2574,9 +3975,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(), + ), } } } @@ -2634,7 +4043,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"), + ), } } } @@ -2668,7 +4080,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")), } @@ -2722,9 +4137,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)), + ), } } } @@ -2856,7 +4277,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")), } } @@ -2928,8 +4352,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"), + ), } } } @@ -2946,8 +4376,14 @@ impl RsiStochPattern { pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { rsi: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, &disc)), - stoch_rsi_d: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, &format!("stoch_d_{disc}", disc=disc))), - stoch_rsi_k: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, &format!("stoch_k_{disc}", disc=disc))), + stoch_rsi_d: BpsPercentRatioPattern2::new( + client.clone(), + _m(&acc, &format!("stoch_d_{disc}", disc = disc)), + ), + stoch_rsi_k: BpsPercentRatioPattern2::new( + client.clone(), + _m(&acc, &format!("stoch_k_{disc}", disc = disc)), + ), } } } @@ -2964,7 +4400,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")), } } @@ -3079,7 +4518,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)), + ), } } } @@ -3142,7 +4584,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: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "dominance")), } } @@ -3270,8 +4715,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"), + ), } } } @@ -3286,8 +4737,14 @@ impl FundedTotalPattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - funded: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new(client.clone(), acc.clone()), - total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new(client.clone(), _p("total", &acc)), + funded: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new( + client.clone(), + acc.clone(), + ), + total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new( + client.clone(), + _p("total", &acc), + ), } } } @@ -3351,7 +4808,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)), + ), } } } @@ -3367,7 +4827,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"), + ), } } } @@ -3491,7 +4954,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")), @@ -3500,7 +4966,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")), @@ -3535,18 +5004,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")), } } @@ -3567,9 +5054,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()), } } @@ -3631,7 +5124,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(), + ), } } } @@ -3805,8 +5301,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"), + ), } } } @@ -3833,9 +5335,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(), + ), } } } @@ -3848,7 +5356,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(), + ), } } } @@ -3863,7 +5374,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"), + ), } } } @@ -3879,8 +5393,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(), + ), } } } @@ -3901,7 +5421,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: SeriesPattern19::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(), + ), } } } @@ -3932,7 +5455,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()), } } @@ -4006,10 +5532,22 @@ pub struct SeriesTree_Inputs_ByType { impl SeriesTree_Inputs_ByType { pub fn new(client: Arc, base_path: String) -> Self { Self { - input_count: SeriesTree_Inputs_ByType_InputCount::new(client.clone(), format!("{base_path}_input_count")), - input_share: SeriesTree_Inputs_ByType_InputShare::new(client.clone(), format!("{base_path}_input_share")), - tx_count: SeriesTree_Inputs_ByType_TxCount::new(client.clone(), format!("{base_path}_tx_count")), - tx_share: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2::new(client.clone(), "tx_share_with".to_string()), + input_count: SeriesTree_Inputs_ByType_InputCount::new( + client.clone(), + format!("{base_path}_input_count"), + ), + input_share: SeriesTree_Inputs_ByType_InputShare::new( + client.clone(), + format!("{base_path}_input_share"), + ), + tx_count: SeriesTree_Inputs_ByType_TxCount::new( + client.clone(), + format!("{base_path}_tx_count"), + ), + tx_share: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2::new( + client.clone(), + "tx_share_with".to_string(), + ), } } } @@ -4033,18 +5571,54 @@ pub struct SeriesTree_Inputs_ByType_InputCount { impl SeriesTree_Inputs_ByType_InputCount { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: AverageBlockCumulativeSumPattern::new(client.clone(), "input_count_bis".to_string()), - p2pk65: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk65_prevout_count".to_string()), - p2pk33: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk33_prevout_count".to_string()), - p2pkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pkh_prevout_count".to_string()), - p2ms: AverageBlockCumulativeSumPattern::new(client.clone(), "p2ms_prevout_count".to_string()), - p2sh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2sh_prevout_count".to_string()), - p2wpkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wpkh_prevout_count".to_string()), - p2wsh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wsh_prevout_count".to_string()), - p2tr: AverageBlockCumulativeSumPattern::new(client.clone(), "p2tr_prevout_count".to_string()), - p2a: AverageBlockCumulativeSumPattern::new(client.clone(), "p2a_prevout_count".to_string()), - unknown: AverageBlockCumulativeSumPattern::new(client.clone(), "unknown_outputs_prevout_count".to_string()), - empty: AverageBlockCumulativeSumPattern::new(client.clone(), "empty_outputs_prevout_count".to_string()), + all: AverageBlockCumulativeSumPattern::new( + client.clone(), + "input_count_bis".to_string(), + ), + p2pk65: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pk65_prevout_count".to_string(), + ), + p2pk33: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pk33_prevout_count".to_string(), + ), + p2pkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pkh_prevout_count".to_string(), + ), + p2ms: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2ms_prevout_count".to_string(), + ), + p2sh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2sh_prevout_count".to_string(), + ), + p2wpkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2wpkh_prevout_count".to_string(), + ), + p2wsh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2wsh_prevout_count".to_string(), + ), + p2tr: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2tr_prevout_count".to_string(), + ), + p2a: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2a_prevout_count".to_string(), + ), + unknown: AverageBlockCumulativeSumPattern::new( + client.clone(), + "unknown_outputs_prevout_count".to_string(), + ), + empty: AverageBlockCumulativeSumPattern::new( + client.clone(), + "empty_outputs_prevout_count".to_string(), + ), } } } @@ -4067,17 +5641,50 @@ pub struct SeriesTree_Inputs_ByType_InputShare { impl SeriesTree_Inputs_ByType_InputShare { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2pk65: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2pk65_prevout_share".to_string()), - p2pk33: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2pk33_prevout_share".to_string()), - p2pkh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2pkh_prevout_share".to_string()), - p2ms: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2ms_prevout_share".to_string()), - p2sh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2sh_prevout_share".to_string()), - p2wpkh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2wpkh_prevout_share".to_string()), - p2wsh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2wsh_prevout_share".to_string()), - p2tr: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2tr_prevout_share".to_string()), - p2a: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2a_prevout_share".to_string()), - unknown: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "unknown_outputs_prevout_share".to_string()), - empty: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "empty_outputs_prevout_share".to_string()), + p2pk65: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2pk65_prevout_share".to_string(), + ), + p2pk33: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2pk33_prevout_share".to_string(), + ), + p2pkh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2pkh_prevout_share".to_string(), + ), + p2ms: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2ms_prevout_share".to_string(), + ), + p2sh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2sh_prevout_share".to_string(), + ), + p2wpkh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2wpkh_prevout_share".to_string(), + ), + p2wsh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2wsh_prevout_share".to_string(), + ), + p2tr: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2tr_prevout_share".to_string(), + ), + p2a: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2a_prevout_share".to_string(), + ), + unknown: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "unknown_outputs_prevout_share".to_string(), + ), + empty: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "empty_outputs_prevout_share".to_string(), + ), } } } @@ -4101,18 +5708,54 @@ pub struct SeriesTree_Inputs_ByType_TxCount { impl SeriesTree_Inputs_ByType_TxCount { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: AverageBlockCumulativeSumPattern::new(client.clone(), "non_coinbase_tx_count".to_string()), - p2pk65: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2pk65_prevout".to_string()), - p2pk33: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2pk33_prevout".to_string()), - p2pkh: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2pkh_prevout".to_string()), - p2ms: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2ms_prevout".to_string()), - p2sh: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2sh_prevout".to_string()), - p2wpkh: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2wpkh_prevout".to_string()), - p2wsh: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2wsh_prevout".to_string()), - p2tr: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2tr_prevout".to_string()), - p2a: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_p2a_prevout".to_string()), - unknown: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_unknown_outputs_prevout".to_string()), - empty: AverageBlockCumulativeSumPattern::new(client.clone(), "tx_count_with_empty_outputs_prevout".to_string()), + all: AverageBlockCumulativeSumPattern::new( + client.clone(), + "non_coinbase_tx_count".to_string(), + ), + p2pk65: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2pk65_prevout".to_string(), + ), + p2pk33: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2pk33_prevout".to_string(), + ), + p2pkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2pkh_prevout".to_string(), + ), + p2ms: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2ms_prevout".to_string(), + ), + p2sh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2sh_prevout".to_string(), + ), + p2wpkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2wpkh_prevout".to_string(), + ), + p2wsh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2wsh_prevout".to_string(), + ), + p2tr: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2tr_prevout".to_string(), + ), + p2a: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_p2a_prevout".to_string(), + ), + unknown: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_unknown_outputs_prevout".to_string(), + ), + empty: AverageBlockCumulativeSumPattern::new( + client.clone(), + "tx_count_with_empty_outputs_prevout".to_string(), + ), } } } @@ -4135,7 +5778,10 @@ impl SeriesTree_Outputs { spent: SeriesTree_Outputs_Spent::new(client.clone(), format!("{base_path}_spent")), count: SeriesTree_Outputs_Count::new(client.clone(), format!("{base_path}_count")), per_sec: _1m1w1y24hPattern::new(client.clone(), "outputs_per_sec".to_string()), - unspent: SeriesTree_Outputs_Unspent::new(client.clone(), format!("{base_path}_unspent")), + unspent: SeriesTree_Outputs_Unspent::new( + client.clone(), + format!("{base_path}_unspent"), + ), by_type: SeriesTree_Outputs_ByType::new(client.clone(), format!("{base_path}_by_type")), value: SeriesTree_Outputs_Value::new(client.clone(), format!("{base_path}_value")), } @@ -4154,7 +5800,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()), @@ -4214,11 +5863,26 @@ pub struct SeriesTree_Outputs_ByType { impl SeriesTree_Outputs_ByType { pub fn new(client: Arc, base_path: String) -> Self { Self { - output_count: SeriesTree_Outputs_ByType_OutputCount::new(client.clone(), format!("{base_path}_output_count")), - spendable_output_count: AverageBlockCumulativeSumPattern::new(client.clone(), "spendable_output_count".to_string()), - output_share: SeriesTree_Outputs_ByType_OutputShare::new(client.clone(), format!("{base_path}_output_share")), - tx_count: AllEmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern::new(client.clone(), "tx_count".to_string()), - tx_share: EmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2::new(client.clone(), "tx_share_with".to_string()), + output_count: SeriesTree_Outputs_ByType_OutputCount::new( + client.clone(), + format!("{base_path}_output_count"), + ), + spendable_output_count: AverageBlockCumulativeSumPattern::new( + client.clone(), + "spendable_output_count".to_string(), + ), + output_share: SeriesTree_Outputs_ByType_OutputShare::new( + client.clone(), + format!("{base_path}_output_share"), + ), + tx_count: AllEmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern::new( + client.clone(), + "tx_count".to_string(), + ), + tx_share: EmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2::new( + client.clone(), + "tx_share_with".to_string(), + ), } } } @@ -4243,19 +5907,58 @@ pub struct SeriesTree_Outputs_ByType_OutputCount { impl SeriesTree_Outputs_ByType_OutputCount { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: AverageBlockCumulativeSumPattern::new(client.clone(), "output_count_bis".to_string()), - p2pk65: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk65_output_count".to_string()), - p2pk33: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk33_output_count".to_string()), - p2pkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pkh_output_count".to_string()), - p2ms: AverageBlockCumulativeSumPattern::new(client.clone(), "p2ms_output_count".to_string()), - p2sh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2sh_output_count".to_string()), - p2wpkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wpkh_output_count".to_string()), - p2wsh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wsh_output_count".to_string()), - p2tr: AverageBlockCumulativeSumPattern::new(client.clone(), "p2tr_output_count".to_string()), - p2a: AverageBlockCumulativeSumPattern::new(client.clone(), "p2a_output_count".to_string()), - unknown: AverageBlockCumulativeSumPattern::new(client.clone(), "unknown_outputs_output_count".to_string()), - empty: AverageBlockCumulativeSumPattern::new(client.clone(), "empty_outputs_output_count".to_string()), - op_return: AverageBlockCumulativeSumPattern::new(client.clone(), "op_return_output_count".to_string()), + all: AverageBlockCumulativeSumPattern::new( + client.clone(), + "output_count_bis".to_string(), + ), + p2pk65: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pk65_output_count".to_string(), + ), + p2pk33: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pk33_output_count".to_string(), + ), + p2pkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2pkh_output_count".to_string(), + ), + p2ms: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2ms_output_count".to_string(), + ), + p2sh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2sh_output_count".to_string(), + ), + p2wpkh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2wpkh_output_count".to_string(), + ), + p2wsh: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2wsh_output_count".to_string(), + ), + p2tr: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2tr_output_count".to_string(), + ), + p2a: AverageBlockCumulativeSumPattern::new( + client.clone(), + "p2a_output_count".to_string(), + ), + unknown: AverageBlockCumulativeSumPattern::new( + client.clone(), + "unknown_outputs_output_count".to_string(), + ), + empty: AverageBlockCumulativeSumPattern::new( + client.clone(), + "empty_outputs_output_count".to_string(), + ), + op_return: AverageBlockCumulativeSumPattern::new( + client.clone(), + "op_return_output_count".to_string(), + ), } } } @@ -4279,18 +5982,54 @@ pub struct SeriesTree_Outputs_ByType_OutputShare { impl SeriesTree_Outputs_ByType_OutputShare { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2pk65: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2pk65_output_share".to_string()), - p2pk33: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2pk33_output_share".to_string()), - p2pkh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2pkh_output_share".to_string()), - p2ms: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2ms_output_share".to_string()), - p2sh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2sh_output_share".to_string()), - p2wpkh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2wpkh_output_share".to_string()), - p2wsh: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2wsh_output_share".to_string()), - p2tr: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2tr_output_share".to_string()), - p2a: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "p2a_output_share".to_string()), - unknown: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "unknown_outputs_output_share".to_string()), - empty: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "empty_outputs_output_share".to_string()), - op_return: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "op_return_output_share".to_string()), + p2pk65: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2pk65_output_share".to_string(), + ), + p2pk33: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2pk33_output_share".to_string(), + ), + p2pkh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2pkh_output_share".to_string(), + ), + p2ms: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2ms_output_share".to_string(), + ), + p2sh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2sh_output_share".to_string(), + ), + p2wpkh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2wpkh_output_share".to_string(), + ), + p2wsh: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2wsh_output_share".to_string(), + ), + p2tr: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2tr_output_share".to_string(), + ), + p2a: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "p2a_output_share".to_string(), + ), + unknown: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "unknown_outputs_output_share".to_string(), + ), + empty: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "empty_outputs_output_share".to_string(), + ), + op_return: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "op_return_output_share".to_string(), + ), } } } @@ -4331,16 +6070,34 @@ 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: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new(client.clone(), "addr_count".to_string()), - empty: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new(client.clone(), "empty_addr_count".to_string()), - activity: SeriesTree_Addrs_Activity::new(client.clone(), format!("{base_path}_activity")), - total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new(client.clone(), "total_addr_count".to_string()), - new: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new(client.clone(), "new_addr_count".to_string()), + funded: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new( + client.clone(), + "addr_count".to_string(), + ), + empty: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new( + client.clone(), + "empty_addr_count".to_string(), + ), + activity: SeriesTree_Addrs_Activity::new( + client.clone(), + format!("{base_path}_activity"), + ), + total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4::new( + client.clone(), + "total_addr_count".to_string(), + ), + new: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new( + client.clone(), + "new_addr_count".to_string(), + ), reused: SeriesTree_Addrs_Reused::new(client.clone(), format!("{base_path}_reused")), respent: SeriesTree_Addrs_Respent::new(client.clone(), format!("{base_path}_respent")), exposed: SeriesTree_Addrs_Exposed::new(client.clone(), format!("{base_path}_exposed")), delta: SeriesTree_Addrs_Delta::new(client.clone(), format!("{base_path}_delta")), - avg_amount: SeriesTree_Addrs_AvgAmount::new(client.clone(), format!("{base_path}_avg_amount")), + avg_amount: SeriesTree_Addrs_AvgAmount::new( + client.clone(), + format!("{base_path}_avg_amount"), + ), } } } @@ -4381,7 +6138,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()), } } @@ -4396,7 +6156,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()), } } @@ -4441,7 +6204,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()), } } @@ -4555,14 +6321,38 @@ impl SeriesTree_Addrs_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { all: SeriesTree_Addrs_Activity_All::new(client.clone(), format!("{base_path}_all")), - p2pk65: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2pk65".to_string()), - p2pk33: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2pk33".to_string()), - p2pkh: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2pkh".to_string()), - p2sh: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2sh".to_string()), - p2wpkh: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2wpkh".to_string()), - p2wsh: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2wsh".to_string()), - p2tr: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2tr".to_string()), - p2a: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2a".to_string()), + p2pk65: ActiveBidirectionalReactivatedReceivingSendingPattern::new( + client.clone(), + "p2pk65".to_string(), + ), + p2pk33: ActiveBidirectionalReactivatedReceivingSendingPattern::new( + client.clone(), + "p2pk33".to_string(), + ), + p2pkh: ActiveBidirectionalReactivatedReceivingSendingPattern::new( + client.clone(), + "p2pkh".to_string(), + ), + p2sh: ActiveBidirectionalReactivatedReceivingSendingPattern::new( + client.clone(), + "p2sh".to_string(), + ), + p2wpkh: ActiveBidirectionalReactivatedReceivingSendingPattern::new( + client.clone(), + "p2wpkh".to_string(), + ), + p2wsh: ActiveBidirectionalReactivatedReceivingSendingPattern::new( + client.clone(), + "p2wsh".to_string(), + ), + p2tr: ActiveBidirectionalReactivatedReceivingSendingPattern::new( + client.clone(), + "p2tr".to_string(), + ), + p2a: ActiveBidirectionalReactivatedReceivingSendingPattern::new( + client.clone(), + "p2a".to_string(), + ), } } } @@ -4579,10 +6369,16 @@ pub struct SeriesTree_Addrs_Activity_All { impl SeriesTree_Addrs_Activity_All { pub fn new(client: Arc, base_path: String) -> Self { Self { - reactivated: _1m1w1y24hBlockPattern::new(client.clone(), "reactivated_addrs".to_string()), + reactivated: _1m1w1y24hBlockPattern::new( + client.clone(), + "reactivated_addrs".to_string(), + ), sending: _1m1w1y24hBlockPattern::new(client.clone(), "sending_addrs".to_string()), receiving: _1m1w1y24hBlockPattern::new(client.clone(), "receiving_addrs".to_string()), - bidirectional: _1m1w1y24hBlockPattern::new(client.clone(), "bidirectional_addrs".to_string()), + bidirectional: _1m1w1y24hBlockPattern::new( + client.clone(), + "bidirectional_addrs".to_string(), + ), active: _1m1w1y24hBlockPattern::new(client.clone(), "active_addrs".to_string()), } } @@ -4599,8 +6395,14 @@ impl SeriesTree_Addrs_Reused { pub fn new(client: Arc, base_path: String) -> Self { Self { count: FundedTotalPattern::new(client.clone(), "reused_addr_count".to_string()), - events: SeriesTree_Addrs_Reused_Events::new(client.clone(), format!("{base_path}_events")), - supply: SeriesTree_Addrs_Reused_Supply::new(client.clone(), format!("{base_path}_supply")), + events: SeriesTree_Addrs_Reused_Events::new( + client.clone(), + format!("{base_path}_events"), + ), + supply: SeriesTree_Addrs_Reused_Supply::new( + client.clone(), + format!("{base_path}_supply"), + ), } } } @@ -4619,13 +6421,34 @@ pub struct SeriesTree_Addrs_Reused_Events { impl SeriesTree_Addrs_Reused_Events { pub fn new(client: Arc, base_path: String) -> Self { Self { - output_to_reused_addr_count: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new(client.clone(), "output_to_reused_addr_count".to_string()), - output_to_reused_addr_share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7::new(client.clone(), "output_to_reused_addr_share".to_string()), - spendable_output_to_reused_addr_share: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "spendable_output_to_reused_addr_share".to_string()), - input_from_reused_addr_count: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new(client.clone(), "input_from_reused_addr_count".to_string()), - input_from_reused_addr_share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7::new(client.clone(), "input_from_reused_addr_share".to_string()), - active_reused_addr_count: _1m1w1y24hBlockPattern::new(client.clone(), "active_reused_addr_count".to_string()), - active_reused_addr_share: _1m1w1y24hBlockPattern2::new(client.clone(), "active_reused_addr_share".to_string()), + output_to_reused_addr_count: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new( + client.clone(), + "output_to_reused_addr_count".to_string(), + ), + output_to_reused_addr_share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7::new( + client.clone(), + "output_to_reused_addr_share".to_string(), + ), + spendable_output_to_reused_addr_share: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "spendable_output_to_reused_addr_share".to_string(), + ), + input_from_reused_addr_count: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new( + client.clone(), + "input_from_reused_addr_count".to_string(), + ), + input_from_reused_addr_share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7::new( + client.clone(), + "input_from_reused_addr_share".to_string(), + ), + active_reused_addr_count: _1m1w1y24hBlockPattern::new( + client.clone(), + "active_reused_addr_count".to_string(), + ), + active_reused_addr_share: _1m1w1y24hBlockPattern2::new( + client.clone(), + "active_reused_addr_share".to_string(), + ), } } } @@ -4648,15 +6471,39 @@ impl SeriesTree_Addrs_Reused_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { all: BtcCentsSatsUsdPattern::new(client.clone(), "reused_addr_supply".to_string()), - p2pk65: BtcCentsSatsUsdPattern::new(client.clone(), "p2pk65_reused_addr_supply".to_string()), - p2pk33: BtcCentsSatsUsdPattern::new(client.clone(), "p2pk33_reused_addr_supply".to_string()), - p2pkh: BtcCentsSatsUsdPattern::new(client.clone(), "p2pkh_reused_addr_supply".to_string()), - p2sh: BtcCentsSatsUsdPattern::new(client.clone(), "p2sh_reused_addr_supply".to_string()), - p2wpkh: BtcCentsSatsUsdPattern::new(client.clone(), "p2wpkh_reused_addr_supply".to_string()), - p2wsh: BtcCentsSatsUsdPattern::new(client.clone(), "p2wsh_reused_addr_supply".to_string()), - p2tr: BtcCentsSatsUsdPattern::new(client.clone(), "p2tr_reused_addr_supply".to_string()), + p2pk65: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pk65_reused_addr_supply".to_string(), + ), + p2pk33: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pk33_reused_addr_supply".to_string(), + ), + p2pkh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pkh_reused_addr_supply".to_string(), + ), + p2sh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2sh_reused_addr_supply".to_string(), + ), + p2wpkh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2wpkh_reused_addr_supply".to_string(), + ), + p2wsh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2wsh_reused_addr_supply".to_string(), + ), + p2tr: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2tr_reused_addr_supply".to_string(), + ), p2a: BtcCentsSatsUsdPattern::new(client.clone(), "p2a_reused_addr_supply".to_string()), - share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5::new(client.clone(), "reused_addr_supply_share".to_string()), + share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5::new( + client.clone(), + "reused_addr_supply_share".to_string(), + ), } } } @@ -4672,8 +6519,14 @@ impl SeriesTree_Addrs_Respent { pub fn new(client: Arc, base_path: String) -> Self { Self { count: FundedTotalPattern::new(client.clone(), "respent_addr_count".to_string()), - events: SeriesTree_Addrs_Respent_Events::new(client.clone(), format!("{base_path}_events")), - supply: SeriesTree_Addrs_Respent_Supply::new(client.clone(), format!("{base_path}_supply")), + events: SeriesTree_Addrs_Respent_Events::new( + client.clone(), + format!("{base_path}_events"), + ), + supply: SeriesTree_Addrs_Respent_Supply::new( + client.clone(), + format!("{base_path}_supply"), + ), } } } @@ -4692,13 +6545,34 @@ pub struct SeriesTree_Addrs_Respent_Events { impl SeriesTree_Addrs_Respent_Events { pub fn new(client: Arc, base_path: String) -> Self { Self { - output_to_reused_addr_count: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new(client.clone(), "output_to_respent_addr_count".to_string()), - output_to_reused_addr_share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7::new(client.clone(), "output_to_respent_addr_share".to_string()), - spendable_output_to_reused_addr_share: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "spendable_output_to_respent_addr_share".to_string()), - input_from_reused_addr_count: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new(client.clone(), "input_from_respent_addr_count".to_string()), - input_from_reused_addr_share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7::new(client.clone(), "input_from_respent_addr_share".to_string()), - active_reused_addr_count: _1m1w1y24hBlockPattern::new(client.clone(), "active_respent_addr_count".to_string()), - active_reused_addr_share: _1m1w1y24hBlockPattern2::new(client.clone(), "active_respent_addr_share".to_string()), + output_to_reused_addr_count: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new( + client.clone(), + "output_to_respent_addr_count".to_string(), + ), + output_to_reused_addr_share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7::new( + client.clone(), + "output_to_respent_addr_share".to_string(), + ), + spendable_output_to_reused_addr_share: _1m1w1y24hBpsPercentRatioPattern::new( + client.clone(), + "spendable_output_to_respent_addr_share".to_string(), + ), + input_from_reused_addr_count: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6::new( + client.clone(), + "input_from_respent_addr_count".to_string(), + ), + input_from_reused_addr_share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7::new( + client.clone(), + "input_from_respent_addr_share".to_string(), + ), + active_reused_addr_count: _1m1w1y24hBlockPattern::new( + client.clone(), + "active_respent_addr_count".to_string(), + ), + active_reused_addr_share: _1m1w1y24hBlockPattern2::new( + client.clone(), + "active_respent_addr_share".to_string(), + ), } } } @@ -4721,15 +6595,39 @@ impl SeriesTree_Addrs_Respent_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { all: BtcCentsSatsUsdPattern::new(client.clone(), "respent_addr_supply".to_string()), - p2pk65: BtcCentsSatsUsdPattern::new(client.clone(), "p2pk65_respent_addr_supply".to_string()), - p2pk33: BtcCentsSatsUsdPattern::new(client.clone(), "p2pk33_respent_addr_supply".to_string()), - p2pkh: BtcCentsSatsUsdPattern::new(client.clone(), "p2pkh_respent_addr_supply".to_string()), - p2sh: BtcCentsSatsUsdPattern::new(client.clone(), "p2sh_respent_addr_supply".to_string()), - p2wpkh: BtcCentsSatsUsdPattern::new(client.clone(), "p2wpkh_respent_addr_supply".to_string()), - p2wsh: BtcCentsSatsUsdPattern::new(client.clone(), "p2wsh_respent_addr_supply".to_string()), - p2tr: BtcCentsSatsUsdPattern::new(client.clone(), "p2tr_respent_addr_supply".to_string()), + p2pk65: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pk65_respent_addr_supply".to_string(), + ), + p2pk33: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pk33_respent_addr_supply".to_string(), + ), + p2pkh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pkh_respent_addr_supply".to_string(), + ), + p2sh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2sh_respent_addr_supply".to_string(), + ), + p2wpkh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2wpkh_respent_addr_supply".to_string(), + ), + p2wsh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2wsh_respent_addr_supply".to_string(), + ), + p2tr: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2tr_respent_addr_supply".to_string(), + ), p2a: BtcCentsSatsUsdPattern::new(client.clone(), "p2a_respent_addr_supply".to_string()), - share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5::new(client.clone(), "respent_addr_supply_share".to_string()), + share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5::new( + client.clone(), + "respent_addr_supply_share".to_string(), + ), } } } @@ -4744,7 +6642,10 @@ impl SeriesTree_Addrs_Exposed { pub fn new(client: Arc, base_path: String) -> Self { Self { count: FundedTotalPattern::new(client.clone(), "exposed_addr_count".to_string()), - supply: SeriesTree_Addrs_Exposed_Supply::new(client.clone(), format!("{base_path}_supply")), + supply: SeriesTree_Addrs_Exposed_Supply::new( + client.clone(), + format!("{base_path}_supply"), + ), } } } @@ -4767,15 +6668,39 @@ impl SeriesTree_Addrs_Exposed_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { all: BtcCentsSatsUsdPattern::new(client.clone(), "exposed_addr_supply".to_string()), - p2pk65: BtcCentsSatsUsdPattern::new(client.clone(), "p2pk65_exposed_addr_supply".to_string()), - p2pk33: BtcCentsSatsUsdPattern::new(client.clone(), "p2pk33_exposed_addr_supply".to_string()), - p2pkh: BtcCentsSatsUsdPattern::new(client.clone(), "p2pkh_exposed_addr_supply".to_string()), - p2sh: BtcCentsSatsUsdPattern::new(client.clone(), "p2sh_exposed_addr_supply".to_string()), - p2wpkh: BtcCentsSatsUsdPattern::new(client.clone(), "p2wpkh_exposed_addr_supply".to_string()), - p2wsh: BtcCentsSatsUsdPattern::new(client.clone(), "p2wsh_exposed_addr_supply".to_string()), - p2tr: BtcCentsSatsUsdPattern::new(client.clone(), "p2tr_exposed_addr_supply".to_string()), + p2pk65: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pk65_exposed_addr_supply".to_string(), + ), + p2pk33: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pk33_exposed_addr_supply".to_string(), + ), + p2pkh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2pkh_exposed_addr_supply".to_string(), + ), + p2sh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2sh_exposed_addr_supply".to_string(), + ), + p2wpkh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2wpkh_exposed_addr_supply".to_string(), + ), + p2wsh: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2wsh_exposed_addr_supply".to_string(), + ), + p2tr: BtcCentsSatsUsdPattern::new( + client.clone(), + "p2tr_exposed_addr_supply".to_string(), + ), p2a: BtcCentsSatsUsdPattern::new(client.clone(), "p2a_exposed_addr_supply".to_string()), - share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5::new(client.clone(), "exposed_addr_supply_share".to_string()), + share: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5::new( + client.clone(), + "exposed_addr_supply_share".to_string(), + ), } } } @@ -4863,9 +6788,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"), + ), } } } @@ -4879,7 +6810,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()), } } @@ -4909,7 +6843,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()), } } @@ -4924,7 +6861,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()), } } @@ -4940,7 +6880,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"), + ), } } } @@ -4957,8 +6900,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()), @@ -4979,10 +6928,16 @@ impl SeriesTree_Mining_Rewards_Subsidy { pub fn new(client: Arc, base_path: String) -> Self { Self { block: BtcCentsSatsUsdPattern3::new(client.clone(), "subsidy".to_string()), - cumulative: BtcCentsSatsUsdPattern::new(client.clone(), "subsidy_cumulative".to_string()), + cumulative: BtcCentsSatsUsdPattern::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(), + ), } } } @@ -5018,8 +6973,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"), + ), } } } @@ -5072,9 +7033,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(), + ), } } } @@ -5112,13 +7079,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"), + ), } } } @@ -5136,12 +7112,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(), + ), } } } @@ -5172,9 +7157,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()), } } @@ -5214,10 +7208,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(), + ), } } } @@ -5232,9 +7238,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(), + ), } } } @@ -5334,9 +7349,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")), @@ -5348,10 +7372,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"), + ), } } } @@ -5375,18 +7411,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"), + ), } } } @@ -5897,13 +7948,28 @@ impl SeriesTree_Indicators { nvt: BpsRatioPattern2::new(client.clone(), "nvt".to_string()), gini: BpsPercentRatioPattern2::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_adj: SeriesPattern1::new(client.clone(), "coindays_destroyed_supply_adj".to_string()), - coinyears_destroyed_supply_adj: SeriesPattern1::new(client.clone(), "coinyears_destroyed_supply_adj".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_adj: SeriesPattern1::new( + client.clone(), + "coindays_destroyed_supply_adj".to_string(), + ), + coinyears_destroyed_supply_adj: SeriesPattern1::new( + client.clone(), + "coinyears_destroyed_supply_adj".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()), - rarity_meter: SeriesTree_Indicators_RarityMeter::new(client.clone(), format!("{base_path}_rarity_meter")), + rarity_meter: SeriesTree_Indicators_RarityMeter::new( + client.clone(), + format!("{base_path}_rarity_meter"), + ), } } } @@ -5933,9 +7999,18 @@ pub struct SeriesTree_Indicators_RarityMeter { impl SeriesTree_Indicators_RarityMeter { pub fn new(client: Arc, base_path: String) -> Self { Self { - full: IndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern::new(client.clone(), "rarity_meter".to_string()), - local: IndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern::new(client.clone(), "local_rarity_meter".to_string()), - cycle: IndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern::new(client.clone(), "cycle_rarity_meter".to_string()), + full: IndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern::new( + client.clone(), + "rarity_meter".to_string(), + ), + local: IndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern::new( + client.clone(), + "local_rarity_meter".to_string(), + ), + cycle: IndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern::new( + client.clone(), + "cycle_rarity_meter".to_string(), + ), } } } @@ -5970,12 +8045,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(), + ), } } } @@ -6025,9 +8115,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"), + ), } } } @@ -6051,18 +8150,54 @@ pub struct SeriesTree_Investing_Class_DcaStack { impl SeriesTree_Investing_Class_DcaStack { pub fn new(client: Arc, base_path: String) -> Self { Self { - from_2015: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2015".to_string()), - from_2016: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2016".to_string()), - from_2017: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2017".to_string()), - from_2018: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2018".to_string()), - from_2019: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2019".to_string()), - from_2020: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2020".to_string()), - from_2021: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2021".to_string()), - from_2022: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2022".to_string()), - from_2023: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2023".to_string()), - from_2024: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2024".to_string()), - from_2025: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2025".to_string()), - from_2026: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2026".to_string()), + from_2015: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2015".to_string(), + ), + from_2016: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2016".to_string(), + ), + from_2017: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2017".to_string(), + ), + from_2018: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2018".to_string(), + ), + from_2019: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2019".to_string(), + ), + from_2020: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2020".to_string(), + ), + from_2021: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2021".to_string(), + ), + from_2022: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2022".to_string(), + ), + from_2023: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2023".to_string(), + ), + from_2024: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2024".to_string(), + ), + from_2025: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2025".to_string(), + ), + from_2026: BtcCentsSatsUsdPattern::new( + client.clone(), + "dca_stack_from_2026".to_string(), + ), } } } @@ -6086,18 +8221,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(), + ), } } } @@ -6121,18 +8292,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(), + ), } } } @@ -6152,12 +8359,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"), + ), } } } @@ -6179,8 +8395,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(), + ), } } } @@ -6232,9 +8454,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"), + ), } } } @@ -6287,7 +8515,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")), @@ -6370,8 +8601,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: BpsPercentRatioPattern2::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: BpsPercentRatioPattern2::new( + client.clone(), + "price_choppiness_index_2w".to_string(), + ), } } } @@ -6385,8 +8622,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"), + ), } } } @@ -6424,8 +8667,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()), @@ -6537,7 +8786,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"), + ), } } } @@ -6569,9 +8821,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"), + ), } } } @@ -6692,16 +8953,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()), @@ -6855,6 +9128,7 @@ pub struct SeriesTree_Pools_Minor { pub est3lar: BlocksDominancePattern, pub braiinssolo: BlocksDominancePattern, pub solopool: BlocksDominancePattern, + pub noderunners: BlocksDominancePattern, } impl SeriesTree_Pools_Minor { @@ -6904,7 +9178,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()), @@ -6927,7 +9204,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()), @@ -6940,8 +9220,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()), @@ -6958,25 +9244,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()), @@ -6984,8 +9285,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()), @@ -7002,6 +9309,7 @@ impl SeriesTree_Pools_Minor { est3lar: BlocksDominancePattern::new(client.clone(), "est3lar".to_string()), braiinssolo: BlocksDominancePattern::new(client.clone(), "braiinssolo".to_string()), solopool: BlocksDominancePattern::new(client.clone(), "solopool".to_string()), + noderunners: BlocksDominancePattern::new(client.clone(), "noderunners".to_string()), } } } @@ -7092,13 +9400,28 @@ impl SeriesTree_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { state: SeriesPattern18::new(client.clone(), "supply_state".to_string()), - circulating: BtcCentsSatsUsdPattern::new(client.clone(), "circulating_supply".to_string()), + circulating: BtcCentsSatsUsdPattern::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: BtcCentsSatsUsdPattern::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: BtcCentsSatsUsdPattern::new( + client.clone(), + "hodled_or_lost_supply".to_string(), + ), } } } @@ -7157,17 +9480,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"), + ), } } } @@ -7187,11 +9534,26 @@ impl SeriesTree_Cohorts_Utxo_All { pub fn new(client: Arc, base_path: String) -> Self { Self { supply: DeltaDominanceHalfInTotalPattern2::new(client.clone(), "supply".to_string()), - 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")), + 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"), + ), invested_capital: InPattern::new(client.clone(), "invested_capital_in".to_string()), } } @@ -7208,7 +9570,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()), } } @@ -7225,9 +9590,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()), } } @@ -7254,16 +9628,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: _1m1w1y24hPattern8::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: _1m1w1y24hPattern8::new( + client.clone(), + "sell_side_risk_ratio".to_string(), + ), + peak_regret: BlockCumulativeSumPattern::new( + client.clone(), + "realized_peak_regret".to_string(), + ), capitalized: PricePattern::new(client.clone(), "capitalized_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(), + ), } } } @@ -7288,9 +9683,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"), + ), } } } @@ -7306,10 +9707,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"), + ), } } } @@ -7339,18 +9752,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(), + ), } } } @@ -7378,20 +9839,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(), + ), } } } @@ -7419,20 +9931,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(), + ), } } } @@ -7460,20 +10023,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(), + ), } } } @@ -7488,9 +10102,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"), + ), } } } @@ -7506,8 +10126,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(), + ), } } } @@ -7554,14 +10180,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: InPattern2::new(client.clone(), "invested_capital_in".to_string()), - capitalized_cap_in_profit_raw: SeriesPattern18::new(client.clone(), "capitalized_cap_in_profit_raw".to_string()), - capitalized_cap_in_loss_raw: SeriesPattern18::new(client.clone(), "capitalized_cap_in_loss_raw".to_string()), - sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), + capitalized_cap_in_profit_raw: SeriesPattern18::new( + client.clone(), + "capitalized_cap_in_profit_raw".to_string(), + ), + capitalized_cap_in_loss_raw: SeriesPattern18::new( + client.clone(), + "capitalized_cap_in_loss_raw".to_string(), + ), + sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment::new( + client.clone(), + format!("{base_path}_sentiment"), + ), } } } @@ -7579,8 +10223,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: BpsPercentRatioPattern2::new(client.clone(), "unrealized_profit_to_mcap".to_string()), - to_own_gross_pnl: BpsPercentRatioPattern2::new(client.clone(), "unrealized_profit_to_own_gross_pnl".to_string()), + to_mcap: BpsPercentRatioPattern2::new( + client.clone(), + "unrealized_profit_to_mcap".to_string(), + ), + to_own_gross_pnl: BpsPercentRatioPattern2::new( + client.clone(), + "unrealized_profit_to_own_gross_pnl".to_string(), + ), } } } @@ -7600,8 +10250,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: BpsPercentRatioPattern2::new(client.clone(), "unrealized_loss_to_mcap".to_string()), - to_own_gross_pnl: BpsPercentRatioPattern2::new(client.clone(), "unrealized_loss_to_own_gross_pnl".to_string()), + to_mcap: BpsPercentRatioPattern2::new( + client.clone(), + "unrealized_loss_to_mcap".to_string(), + ), + to_own_gross_pnl: BpsPercentRatioPattern2::new( + client.clone(), + "unrealized_loss_to_own_gross_pnl".to_string(), + ), } } } @@ -7618,7 +10274,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(), + ), } } } @@ -7654,12 +10313,24 @@ pub struct SeriesTree_Cohorts_Utxo_Sth { impl SeriesTree_Cohorts_Utxo_Sth { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply: DeltaDominanceHalfInTotalPattern2::new(client.clone(), "sth_supply".to_string()), + supply: DeltaDominanceHalfInTotalPattern2::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: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2::new(client.clone(), "sth".to_string()), + unrealized: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2::new( + client.clone(), + "sth".to_string(), + ), invested_capital: InPattern::new(client.clone(), "sth_invested_capital_in".to_string()), } } @@ -7685,17 +10356,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: _1m1w1y24hPattern8::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: _1m1w1y24hPattern8::new( + client.clone(), + "sth_sell_side_risk_ratio".to_string(), + ), + peak_regret: BlockCumulativeSumPattern::new( + client.clone(), + "sth_realized_peak_regret".to_string(), + ), capitalized: PricePattern::new(client.clone(), "sth_capitalized_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(), + ), } } } @@ -7720,9 +10415,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"), + ), } } } @@ -7738,10 +10442,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"), + ), } } } @@ -7769,20 +10485,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(), + ), } } } @@ -7810,20 +10577,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(), + ), } } } @@ -7851,20 +10669,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(), + ), } } } @@ -7892,20 +10761,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(), + ), } } } @@ -7924,12 +10844,24 @@ pub struct SeriesTree_Cohorts_Utxo_Lth { impl SeriesTree_Cohorts_Utxo_Lth { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply: DeltaDominanceHalfInTotalPattern2::new(client.clone(), "lth_supply".to_string()), + supply: DeltaDominanceHalfInTotalPattern2::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: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2::new(client.clone(), "lth".to_string()), + unrealized: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2::new( + client.clone(), + "lth".to_string(), + ), invested_capital: InPattern::new(client.clone(), "lth_invested_capital_in".to_string()), } } @@ -7955,17 +10887,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: _1m1w1y24hPattern8::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: _1m1w1y24hPattern8::new( + client.clone(), + "lth_sell_side_risk_ratio".to_string(), + ), + peak_regret: BlockCumulativeSumPattern::new( + client.clone(), + "lth_realized_peak_regret".to_string(), + ), capitalized: PricePattern::new(client.clone(), "lth_capitalized_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(), + ), } } } @@ -7990,9 +10949,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"), + ), } } } @@ -8008,10 +10976,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"), + ), } } } @@ -8039,20 +11019,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(), + ), } } } @@ -8080,20 +11111,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(), + ), } } } @@ -8121,20 +11203,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(), + ), } } } @@ -8162,20 +11295,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(), + ), } } } @@ -8189,7 +11373,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()), } } @@ -8223,27 +11410,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(), + ), } } } @@ -8273,24 +11523,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(), + ), } } } @@ -8320,24 +11624,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(), + ), } } } @@ -8354,11 +11712,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(), + ), } } } @@ -8388,24 +11761,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(), + ), } } } @@ -8430,19 +11857,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(), + ), } } } @@ -8469,21 +11935,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(), + ), } } } @@ -8508,19 +12019,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(), + ), } } } @@ -8543,17 +12093,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(), + ), } } } @@ -8568,9 +12151,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"), + ), } } } @@ -8607,31 +12199,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(), + ), } } } @@ -8657,20 +12324,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(), + ), } } } @@ -8691,15 +12400,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(), + ), } } } @@ -8732,27 +12468,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(), + ), } } } @@ -8767,9 +12566,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"), + ), } } } @@ -8794,19 +12602,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(), + ), } } } @@ -8833,21 +12680,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(), + ), } } } @@ -8872,19 +12764,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(), + ), } } } @@ -8929,20 +12860,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(), @@ -8978,10 +12915,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) } @@ -8993,10 +12940,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) } @@ -9009,7 +12966,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 @@ -9086,7 +13044,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 @@ -9118,8 +13077,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 @@ -9222,15 +13186,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) @@ -9264,9 +13248,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) } @@ -9279,8 +13271,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) } @@ -9299,13 +13297,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) @@ -9319,13 +13337,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) @@ -9340,7 +13378,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 @@ -9349,7 +13388,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 @@ -9358,7 +13398,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 @@ -9429,7 +13470,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 @@ -9440,7 +13482,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 @@ -9494,8 +13537,14 @@ impl BrkClient { /// Endpoint: `GET /api/urpd/{cohort}` pub fn get_urpd(&self, cohort: Cohort, agg: Option) -> Result { let mut query = Vec::new(); - if let Some(v) = agg { query.push(format!("agg={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; + if let Some(v) = agg { + query.push(format!("agg={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; let path = format!("/api/urpd/{cohort}{}", query_str); self.base.get_json(&path) } @@ -9516,10 +13565,21 @@ impl BrkClient { /// See the URPD tag description for unit conventions and `agg` options. /// /// Endpoint: `GET /api/urpd/{cohort}/{date}` - pub fn get_urpd_at(&self, cohort: Cohort, date: &str, agg: Option) -> Result { + pub fn get_urpd_at( + &self, + cohort: Cohort, + date: &str, + agg: Option, + ) -> Result { let mut query = Vec::new(); - if let Some(v) = agg { query.push(format!("agg={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; + if let Some(v) = agg { + query.push(format!("agg={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; let path = format!("/api/urpd/{cohort}/{date}{}", query_str); self.base.get_json(&path) } @@ -9576,7 +13636,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 @@ -9621,8 +13682,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) } @@ -9635,7 +13702,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 @@ -9646,7 +13714,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 @@ -9657,7 +13726,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 @@ -9668,7 +13738,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 @@ -9679,7 +13751,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) @@ -9690,7 +13763,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 @@ -9700,8 +13774,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) @@ -9723,7 +13802,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 @@ -9733,8 +13813,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 @@ -9745,7 +13829,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 @@ -9767,7 +13852,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 @@ -9778,7 +13864,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 @@ -9789,7 +13876,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 @@ -9811,7 +13899,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 @@ -9822,7 +13911,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 @@ -9866,7 +13956,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 @@ -9895,5 +13986,4 @@ impl BrkClient { pub fn get_version(&self) -> Result { self.base.get_json(&format!("/version")) } - } diff --git a/crates/brk_cohort/src/by_type.rs b/crates/brk_cohort/src/by_type.rs index 8d215d572..549597738 100644 --- a/crates/brk_cohort/src/by_type.rs +++ b/crates/brk_cohort/src/by_type.rs @@ -89,21 +89,17 @@ impl ByType { } pub fn iter_typed(&self) -> impl Iterator { - self.spendable - .iter_typed() - .chain(std::iter::once(( - OutputType::OpReturn, - &self.unspendable.op_return, - ))) + self.spendable.iter_typed().chain(std::iter::once(( + OutputType::OpReturn, + &self.unspendable.op_return, + ))) } pub fn iter_typed_mut(&mut self) -> impl Iterator { - self.spendable - .iter_typed_mut() - .chain(std::iter::once(( - OutputType::OpReturn, - &mut self.unspendable.op_return, - ))) + self.spendable.iter_typed_mut().chain(std::iter::once(( + OutputType::OpReturn, + &mut self.unspendable.op_return, + ))) } } diff --git a/crates/brk_computer/src/blocks/lookback.rs b/crates/brk_computer/src/blocks/lookback.rs index e0095c557..73f11ac7e 100644 --- a/crates/brk_computer/src/blocks/lookback.rs +++ b/crates/brk_computer/src/blocks/lookback.rs @@ -41,7 +41,7 @@ pub struct Vecs { pub _9m: M::Stored>>, // 270d pub _350d: M::Stored>>, pub _12m: M::Stored>>, // 360d - pub _1y: CachedVec>>>, // 365d + pub _1y: CachedVec>>>, // 365d pub _14m: M::Stored>>, // 420d pub _2y: M::Stored>>, // 730d pub _26m: M::Stored>>, // 780d diff --git a/crates/brk_computer/src/distribution/addr/activity.rs b/crates/brk_computer/src/distribution/addr/activity.rs index 2103eee78..d90aedbff 100644 --- a/crates/brk_computer/src/distribution/addr/activity.rs +++ b/crates/brk_computer/src/distribution/addr/activity.rs @@ -165,9 +165,7 @@ impl ActivityCountVecs { self.reactivated.block.push(counts.reactivated.into()); self.sending.block.push(counts.sending.into()); self.receiving.block.push(counts.receiving.into()); - self.bidirectional - .block - .push(counts.bidirectional.into()); + self.bidirectional.block.push(counts.bidirectional.into()); let active = counts.sending + counts.receiving - counts.bidirectional; self.active.block.push(active.into()); } diff --git a/crates/brk_computer/src/distribution/addr/new_addr_count.rs b/crates/brk_computer/src/distribution/addr/new_addr_count.rs index 2efe3232d..5481a31e5 100644 --- a/crates/brk_computer/src/distribution/addr/new_addr_count.rs +++ b/crates/brk_computer/src/distribution/addr/new_addr_count.rs @@ -14,8 +14,7 @@ use super::TotalAddrCountVecs; /// New address count per block (global + per-type). #[derive(Deref, DerefMut, Traversable)] pub struct NewAddrCountVecs( - #[traversable(flatten)] - pub WithAddrTypes>, + #[traversable(flatten)] pub WithAddrTypes>, ); impl NewAddrCountVecs { @@ -28,7 +27,11 @@ impl NewAddrCountVecs { Ok(Self(WithAddrTypes::< PerBlockCumulativeRolling, >::forced_import( - db, "new_addr_count", version, indexes, cached_starts + db, + "new_addr_count", + version, + indexes, + cached_starts, )?)) } diff --git a/crates/brk_computer/src/distribution/addr/reused/events/vecs.rs b/crates/brk_computer/src/distribution/addr/reused/events/vecs.rs index e49418913..f1a0fb1ff 100644 --- a/crates/brk_computer/src/distribution/addr/reused/events/vecs.rs +++ b/crates/brk_computer/src/distribution/addr/reused/events/vecs.rs @@ -92,34 +92,30 @@ impl AddrEventsVecs { cached_starts, ) }; - let import_percent = |name: &str| -> Result, - >> { - Ok(WithAddrTypes { - all: PercentCumulativeRolling::forced_import(db, name, version, indexes)?, - by_addr_type: ByAddrType::new_with_name(|type_name| { - PercentCumulativeRolling::forced_import( - db, - &format!("{type_name}_{name}"), - version, - indexes, - ) - })?, - }) - }; + let import_percent = + |name: &str| -> Result>> { + Ok(WithAddrTypes { + all: PercentCumulativeRolling::forced_import(db, name, version, indexes)?, + by_addr_type: ByAddrType::new_with_name(|type_name| { + PercentCumulativeRolling::forced_import( + db, + &format!("{type_name}_{name}"), + version, + indexes, + ) + })?, + }) + }; - let output_to_reused_addr_count = - import_count(&format!("output_to_{name}_addr_count"))?; - let output_to_reused_addr_share = - import_percent(&format!("output_to_{name}_addr_share"))?; + let output_to_reused_addr_count = import_count(&format!("output_to_{name}_addr_count"))?; + let output_to_reused_addr_share = import_percent(&format!("output_to_{name}_addr_share"))?; let spendable_output_to_reused_addr_share = PercentCumulativeRolling::forced_import( db, &format!("spendable_output_to_{name}_addr_share"), version, indexes, )?; - let input_from_reused_addr_count = - import_count(&format!("input_from_{name}_addr_count"))?; + let input_from_reused_addr_count = import_count(&format!("input_from_{name}_addr_count"))?; let input_from_reused_addr_share = import_percent(&format!("input_from_{name}_addr_share"))?; @@ -229,12 +225,13 @@ impl AddrEventsVecs { starting_indexes.height, exit, )?; - self.spendable_output_to_reused_addr_share.compute_count_ratio( - &self.output_to_reused_addr_count.all, - &outputs_by_type.spendable_output_count, - starting_indexes.height, - exit, - )?; + self.spendable_output_to_reused_addr_share + .compute_count_ratio( + &self.output_to_reused_addr_count.all, + &outputs_by_type.spendable_output_count, + starting_indexes.height, + exit, + )?; self.input_from_reused_addr_share.all.compute_count_ratio( &self.input_from_reused_addr_count.all, &inputs_by_type.input_count.all, @@ -246,7 +243,9 @@ impl AddrEventsVecs { .by_addr_type .get_mut_unwrap(otype) .compute_count_ratio( - self.output_to_reused_addr_count.by_addr_type.get_unwrap(otype), + self.output_to_reused_addr_count + .by_addr_type + .get_unwrap(otype), outputs_by_type.output_count.by_type.get(otype), starting_indexes.height, exit, @@ -255,7 +254,9 @@ impl AddrEventsVecs { .by_addr_type .get_mut_unwrap(otype) .compute_count_ratio( - self.input_from_reused_addr_count.by_addr_type.get_unwrap(otype), + self.input_from_reused_addr_count + .by_addr_type + .get_unwrap(otype), inputs_by_type.input_count.by_type.get(otype), starting_indexes.height, exit, diff --git a/crates/brk_computer/src/distribution/addr/state.rs b/crates/brk_computer/src/distribution/addr/state.rs index fd0f87817..3254af64f 100644 --- a/crates/brk_computer/src/distribution/addr/state.rs +++ b/crates/brk_computer/src/distribution/addr/state.rs @@ -2,9 +2,7 @@ use brk_types::{FundedAddrData, Height, OutputType, Sats}; use crate::distribution::{block::TrackingStatus, vecs::AddrMetricsVecs}; -use super::{ - AddrTypeToActivityCounts, AddrTypeToAddrCount, ExposedAddrState, ReusedAddrState, -}; +use super::{AddrTypeToActivityCounts, AddrTypeToAddrCount, ExposedAddrState, ReusedAddrState}; /// Bundle of per-block runtime state for the full address-metrics pipeline. /// Feeds `process_received` / `process_sent` and is pushed to [`AddrMetricsVecs`] @@ -162,7 +160,8 @@ impl AddrMetricsState { also_received, will_be_empty, ); - self.exposed.on_send(output_type, addr_data, pre, will_be_empty); + self.exposed + .on_send(output_type, addr_data, pre, will_be_empty); } } diff --git a/crates/brk_computer/src/distribution/block/cohort/addr_updates.rs b/crates/brk_computer/src/distribution/block/cohort/addr_updates.rs index d7093640d..aaf51ea46 100644 --- a/crates/brk_computer/src/distribution/block/cohort/addr_updates.rs +++ b/crates/brk_computer/src/distribution/block/cohort/addr_updates.rs @@ -67,8 +67,7 @@ pub(crate) fn process_funded_addrs( // Pure pushes - no holes remain addrs_data.funded.reserve_pushed(pushes_iter.len()); - for (next_index, (addr_type, type_index, data)) in - (addrs_data.funded.len()..).zip(pushes_iter) + for (next_index, (addr_type, type_index, data)) in (addrs_data.funded.len()..).zip(pushes_iter) { addrs_data.funded.push(data); result.get_mut(addr_type).unwrap().insert( @@ -138,9 +137,7 @@ pub(crate) fn process_empty_addrs( // Pure pushes - no holes remain addrs_data.empty.reserve_pushed(pushes_iter.len()); - for (next_index, (addr_type, type_index, data)) in - (addrs_data.empty.len()..).zip(pushes_iter) - { + for (next_index, (addr_type, type_index, data)) in (addrs_data.empty.len()..).zip(pushes_iter) { addrs_data.empty.push(data); result.get_mut(addr_type).unwrap().insert( type_index, diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs b/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs index 49749533d..873266750 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs +++ b/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs @@ -1,9 +1,9 @@ use std::{cmp::Reverse, collections::BinaryHeap, fs, path::Path}; use brk_cohort::{AGE_RANGE_NAMES, CohortContext, Filtered, PROFITABILITY_RANGE_COUNT, TERM_NAMES}; -use rayon::prelude::*; use brk_error::Result; -use brk_types::{BasisPoints16, Cents, CentsCompact, UrpdRaw, Date, Dollars, Sats}; +use brk_types::{BasisPoints16, Cents, CentsCompact, Date, Dollars, Sats, UrpdRaw}; +use rayon::prelude::*; use crate::distribution::metrics::{CostBasis, ProfitabilityMetrics}; diff --git a/crates/brk_computer/src/distribution/compute/block_loop.rs b/crates/brk_computer/src/distribution/compute/block_loop.rs index 7c9f881ae..4d68db4a8 100644 --- a/crates/brk_computer/src/distribution/compute/block_loop.rs +++ b/crates/brk_computer/src/distribution/compute/block_loop.rs @@ -190,7 +190,10 @@ pub(crate) fn process_blocks( .first_index .collect_range_at(start_usize, end_usize); - debug!("recovering addr metrics state from height {}", starting_height); + debug!( + "recovering addr metrics state from height {}", + starting_height + ); let mut state = AddrMetricsState::from((&vecs.addrs, starting_height)); debug!("addr metrics state recovered"); diff --git a/crates/brk_computer/src/distribution/metrics/activity/core.rs b/crates/brk_computer/src/distribution/metrics/activity/core.rs index 521ef32a0..01fc2ca90 100644 --- a/crates/brk_computer/src/distribution/metrics/activity/core.rs +++ b/crates/brk_computer/src/distribution/metrics/activity/core.rs @@ -9,7 +9,7 @@ use crate::{ metrics::ImportConfig, state::{CohortState, CostBasisOps, RealizedOps}, }, - internal::{ValuePerBlockCumulativeRolling, PerBlockCumulativeRolling}, + internal::{PerBlockCumulativeRolling, ValuePerBlockCumulativeRolling}, prices, }; diff --git a/crates/brk_computer/src/distribution/metrics/config.rs b/crates/brk_computer/src/distribution/metrics/config.rs index 651ad81f6..56b67318f 100644 --- a/crates/brk_computer/src/distribution/metrics/config.rs +++ b/crates/brk_computer/src/distribution/metrics/config.rs @@ -7,11 +7,11 @@ use vecdb::{BytesVec, BytesVecValue, Database, ImportableVec}; use crate::{ indexes, internal::{ - ValuePerBlock, ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, FiatType, - FiatPerBlock, FiatPerBlockCumulativeWithSums, NumericValue, PerBlock, + FiatPerBlock, FiatPerBlockCumulativeWithSums, FiatType, NumericValue, PerBlock, PerBlockCumulativeRolling, PercentPerBlock, PercentRollingWindows, Price, PriceWithRatioExtendedPerBlock, PriceWithRatioPerBlock, RatioPerBlock, - RollingWindow24hPerBlock, RollingWindows, RollingWindowsFrom1w, WindowStartVec, Windows, + RollingWindow24hPerBlock, RollingWindows, RollingWindowsFrom1w, ValuePerBlock, + ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, WindowStartVec, Windows, }, }; diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/mod.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/mod.rs index 5b4f5288b..44958431f 100644 --- a/crates/brk_computer/src/distribution/metrics/cost_basis/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/mod.rs @@ -201,7 +201,10 @@ impl CostBasis { if invested_raw == 0 { return (h, spot); } - (h, Cents::new((capitalized_cap.inner() / invested_raw) as u64)) + ( + h, + Cents::new((capitalized_cap.inner() / invested_raw) as u64), + ) }, exit, )?; @@ -215,7 +218,10 @@ impl CostBasis { if invested_raw == 0 { return (h, spot); } - (h, Cents::new((capitalized_cap.inner() / invested_raw) as u64)) + ( + h, + Cents::new((capitalized_cap.inner() / invested_raw) as u64), + ) }, exit, )?; diff --git a/crates/brk_computer/src/distribution/metrics/profitability.rs b/crates/brk_computer/src/distribution/metrics/profitability.rs index 3261df5d0..39faa4c23 100644 --- a/crates/brk_computer/src/distribution/metrics/profitability.rs +++ b/crates/brk_computer/src/distribution/metrics/profitability.rs @@ -7,7 +7,7 @@ use vecdb::{AnyStoredVec, AnyVec, Database, Exit, Rw, StorageMode, WritableVec}; use crate::{ indexes, internal::{ - ValuePerBlock, ValuePerBlockWithDeltas, PerBlock, RatioPerBlock, WindowStartVec, Windows, + PerBlock, RatioPerBlock, ValuePerBlock, ValuePerBlockWithDeltas, WindowStartVec, Windows, }, prices, }; diff --git a/crates/brk_computer/src/distribution/metrics/realized/full.rs b/crates/brk_computer/src/distribution/metrics/realized/full.rs index 732bfb7a0..9ad500ed9 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/full.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/full.rs @@ -11,11 +11,11 @@ use crate::{ blocks, distribution::state::{CohortState, CostBasisData, RealizedState, WithCapital}, internal::{ - ValuePerBlockCumulativeRolling, FiatPerBlockCumulativeWithSums, PercentPerBlock, - PercentRollingWindows, PriceWithRatioExtendedPerBlock, RatioCents64, RatioCentsBp32, - RatioCentsSignedCentsBps32, RatioCentsSignedDollarsBps32, RatioDollarsBp32, - RatioPerBlockPercentiles, RatioPerBlockStdDevBands, RatioSma, RollingWindows, - RollingWindowsFrom1w, + FiatPerBlockCumulativeWithSums, PercentPerBlock, PercentRollingWindows, + PriceWithRatioExtendedPerBlock, RatioCents64, RatioCentsBp32, RatioCentsSignedCentsBps32, + RatioCentsSignedDollarsBps32, RatioDollarsBp32, RatioPerBlockPercentiles, + RatioPerBlockStdDevBands, RatioSma, RollingWindows, RollingWindowsFrom1w, + ValuePerBlockCumulativeRolling, }, prices, }; diff --git a/crates/brk_computer/src/distribution/metrics/supply/base.rs b/crates/brk_computer/src/distribution/metrics/supply/base.rs index 6475d2e8b..f617aed62 100644 --- a/crates/brk_computer/src/distribution/metrics/supply/base.rs +++ b/crates/brk_computer/src/distribution/metrics/supply/base.rs @@ -76,13 +76,12 @@ impl SupplyBase { all_supply_sats: &impl ReadableVec, exit: &Exit, ) -> Result<()> { - self.dominance - .compute_binary::( - max_from, - &self.total.sats.height, - all_supply_sats, - exit, - ) + self.dominance.compute_binary::( + max_from, + &self.total.sats.height, + all_supply_sats, + exit, + ) } pub(crate) fn compute_from_stateful( diff --git a/crates/brk_computer/src/distribution/metrics/supply/core.rs b/crates/brk_computer/src/distribution/metrics/supply/core.rs index fb7f154c8..bac4fbc39 100644 --- a/crates/brk_computer/src/distribution/metrics/supply/core.rs +++ b/crates/brk_computer/src/distribution/metrics/supply/core.rs @@ -7,7 +7,7 @@ use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec}; use crate::{distribution::state::UnrealizedState, prices}; use crate::internal::{ - ValuePerBlock, HalveCents, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyValuePerBlock, + HalveCents, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyValuePerBlock, ValuePerBlock, }; use crate::distribution::metrics::ImportConfig; diff --git a/crates/brk_computer/src/distribution/metrics/supply/mod.rs b/crates/brk_computer/src/distribution/metrics/supply/mod.rs index 063581404..cd7551518 100644 --- a/crates/brk_computer/src/distribution/metrics/supply/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/supply/mod.rs @@ -2,6 +2,6 @@ mod avg_amount; mod base; mod core; -pub use avg_amount::AvgAmountMetrics; pub use self::core::SupplyCore; +pub use avg_amount::AvgAmountMetrics; pub use base::SupplyBase; diff --git a/crates/brk_computer/src/distribution/state/cohort/base.rs b/crates/brk_computer/src/distribution/state/cohort/base.rs index a9b4b6468..df94640ea 100644 --- a/crates/brk_computer/src/distribution/state/cohort/base.rs +++ b/crates/brk_computer/src/distribution/state/cohort/base.rs @@ -215,8 +215,12 @@ impl CohortState { pre.prev_capitalized_cap, ); - self.cost_basis - .decrement(pre.prev_price, pre.sats, pre.prev_ps, pre.prev_capitalized_cap); + self.cost_basis.decrement( + pre.prev_price, + pre.sats, + pre.prev_ps, + pre.prev_capitalized_cap, + ); } pub(crate) fn send_utxo( diff --git a/crates/brk_computer/src/distribution/state/cost_basis/data.rs b/crates/brk_computer/src/distribution/state/cost_basis/data.rs index cfb04e87e..7693f1d5c 100644 --- a/crates/brk_computer/src/distribution/state/cost_basis/data.rs +++ b/crates/brk_computer/src/distribution/state/cost_basis/data.rs @@ -5,14 +5,14 @@ use std::{ }; use brk_error::{Error, Result}; -use brk_types::{ - Cents, CentsCompact, CentsSats, CentsSquaredSats, UrpdRaw, Height, Sats, -}; +use brk_types::{Cents, CentsCompact, CentsSats, CentsSquaredSats, Height, Sats, UrpdRaw}; use rustc_hash::FxHashMap; use vecdb::{Bytes, unlikely}; use super::{Accumulate, CachedUnrealizedState, UnrealizedState}; -use crate::distribution::state::pending::{PendingCapDelta, PendingDelta, PendingCapitalizedCapRawDelta}; +use crate::distribution::state::pending::{ + PendingCapDelta, PendingCapitalizedCapRawDelta, PendingDelta, +}; /// Type alias for the price-to-sats map used in cost basis data. pub(super) type CostBasisMap = BTreeMap; diff --git a/crates/brk_computer/src/distribution/state/cost_basis/realized.rs b/crates/brk_computer/src/distribution/state/cost_basis/realized.rs index f37af2949..ab8bddf1d 100644 --- a/crates/brk_computer/src/distribution/state/cost_basis/realized.rs +++ b/crates/brk_computer/src/distribution/state/cost_basis/realized.rs @@ -200,12 +200,14 @@ impl RealizedOps for CoreRealizedState { #[inline] fn increment_snapshot(&mut self, price_sats: CentsSats, _capitalized_cap: CentsSquaredSats) { - self.minimal.increment_snapshot(price_sats, _capitalized_cap); + self.minimal + .increment_snapshot(price_sats, _capitalized_cap); } #[inline] fn decrement_snapshot(&mut self, price_sats: CentsSats, _capitalized_cap: CentsSquaredSats) { - self.minimal.decrement_snapshot(price_sats, _capitalized_cap); + self.minimal + .decrement_snapshot(price_sats, _capitalized_cap); } #[inline] @@ -301,7 +303,8 @@ impl RealizedOps for RealizedState { fn increment(&mut self, price: Cents, sats: Sats) { self.core.increment(price, sats); if sats.is_not_zero() { - self.capitalized_cap_raw += CentsSats::from_price_sats(price, sats).to_capitalized_cap(price); + self.capitalized_cap_raw += + CentsSats::from_price_sats(price, sats).to_capitalized_cap(price); } } diff --git a/crates/brk_computer/src/distribution/vecs.rs b/crates/brk_computer/src/distribution/vecs.rs index 9d5797c8c..97c7f2225 100644 --- a/crates/brk_computer/src/distribution/vecs.rs +++ b/crates/brk_computer/src/distribution/vecs.rs @@ -220,8 +220,7 @@ impl Vecs { let addr_count = AddrCountsVecs::forced_import(&db, "addr_count", version, indexes)?; let empty_addr_count = AddrCountsVecs::forced_import(&db, "empty_addr_count", version, indexes)?; - let addr_activity = - AddrActivityVecs::forced_import(&db, version, indexes, cached_starts)?; + let addr_activity = AddrActivityVecs::forced_import(&db, version, indexes, cached_starts)?; // Stored total = addr_count + empty_addr_count (global + per-type, with all derived indexes) let total_addr_count = TotalAddrCountVecs::forced_import(&db, version, indexes)?; @@ -548,7 +547,9 @@ impl Vecs { self.addrs.empty.compute_rest(starting_indexes, exit)?; let t = &self.utxo_cohorts.type_; let type_supply_sats = ByAddrType::new(|filter| { - let Filter::Type(ot) = filter else { unreachable!() }; + let Filter::Type(ot) = filter else { + unreachable!() + }; &t.get(ot).metrics.supply.total.sats.height }); let all_supply_sats = &self.utxo_cohorts.all.metrics.supply.total.sats.height; diff --git a/crates/brk_computer/src/inputs/by_type/compute.rs b/crates/brk_computer/src/inputs/by_type/compute.rs index 10f142780..3b3c95036 100644 --- a/crates/brk_computer/src/inputs/by_type/compute.rs +++ b/crates/brk_computer/src/inputs/by_type/compute.rs @@ -61,7 +61,11 @@ impl Vecs { Ok(()) }, |agg| { - push_block(&mut self.input_count, agg.entries_all, &agg.entries_per_type); + push_block( + &mut self.input_count, + agg.entries_all, + &agg.entries_per_type, + ); push_block(&mut self.tx_count, agg.txs_all, &agg.txs_per_type); if self.input_count.all.block.batch_limit_reached() { @@ -81,8 +85,7 @@ impl Vecs { self.input_count .compute_rest(starting_indexes.height, exit)?; - self.tx_count - .compute_rest(starting_indexes.height, exit)?; + self.tx_count.compute_rest(starting_indexes.height, exit)?; } for (otype, source) in self.input_count.by_type.iter_typed() { diff --git a/crates/brk_computer/src/inputs/by_type/import.rs b/crates/brk_computer/src/inputs/by_type/import.rs index 2405bf7bf..408ca2b57 100644 --- a/crates/brk_computer/src/inputs/by_type/import.rs +++ b/crates/brk_computer/src/inputs/by_type/import.rs @@ -6,9 +6,7 @@ use vecdb::Database; use super::{Vecs, WithInputTypes}; use crate::{ indexes, - internal::{ - PerBlockCumulativeRolling, PercentCumulativeRolling, WindowStartVec, Windows, - }, + internal::{PerBlockCumulativeRolling, PercentCumulativeRolling, WindowStartVec, Windows}, }; impl Vecs { @@ -18,26 +16,24 @@ impl Vecs { indexes: &indexes::Vecs, cached_starts: &Windows<&WindowStartVec>, ) -> Result { - let input_count = WithInputTypes::< - PerBlockCumulativeRolling, - >::forced_import_with( - db, - "input_count_bis", - |t| format!("{t}_prevout_count"), - version, - indexes, - cached_starts, - )?; - let tx_count = WithInputTypes::< - PerBlockCumulativeRolling, - >::forced_import_with( - db, - "non_coinbase_tx_count", - |t| format!("tx_count_with_{t}_prevout"), - version, - indexes, - cached_starts, - )?; + let input_count = + WithInputTypes::>::forced_import_with( + db, + "input_count_bis", + |t| format!("{t}_prevout_count"), + version, + indexes, + cached_starts, + )?; + let tx_count = + WithInputTypes::>::forced_import_with( + db, + "non_coinbase_tx_count", + |t| format!("tx_count_with_{t}_prevout"), + version, + indexes, + cached_starts, + )?; let input_share = SpendableType::try_new(|_, name| { PercentCumulativeRolling::forced_import( diff --git a/crates/brk_computer/src/inputs/by_type/with_input_types.rs b/crates/brk_computer/src/inputs/by_type/with_input_types.rs index 2bc966439..1f3bfaf54 100644 --- a/crates/brk_computer/src/inputs/by_type/with_input_types.rs +++ b/crates/brk_computer/src/inputs/by_type/with_input_types.rs @@ -68,7 +68,9 @@ where dep_version: Version, at_height: Height, ) -> Result<()> { - self.all.block.validate_and_truncate(dep_version, at_height)?; + self.all + .block + .validate_and_truncate(dep_version, at_height)?; for v in self.by_type.iter_mut() { v.block.validate_and_truncate(dep_version, at_height)?; } diff --git a/crates/brk_computer/src/inputs/compute.rs b/crates/brk_computer/src/inputs/compute.rs index b1d1fc203..2aec3b755 100644 --- a/crates/brk_computer/src/inputs/compute.rs +++ b/crates/brk_computer/src/inputs/compute.rs @@ -20,8 +20,7 @@ impl Vecs { self.spent.compute(indexer, starting_indexes, exit)?; self.count .compute(indexer, indexes, blocks, starting_indexes, exit)?; - self.per_sec - .compute(&self.count, starting_indexes, exit)?; + self.per_sec.compute(&self.count, starting_indexes, exit)?; self.by_type.compute(indexer, starting_indexes, exit)?; let exit = exit.clone(); diff --git a/crates/brk_computer/src/internal/block_walker.rs b/crates/brk_computer/src/internal/block_walker.rs index fe97f8aa8..574b3631b 100644 --- a/crates/brk_computer/src/internal/block_walker.rs +++ b/crates/brk_computer/src/internal/block_walker.rs @@ -81,4 +81,3 @@ pub(crate) fn walk_blocks( Ok(()) } - diff --git a/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum.rs b/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum.rs index ed300cf10..b66c60dd5 100644 --- a/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum.rs +++ b/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum.rs @@ -6,7 +6,7 @@ use vecdb::{Database, Exit, Rw, StorageMode}; use crate::{ indexes, internal::{ - FiatType, FiatBlock, FiatPerBlock, LazyRollingSumsFiatFromHeight, WindowStartVec, Windows, + FiatBlock, FiatPerBlock, FiatType, LazyRollingSumsFiatFromHeight, WindowStartVec, Windows, }, }; diff --git a/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum_with_deltas.rs b/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum_with_deltas.rs index 39cb4f2a9..f4bb7b6ab 100644 --- a/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum_with_deltas.rs +++ b/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum_with_deltas.rs @@ -9,7 +9,7 @@ use crate::{ internal::{BpsType, LazyRollingDeltasFiatFromHeight, WindowStartVec, Windows}, }; -use super::{FiatType, FiatPerBlockCumulativeWithSums}; +use super::{FiatPerBlockCumulativeWithSums, FiatType}; #[derive(Deref, DerefMut, Traversable)] pub struct FiatPerBlockCumulativeWithSumsAndDeltas diff --git a/crates/brk_computer/src/internal/per_block/fiat/lazy_rolling_sum.rs b/crates/brk_computer/src/internal/per_block/fiat/lazy_rolling_sum.rs index 8cba9055a..50f618dc7 100644 --- a/crates/brk_computer/src/internal/per_block/fiat/lazy_rolling_sum.rs +++ b/crates/brk_computer/src/internal/per_block/fiat/lazy_rolling_sum.rs @@ -6,7 +6,7 @@ use vecdb::{DeltaSub, LazyDeltaVec, LazyVecFrom1, ReadOnlyClone, ReadableCloneab use crate::{ indexes, internal::{ - FiatType, DerivedResolutions, LazyPerBlock, LazyRollingSumFromHeight, Resolutions, + DerivedResolutions, FiatType, LazyPerBlock, LazyRollingSumFromHeight, Resolutions, WindowStartVec, Windows, }, }; @@ -19,9 +19,7 @@ pub struct LazyRollingSumFiatFromHeight { #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(transparent)] -pub struct LazyRollingSumsFiatFromHeight( - pub Windows>, -); +pub struct LazyRollingSumsFiatFromHeight(pub Windows>); impl LazyRollingSumsFiatFromHeight { pub fn new( diff --git a/crates/brk_computer/src/internal/per_block/fiat/with_deltas.rs b/crates/brk_computer/src/internal/per_block/fiat/with_deltas.rs index 6de081415..bdff6b072 100644 --- a/crates/brk_computer/src/internal/per_block/fiat/with_deltas.rs +++ b/crates/brk_computer/src/internal/per_block/fiat/with_deltas.rs @@ -10,7 +10,7 @@ use crate::{ internal::{BpsType, LazyRollingDeltasFiatFromHeight, WindowStartVec, Windows}, }; -use super::{FiatType, FiatPerBlock}; +use super::{FiatPerBlock, FiatType}; #[derive(Deref, DerefMut, Traversable)] pub struct FiatPerBlockWithDeltas diff --git a/crates/brk_computer/src/internal/per_block/lazy/base.rs b/crates/brk_computer/src/internal/per_block/lazy/base.rs index d8aeeeff9..142c2fe30 100644 --- a/crates/brk_computer/src/internal/per_block/lazy/base.rs +++ b/crates/brk_computer/src/internal/per_block/lazy/base.rs @@ -44,7 +44,9 @@ where Self { height: LazyVecFrom1::transformed::(name, version, height_source), resolutions: Box::new(DerivedResolutions::from_derived_computed::( - name, version, resolutions, + name, + version, + resolutions, )), } } diff --git a/crates/brk_computer/src/internal/per_block/percent/cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/percent/cumulative_rolling.rs index ea180fcf3..c92bca7be 100644 --- a/crates/brk_computer/src/internal/per_block/percent/cumulative_rolling.rs +++ b/crates/brk_computer/src/internal/per_block/percent/cumulative_rolling.rs @@ -10,7 +10,9 @@ use vecdb::{BinaryTransform, Database, Exit, ReadableVec, Rw, StorageMode, VecVa use crate::{ indexes, - internal::{BpsType, PerBlockCumulativeRolling, PercentPerBlock, PercentRollingWindows, RatioU64Bp16}, + internal::{ + BpsType, PerBlockCumulativeRolling, PercentPerBlock, PercentRollingWindows, RatioU64Bp16, + }, }; #[derive(Traversable)] diff --git a/crates/brk_computer/src/internal/per_block/percent/lazy_cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/percent/lazy_cumulative_rolling.rs index 18ea99dfb..880ce5fc5 100644 --- a/crates/brk_computer/src/internal/per_block/percent/lazy_cumulative_rolling.rs +++ b/crates/brk_computer/src/internal/per_block/percent/lazy_cumulative_rolling.rs @@ -27,8 +27,7 @@ impl LazyPercentCumulativeRolling { version: Version, source: &PercentCumulativeRolling, ) -> Self { - let cumulative = - LazyPercentPerBlock::from_percent::(name, version, &source.cumulative); + let cumulative = LazyPercentPerBlock::from_percent::(name, version, &source.cumulative); let rolling = LazyPercentRollingWindows::from_rolling::(name, version, &source.rolling); Self { cumulative, diff --git a/crates/brk_computer/src/internal/per_block/rolling/avgs.rs b/crates/brk_computer/src/internal/per_block/rolling/avgs.rs index 74b13d596..d07408525 100644 --- a/crates/brk_computer/src/internal/per_block/rolling/avgs.rs +++ b/crates/brk_computer/src/internal/per_block/rolling/avgs.rs @@ -46,12 +46,7 @@ where starts_version, move || cached.cached(), ); - let resolutions = Resolutions::forced_import( - &full_name, - avg.clone(), - version, - indexes, - ); + let resolutions = Resolutions::forced_import(&full_name, avg.clone(), version, indexes); LazyRollingAvgFromHeight { height: avg, resolutions: Box::new(resolutions), diff --git a/crates/brk_computer/src/internal/per_block/rolling/delta.rs b/crates/brk_computer/src/internal/per_block/rolling/delta.rs index 4f4b0b92f..541298656 100644 --- a/crates/brk_computer/src/internal/per_block/rolling/delta.rs +++ b/crates/brk_computer/src/internal/per_block/rolling/delta.rs @@ -369,12 +369,8 @@ where move || cached.cached() }, ); - let change_resolutions = Resolutions::forced_import( - ¢s_name, - change_vec.clone(), - version, - indexes, - ); + let change_resolutions = + Resolutions::forced_import(¢s_name, change_vec.clone(), version, indexes); let cents = LazyDeltaFromHeight { height: change_vec, resolutions: Box::new(change_resolutions), diff --git a/crates/brk_computer/src/internal/per_block/value/cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/value/cumulative_rolling.rs index e624ad3ef..1bbfbc804 100644 --- a/crates/brk_computer/src/internal/per_block/value/cumulative_rolling.rs +++ b/crates/brk_computer/src/internal/per_block/value/cumulative_rolling.rs @@ -7,7 +7,7 @@ use vecdb::{Database, EagerVec, Exit, PcoVec, Rw, StorageMode}; use crate::{ indexes, internal::{ - ValuePerBlockCumulative, LazyRollingAvgsAmountFromHeight, LazyRollingSumsAmountFromHeight, + LazyRollingAvgsAmountFromHeight, LazyRollingSumsAmountFromHeight, ValuePerBlockCumulative, WindowStartVec, Windows, }, prices, diff --git a/crates/brk_computer/src/internal/per_block/value/full.rs b/crates/brk_computer/src/internal/per_block/value/full.rs index 7161bf986..ca4f7cd34 100644 --- a/crates/brk_computer/src/internal/per_block/value/full.rs +++ b/crates/brk_computer/src/internal/per_block/value/full.rs @@ -7,7 +7,7 @@ use vecdb::{Database, EagerVec, Exit, PcoVec, Rw, StorageMode}; use crate::{ indexes, internal::{ - ValuePerBlockCumulativeRolling, RollingDistributionValuePerBlock, WindowStartVec, + RollingDistributionValuePerBlock, ValuePerBlockCumulativeRolling, WindowStartVec, WindowStarts, Windows, }, prices, diff --git a/crates/brk_computer/src/internal/per_block/value/lazy.rs b/crates/brk_computer/src/internal/per_block/value/lazy.rs index c145a5ef6..1004a0acb 100644 --- a/crates/brk_computer/src/internal/per_block/value/lazy.rs +++ b/crates/brk_computer/src/internal/per_block/value/lazy.rs @@ -6,7 +6,7 @@ use derive_more::{Deref, DerefMut}; use vecdb::UnaryTransform; use crate::internal::{ - ValuePerBlock, Identity, LazyValue, LazyValueDerivedResolutions, SatsToBitcoin, + Identity, LazyValue, LazyValueDerivedResolutions, SatsToBitcoin, ValuePerBlock, }; /// Lazy value wrapper with height + all derived last transforms from ValuePerBlock. diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_derived_resolutions.rs b/crates/brk_computer/src/internal/per_block/value/lazy_derived_resolutions.rs index ca56a8bcd..8eb5d44b7 100644 --- a/crates/brk_computer/src/internal/per_block/value/lazy_derived_resolutions.rs +++ b/crates/brk_computer/src/internal/per_block/value/lazy_derived_resolutions.rs @@ -2,7 +2,7 @@ use brk_traversable::Traversable; use brk_types::{Bitcoin, Cents, Dollars, Sats, Version}; use vecdb::UnaryTransform; -use crate::internal::{ValuePerBlock, DerivedResolutions}; +use crate::internal::{DerivedResolutions, ValuePerBlock}; #[derive(Clone, Traversable)] pub struct LazyValueDerivedResolutions { diff --git a/crates/brk_computer/src/internal/per_block/value/rolling_distribution.rs b/crates/brk_computer/src/internal/per_block/value/rolling_distribution.rs index 0ca92a6ee..2ca574d9a 100644 --- a/crates/brk_computer/src/internal/per_block/value/rolling_distribution.rs +++ b/crates/brk_computer/src/internal/per_block/value/rolling_distribution.rs @@ -7,7 +7,7 @@ use vecdb::{Database, Exit, ReadableVec, Rw, StorageMode}; use crate::{ indexes, internal::{ - ValuePerBlock, DistributionStats, WindowStarts, Windows, + DistributionStats, ValuePerBlock, WindowStarts, Windows, algo::compute_rolling_distribution_from_starts, }, }; diff --git a/crates/brk_computer/src/internal/per_tx/distribution.rs b/crates/brk_computer/src/internal/per_tx/distribution.rs index 90f72bd34..a56133fa7 100644 --- a/crates/brk_computer/src/internal/per_tx/distribution.rs +++ b/crates/brk_computer/src/internal/per_tx/distribution.rs @@ -8,7 +8,9 @@ use brk_indexer::Indexer; use brk_traversable::Traversable; use brk_types::{Indexes, TxIndex, VSize}; use schemars::JsonSchema; -use vecdb::{Database, EagerVec, Exit, ImportableVec, PcoVec, ReadableVec, Rw, StorageMode, Version}; +use vecdb::{ + Database, EagerVec, Exit, ImportableVec, PcoVec, ReadableVec, Rw, StorageMode, Version, +}; use crate::{ indexes, diff --git a/crates/brk_computer/src/internal/with_addr_types.rs b/crates/brk_computer/src/internal/with_addr_types.rs index 1a38a4ee3..3aea4d54a 100644 --- a/crates/brk_computer/src/internal/with_addr_types.rs +++ b/crates/brk_computer/src/internal/with_addr_types.rs @@ -13,7 +13,7 @@ use vecdb::{AnyStoredVec, AnyVec, Database, EagerVec, Exit, PcoVec, WritableVec} use crate::{indexes, prices}; use super::{ - ValuePerBlock, BpsType, NumericValue, PerBlock, PerBlockCumulativeRolling, PercentPerBlock, + BpsType, NumericValue, PerBlock, PerBlockCumulativeRolling, PercentPerBlock, ValuePerBlock, WindowStartVec, Windows, }; @@ -83,11 +83,7 @@ where } /// Compute `all.height` as the per-block sum of the per-type vecs. - pub(crate) fn compute_rest( - &mut self, - starting_indexes: &Indexes, - exit: &Exit, - ) -> Result<()> { + pub(crate) fn compute_rest(&mut self, starting_indexes: &Indexes, exit: &Exit) -> Result<()> { let sources: Vec<&EagerVec>> = self.by_addr_type.values().map(|v| &v.height).collect(); self.all @@ -109,13 +105,8 @@ where indexes: &indexes::Vecs, cached_starts: &Windows<&WindowStartVec>, ) -> Result { - let all = PerBlockCumulativeRolling::forced_import( - db, - name, - version, - indexes, - cached_starts, - )?; + let all = + PerBlockCumulativeRolling::forced_import(db, name, version, indexes, cached_starts)?; let by_addr_type = ByAddrType::new_with_name(|type_name| { PerBlockCumulativeRolling::forced_import( db, diff --git a/crates/brk_computer/src/investing/import.rs b/crates/brk_computer/src/investing/import.rs index 5a20ff35d..fdca29a06 100644 --- a/crates/brk_computer/src/investing/import.rs +++ b/crates/brk_computer/src/investing/import.rs @@ -9,7 +9,7 @@ use super::{ByDcaCagr, ByDcaClass, ByDcaPeriod, Vecs}; use crate::{ indexes, internal::{ - ValuePerBlock, PercentPerBlock, Price, + PercentPerBlock, Price, ValuePerBlock, db_utils::{finalize_db, open_db}, }, }; diff --git a/crates/brk_computer/src/investing/vecs.rs b/crates/brk_computer/src/investing/vecs.rs index 49b130d20..cf3ff3f32 100644 --- a/crates/brk_computer/src/investing/vecs.rs +++ b/crates/brk_computer/src/investing/vecs.rs @@ -3,7 +3,7 @@ use brk_types::{BasisPointsSigned32, Cents, Height, Sats}; use vecdb::{Database, EagerVec, PcoVec, Rw, StorageMode}; use super::{ByDcaCagr, ByDcaClass, ByDcaPeriod}; -use crate::internal::{ValuePerBlock, PerBlock, PercentPerBlock, Price}; +use crate::internal::{PerBlock, PercentPerBlock, Price, ValuePerBlock}; #[derive(Traversable)] pub struct PeriodVecs { diff --git a/crates/brk_computer/src/lib.rs b/crates/brk_computer/src/lib.rs index db7ee5bd1..08ad78a05 100644 --- a/crates/brk_computer/src/lib.rs +++ b/crates/brk_computer/src/lib.rs @@ -87,9 +87,8 @@ impl Computer { let cached_starts = blocks.lookback.cached_window_starts(); - let (inputs, outputs, mining, transactions, pools, cointime) = timed( - "Imported inputs/outputs/mining/tx/pools/cointime", - || { + let (inputs, outputs, mining, transactions, pools, cointime) = + timed("Imported inputs/outputs/mining/tx/pools/cointime", || { thread::scope(|s| -> Result<_> { let inputs_handle = big_thread().spawn_scoped(s, || -> Result<_> { Ok(Box::new(inputs::Vecs::forced_import( @@ -152,8 +151,7 @@ impl Computer { Ok((inputs, outputs, mining, transactions, pools, cointime)) }) - }, - )?; + })?; // Market, indicators, and distribution are independent; import in parallel. // Supply depends on distribution so it runs after. @@ -271,9 +269,8 @@ impl Computer { { info!("Removing obsolete database folder: {}", name); let path = entry.path(); - fs::remove_dir_all(&path).map_err(|e| { - std::io::Error::other(format!("remove_dir_all {path:?}: {e}")) - })?; + fs::remove_dir_all(&path) + .map_err(|e| std::io::Error::other(format!("remove_dir_all {path:?}: {e}")))?; } } diff --git a/crates/brk_computer/src/mining/rewards/import.rs b/crates/brk_computer/src/mining/rewards/import.rs index 39f906418..4c38e7ad5 100644 --- a/crates/brk_computer/src/mining/rewards/import.rs +++ b/crates/brk_computer/src/mining/rewards/import.rs @@ -6,9 +6,9 @@ use super::Vecs; use crate::{ indexes, internal::{ - ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, ValuePerBlockFull, LazyPercentCumulativeRolling, OneMinusBp16, PercentCumulativeRolling, RatioRollingWindows, - WindowStartVec, Windows, + ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, ValuePerBlockFull, WindowStartVec, + Windows, }, }; diff --git a/crates/brk_computer/src/mining/rewards/vecs.rs b/crates/brk_computer/src/mining/rewards/vecs.rs index 0c448ed5b..59d749f50 100644 --- a/crates/brk_computer/src/mining/rewards/vecs.rs +++ b/crates/brk_computer/src/mining/rewards/vecs.rs @@ -3,8 +3,8 @@ use brk_types::{BasisPoints16, BasisPoints32, Height, Sats}; use vecdb::{EagerVec, PcoVec, Rw, StorageMode}; use crate::internal::{ - ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, ValuePerBlockFull, LazyPercentCumulativeRolling, PercentCumulativeRolling, RatioRollingWindows, + ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, ValuePerBlockFull, }; #[derive(Traversable)] diff --git a/crates/brk_computer/src/outputs/by_type/compute.rs b/crates/brk_computer/src/outputs/by_type/compute.rs index 94c7aef2d..744d0312a 100644 --- a/crates/brk_computer/src/outputs/by_type/compute.rs +++ b/crates/brk_computer/src/outputs/by_type/compute.rs @@ -68,10 +68,14 @@ impl Vecs { Ok(()) }, |agg| { - push_block(&mut self.output_count, agg.entries_all, &agg.entries_per_type); + push_block( + &mut self.output_count, + agg.entries_all, + &agg.entries_per_type, + ); push_block(&mut self.tx_count, agg.txs_all, &agg.txs_per_type); - let spendable_total = agg.entries_all - - agg.entries_per_type[OutputType::OpReturn as usize]; + let spendable_total = + agg.entries_all - agg.entries_per_type[OutputType::OpReturn as usize]; self.spendable_output_count .block .push(StoredU64::from(spendable_total)); @@ -97,8 +101,7 @@ impl Vecs { .compute_rest(starting_indexes.height, exit)?; self.spendable_output_count .compute_rest(starting_indexes.height, exit)?; - self.tx_count - .compute_rest(starting_indexes.height, exit)?; + self.tx_count.compute_rest(starting_indexes.height, exit)?; } for (otype, source) in self.output_count.by_type.iter_typed() { diff --git a/crates/brk_computer/src/outputs/by_type/import.rs b/crates/brk_computer/src/outputs/by_type/import.rs index b9d4341d3..56647c778 100644 --- a/crates/brk_computer/src/outputs/by_type/import.rs +++ b/crates/brk_computer/src/outputs/by_type/import.rs @@ -16,26 +16,24 @@ impl Vecs { indexes: &indexes::Vecs, cached_starts: &Windows<&WindowStartVec>, ) -> Result { - let output_count = WithOutputTypes::< - PerBlockCumulativeRolling, - >::forced_import_with( - db, - "output_count_bis", - |t| format!("{t}_output_count"), - version, - indexes, - cached_starts, - )?; - let tx_count = WithOutputTypes::< - PerBlockCumulativeRolling, - >::forced_import_with( - db, - "tx_count_bis", - |t| format!("tx_count_with_{t}_output"), - version, - indexes, - cached_starts, - )?; + let output_count = + WithOutputTypes::>::forced_import_with( + db, + "output_count_bis", + |t| format!("{t}_output_count"), + version, + indexes, + cached_starts, + )?; + let tx_count = + WithOutputTypes::>::forced_import_with( + db, + "tx_count_bis", + |t| format!("tx_count_with_{t}_output"), + version, + indexes, + cached_starts, + )?; let spendable_output_count = PerBlockCumulativeRolling::forced_import( db, diff --git a/crates/brk_computer/src/outputs/by_type/with_output_types.rs b/crates/brk_computer/src/outputs/by_type/with_output_types.rs index abcc4e835..544cd865f 100644 --- a/crates/brk_computer/src/outputs/by_type/with_output_types.rs +++ b/crates/brk_computer/src/outputs/by_type/with_output_types.rs @@ -67,7 +67,9 @@ where dep_version: Version, at_height: Height, ) -> Result<()> { - self.all.block.validate_and_truncate(dep_version, at_height)?; + self.all + .block + .validate_and_truncate(dep_version, at_height)?; for v in self.by_type.iter_mut() { v.block.validate_and_truncate(dep_version, at_height)?; } diff --git a/crates/brk_computer/src/outputs/compute.rs b/crates/brk_computer/src/outputs/compute.rs index d62ae2635..7461c06a7 100644 --- a/crates/brk_computer/src/outputs/compute.rs +++ b/crates/brk_computer/src/outputs/compute.rs @@ -22,8 +22,7 @@ impl Vecs { self.count .compute(indexer, indexes, blocks, starting_indexes, exit)?; - self.per_sec - .compute(&self.count, starting_indexes, exit)?; + self.per_sec.compute(&self.count, starting_indexes, exit)?; self.value .compute(indexer, prices, starting_indexes, exit)?; self.by_type.compute(indexer, starting_indexes, exit)?; diff --git a/crates/brk_computer/src/pools/major.rs b/crates/brk_computer/src/pools/major.rs index 339071107..bc12d2b62 100644 --- a/crates/brk_computer/src/pools/major.rs +++ b/crates/brk_computer/src/pools/major.rs @@ -7,7 +7,7 @@ use vecdb::{BinaryTransform, Database, Exit, ReadableVec, Rw, StorageMode, Versi use crate::{ blocks, indexes, internal::{ - ValuePerBlockCumulativeRolling, MaskSats, PercentRollingWindows, RatioU64Bp16, + MaskSats, PercentRollingWindows, RatioU64Bp16, ValuePerBlockCumulativeRolling, WindowStartVec, Windows, }, mining, prices, diff --git a/crates/brk_computer/src/pools/pool_heights.rs b/crates/brk_computer/src/pools/pool_heights.rs index 1ec674b56..bad5975b9 100644 --- a/crates/brk_computer/src/pools/pool_heights.rs +++ b/crates/brk_computer/src/pools/pool_heights.rs @@ -14,9 +14,7 @@ impl PoolHeights { let mut map: FxHashMap> = FxHashMap::default(); let reader = pool.reader(); for h in 0..len { - map.entry(reader.get(h)) - .or_default() - .push(Height::from(h)); + map.entry(reader.get(h)).or_default().push(Height::from(h)); } Self(Arc::new(RwLock::new(map))) } diff --git a/crates/brk_computer/src/prices/compute.rs b/crates/brk_computer/src/prices/compute.rs index c5fd4e4e6..d91ae988f 100644 --- a/crates/brk_computer/src/prices/compute.rs +++ b/crates/brk_computer/src/prices/compute.rs @@ -84,7 +84,11 @@ impl Vecs { .height .len() .min(starting_indexes.height.to_usize()); - self.spot.cents.height.inner.truncate_if_needed_at(truncate_to)?; + self.spot + .cents + .height + .inner + .truncate_if_needed_at(truncate_to)?; if self.spot.cents.height.len() < START_HEIGHT { for line in brk_oracle::PRICES diff --git a/crates/brk_computer/src/supply/import.rs b/crates/brk_computer/src/supply/import.rs index 9e491d40e..8beb14118 100644 --- a/crates/brk_computer/src/supply/import.rs +++ b/crates/brk_computer/src/supply/import.rs @@ -6,7 +6,7 @@ use brk_types::Version; use crate::{ cointime, distribution, indexes, internal::{ - LazyValuePerBlock, LazyFiatPerBlock, LazyRollingDeltasFiatFromHeight, PercentPerBlock, + LazyFiatPerBlock, LazyRollingDeltasFiatFromHeight, LazyValuePerBlock, PercentPerBlock, RollingWindows, WindowStartVec, Windows, db_utils::{finalize_db, open_db}, }, @@ -63,11 +63,8 @@ impl Vecs { indexes, )?; - let hodled_or_lost = LazyValuePerBlock::identity( - "hodled_or_lost_supply", - &cointime.supply.vaulted, - version, - ); + let hodled_or_lost = + LazyValuePerBlock::identity("hodled_or_lost_supply", &cointime.supply.vaulted, version); let this = Self { db, diff --git a/crates/brk_computer/src/supply/vecs.rs b/crates/brk_computer/src/supply/vecs.rs index 1641daaa2..8345fb1b1 100644 --- a/crates/brk_computer/src/supply/vecs.rs +++ b/crates/brk_computer/src/supply/vecs.rs @@ -4,7 +4,7 @@ use vecdb::{Database, Rw, StorageMode}; use super::{burned, velocity}; use crate::internal::{ - LazyValuePerBlock, LazyFiatPerBlock, LazyRollingDeltasFiatFromHeight, PercentPerBlock, + LazyFiatPerBlock, LazyRollingDeltasFiatFromHeight, LazyValuePerBlock, PercentPerBlock, RollingWindows, }; diff --git a/crates/brk_computer/src/transactions/volume/import.rs b/crates/brk_computer/src/transactions/volume/import.rs index 664080a17..5bc18a930 100644 --- a/crates/brk_computer/src/transactions/volume/import.rs +++ b/crates/brk_computer/src/transactions/volume/import.rs @@ -5,7 +5,7 @@ use vecdb::Database; use super::Vecs; use crate::{ indexes, - internal::{ValuePerBlockCumulativeRolling, PerBlock, WindowStartVec, Windows}, + internal::{PerBlock, ValuePerBlockCumulativeRolling, WindowStartVec, Windows}, }; impl Vecs { diff --git a/crates/brk_computer/src/transactions/volume/vecs.rs b/crates/brk_computer/src/transactions/volume/vecs.rs index 568448c69..4c6815992 100644 --- a/crates/brk_computer/src/transactions/volume/vecs.rs +++ b/crates/brk_computer/src/transactions/volume/vecs.rs @@ -2,7 +2,7 @@ use brk_traversable::Traversable; use brk_types::StoredF32; use vecdb::{Rw, StorageMode}; -use crate::internal::{ValuePerBlockCumulativeRolling, PerBlock, Windows}; +use crate::internal::{PerBlock, ValuePerBlockCumulativeRolling, Windows}; #[derive(Traversable)] pub struct Vecs { diff --git a/crates/brk_mempool/src/steps/fetcher/mod.rs b/crates/brk_mempool/src/steps/fetcher/mod.rs index 9a5443642..bf8ed361f 100644 --- a/crates/brk_mempool/src/steps/fetcher/mod.rs +++ b/crates/brk_mempool/src/steps/fetcher/mod.rs @@ -62,10 +62,7 @@ impl Fetcher { /// Parent txids referenced by `new_raws` inputs that aren't already /// resolvable: not in the mempool store, not in `new_raws` itself. - fn unique_confirmed_parents( - new_raws: &FxHashMap, - known: &TxStore, - ) -> Vec { + fn unique_confirmed_parents(new_raws: &FxHashMap, known: &TxStore) -> Vec { let mut set: FxHashSet = FxHashSet::default(); for raw in new_raws.values() { for txin in &raw.tx.input { diff --git a/crates/brk_mempool/src/steps/rebuilder/block_builder/graph_bench.rs b/crates/brk_mempool/src/steps/rebuilder/block_builder/graph_bench.rs index 290b72ea4..6573f0188 100644 --- a/crates/brk_mempool/src/steps/rebuilder/block_builder/graph_bench.rs +++ b/crates/brk_mempool/src/steps/rebuilder/block_builder/graph_bench.rs @@ -37,12 +37,9 @@ fn synthetic_mempool(n: usize) -> Vec> { _ if i > 1 => { let p1 = (i.wrapping_mul(7919)) % i; let p2 = (i.wrapping_mul(6151)) % i; - [ - TxidPrefix::from(&txids[p1]), - TxidPrefix::from(&txids[p2]), - ] - .into_iter() - .collect() + [TxidPrefix::from(&txids[p1]), TxidPrefix::from(&txids[p2])] + .into_iter() + .collect() } _ => SmallVec::new(), }; diff --git a/crates/brk_mempool/src/steps/rebuilder/block_builder/linearize/mod.rs b/crates/brk_mempool/src/steps/rebuilder/block_builder/linearize/mod.rs index e4e88cde5..01cd284ee 100644 --- a/crates/brk_mempool/src/steps/rebuilder/block_builder/linearize/mod.rs +++ b/crates/brk_mempool/src/steps/rebuilder/block_builder/linearize/mod.rs @@ -52,7 +52,12 @@ pub fn linearize_clusters(graph: &Graph) -> Vec { continue; } for (chunk_order, chunk) in sfl::linearize(&cluster).iter().enumerate() { - packages.push(chunk_to_package(&cluster, chunk, cluster_id, chunk_order as u32)); + packages.push(chunk_to_package( + &cluster, + chunk, + cluster_id, + chunk_order as u32, + )); } } diff --git a/crates/brk_mempool/src/steps/rebuilder/block_builder/linearize/tests/oracle.rs b/crates/brk_mempool/src/steps/rebuilder/block_builder/linearize/tests/oracle.rs index dfc664621..566229a77 100644 --- a/crates/brk_mempool/src/steps/rebuilder/block_builder/linearize/tests/oracle.rs +++ b/crates/brk_mempool/src/steps/rebuilder/block_builder/linearize/tests/oracle.rs @@ -327,7 +327,10 @@ fn random_dag(n: usize, seed: u64) -> FvAndEdges { (fees_vsizes, edges) } -#[expect(dead_code, reason = "kept for ad-hoc oracle sweeps; called via uncommented stress tests")] +#[expect( + dead_code, + reason = "kept for ad-hoc oracle sweeps; called via uncommented stress tests" +)] fn assert_optimal_on_random(n: usize, seed: u64) { let (fv, edges) = random_dag(n, seed); let cluster = super::make_cluster(&fv, &edges); @@ -376,7 +379,11 @@ fn optimality_gap_of(got: &[(u64, u64)], want: &[(u64, u64)]) -> Option { worst_gap = worst_gap.max(fb - fa); } } - if worst_gap == 0 { None } else { Some(worst_gap) } + if worst_gap == 0 { + None + } else { + Some(worst_gap) + } } /// Gap for the production linearizer on one random DAG. @@ -479,10 +486,7 @@ fn perf_linearize() { } else { format!("{} ns", avg_ns) }; - eprintln!( - " {:<4} {:<8} {:<10} {:.2?}", - n, calls, pretty, elapsed - ); + eprintln!(" {:<4} {:<8} {:<10} {:.2?}", n, calls, pretty, elapsed); } eprintln!(); } diff --git a/crates/brk_mempool/src/steps/rebuilder/block_builder/partitioner.rs b/crates/brk_mempool/src/steps/rebuilder/block_builder/partitioner.rs index ab8199ec4..20914b672 100644 --- a/crates/brk_mempool/src/steps/rebuilder/block_builder/partitioner.rs +++ b/crates/brk_mempool/src/steps/rebuilder/block_builder/partitioner.rs @@ -15,10 +15,7 @@ const LOOK_AHEAD_COUNT: usize = 100; /// Look-ahead respects intra-cluster order: a chunk is only taken once /// every earlier-rate chunk of the same cluster has been placed, so a /// child chunk never lands in an earlier block than its parent chunk. -pub fn partition_into_blocks( - mut packages: Vec, - num_blocks: usize, -) -> Vec> { +pub fn partition_into_blocks(mut packages: Vec, num_blocks: usize) -> Vec> { // Stable sort preserves SFL's per-cluster non-increasing-rate emission // order in the global list, which is what `cluster_next` relies on. packages.sort_by_key(|p| Reverse(p.fee_rate)); @@ -67,7 +64,13 @@ fn fill_normal_blocks( let remaining_space = BLOCK_VSIZE.saturating_sub(current_vsize); if pkg.vsize <= remaining_space { - take(slots, idx, &mut current_block, &mut current_vsize, cluster_next); + take( + slots, + idx, + &mut current_block, + &mut current_vsize, + cluster_next, + ); idx += 1; continue; } @@ -75,7 +78,13 @@ fn fill_normal_blocks( if current_block.is_empty() { // Oversized package with no partial block to preserve; take it // anyway so we don't stall on a package larger than BLOCK_VSIZE. - take(slots, idx, &mut current_block, &mut current_vsize, cluster_next); + take( + slots, + idx, + &mut current_block, + &mut current_vsize, + cluster_next, + ); idx += 1; continue; } diff --git a/crates/brk_mempool/src/steps/rebuilder/projected_blocks/verify.rs b/crates/brk_mempool/src/steps/rebuilder/projected_blocks/verify.rs index a829d7364..4dd4490f6 100644 --- a/crates/brk_mempool/src/steps/rebuilder/projected_blocks/verify.rs +++ b/crates/brk_mempool/src/steps/rebuilder/projected_blocks/verify.rs @@ -45,12 +45,7 @@ impl Verifier { } } - fn live_entry( - entries: &[Option], - tx_index: TxIndex, - b: usize, - p: usize, - ) -> &Entry { + fn live_entry(entries: &[Option], tx_index: TxIndex, b: usize, p: usize) -> &Entry { entries[tx_index.as_usize()] .as_ref() .unwrap_or_else(|| panic!("block {b} pkg {p}: dead tx_index {tx_index:?}")) @@ -65,10 +60,7 @@ impl Verifier { ) { for parent in &entry.depends { if in_pool.contains(parent) && !placed.contains(parent) { - panic!( - "block {b} pkg {p}: {} placed before its parent", - entry.txid - ); + panic!("block {b} pkg {p}: {} placed before its parent", entry.txid); } } } diff --git a/crates/brk_mempool/src/stores/entry_pool.rs b/crates/brk_mempool/src/stores/entry_pool.rs index 5f0ff9648..8f76ce6ac 100644 --- a/crates/brk_mempool/src/stores/entry_pool.rs +++ b/crates/brk_mempool/src/stores/entry_pool.rs @@ -60,7 +60,10 @@ impl EntryPool { /// Remove an entry by its txid prefix, returning it if present. pub fn remove(&mut self, prefix: &TxidPrefix) -> Option { let idx = self.prefix_to_idx.remove(prefix)?; - let entry = self.entries.get_mut(idx.as_usize()).and_then(Option::take)?; + let entry = self + .entries + .get_mut(idx.as_usize()) + .and_then(Option::take)?; self.free_slots.push(idx); Some(entry) } diff --git a/crates/brk_mempool/src/stores/tombstone.rs b/crates/brk_mempool/src/stores/tombstone.rs index 62502285f..0ea0e76f3 100644 --- a/crates/brk_mempool/src/stores/tombstone.rs +++ b/crates/brk_mempool/src/stores/tombstone.rs @@ -15,7 +15,12 @@ pub struct Tombstone { } impl Tombstone { - pub(super) fn new(tx: Transaction, entry: Entry, removal: Removal, removed_at: Instant) -> Self { + pub(super) fn new( + tx: Transaction, + entry: Entry, + removal: Removal, + removed_at: Instant, + ) -> Self { Self { tx, entry, diff --git a/crates/brk_mempool/src/stores/tx_graveyard.rs b/crates/brk_mempool/src/stores/tx_graveyard.rs index 361e131ef..b47f3b30c 100644 --- a/crates/brk_mempool/src/stores/tx_graveyard.rs +++ b/crates/brk_mempool/src/stores/tx_graveyard.rs @@ -36,9 +36,9 @@ impl TxGraveyard { &'a self, replacer: &'a Txid, ) -> impl Iterator { - self.tombstones - .iter() - .filter_map(move |(txid, ts)| (ts.replaced_by() == Some(replacer)).then_some((txid, ts))) + self.tombstones.iter().filter_map(move |(txid, ts)| { + (ts.replaced_by() == Some(replacer)).then_some((txid, ts)) + }) } pub fn bury(&mut self, txid: Txid, tx: Transaction, entry: Entry, removal: Removal) { diff --git a/crates/brk_query/src/impl/addr.rs b/crates/brk_query/src/impl/addr.rs index c88777aa6..ec2516475 100644 --- a/crates/brk_query/src/impl/addr.rs +++ b/crates/brk_query/src/impl/addr.rs @@ -85,9 +85,9 @@ impl Query { tx_count: addr_data.tx_count, realized_price, }, - mempool_stats: self.mempool().and_then(|m| { - m.addrs().get(&bytes).map(|(stats, _)| stats.clone()) - }), + mempool_stats: self + .mempool() + .and_then(|m| m.addrs().get(&bytes).map(|(stats, _)| stats.clone())), }) } diff --git a/crates/brk_query/src/impl/block/timestamp.rs b/crates/brk_query/src/impl/block/timestamp.rs index b22f2be59..7230e0389 100644 --- a/crates/brk_query/src/impl/block/timestamp.rs +++ b/crates/brk_query/src/impl/block/timestamp.rs @@ -57,12 +57,7 @@ impl Query { } let height = Height::from(best_height); - let blockhash = indexer - .vecs - .blocks - .blockhash - .collect_one(height) - .data()?; + let blockhash = indexer.vecs.blocks.blockhash.collect_one(height).data()?; // Convert timestamp to ISO 8601 format let ts_secs: i64 = (*best_ts).into(); diff --git a/crates/brk_query/src/impl/mempool.rs b/crates/brk_query/src/impl/mempool.rs index 519d973d3..b1f62958c 100644 --- a/crates/brk_query/src/impl/mempool.rs +++ b/crates/brk_query/src/impl/mempool.rs @@ -3,9 +3,9 @@ use std::cmp::Ordering; use brk_error::{Error, Result}; use brk_mempool::{Entry, EntryPool, Removal, Tombstone, TxGraveyard, TxStore}; use brk_types::{ - CheckedSub, CpfpEntry, CpfpInfo, FeeRate, MempoolBlock, MempoolInfo, MempoolRecentTx, OutputType, - RbfResponse, RbfTx, RecommendedFees, ReplacementNode, Sats, Timestamp, Transaction, TxOut, - TxOutIndex, Txid, TxidPrefix, TypeIndex, VSize, Weight, + CheckedSub, CpfpEntry, CpfpInfo, FeeRate, MempoolBlock, MempoolInfo, MempoolRecentTx, + OutputType, RbfResponse, RbfTx, RecommendedFees, ReplacementNode, Sats, Timestamp, Transaction, + TxOut, TxOutIndex, Txid, TxidPrefix, TypeIndex, VSize, Weight, }; use rustc_hash::FxHashSet; use vecdb::VecIndex; @@ -178,7 +178,8 @@ impl Query { let graveyard = mempool.graveyard(); let mut root_txid = txid.clone(); - while let Some(Removal::Replaced { by }) = graveyard.get(&root_txid).map(Tombstone::reason) { + while let Some(Removal::Replaced { by }) = graveyard.get(&root_txid).map(Tombstone::reason) + { root_txid = by.clone(); } @@ -188,8 +189,8 @@ impl Query { .collect(); let replaces = (!replaces_vec.is_empty()).then_some(replaces_vec); - let replacements = Self::build_rbf_node(&root_txid, None, &txs, &entries, &graveyard) - .map(|mut node| { + let replacements = + Self::build_rbf_node(&root_txid, None, &txs, &entries, &graveyard).map(|mut node| { node.tx.full_rbf = Some(node.full_rbf); node.interval = None; node @@ -210,14 +211,10 @@ impl Query { entries: &'a EntryPool, graveyard: &'a TxGraveyard, ) -> Option<(&'a Transaction, &'a Entry)> { - if let (Some(tx), Some(entry)) = - (txs.get(txid), entries.get(&TxidPrefix::from(txid))) - { + if let (Some(tx), Some(entry)) = (txs.get(txid), entries.get(&TxidPrefix::from(txid))) { return Some((tx, entry)); } - graveyard - .get(txid) - .map(|tomb| (&tomb.tx, &tomb.entry)) + graveyard.get(txid).map(|tomb| (&tomb.tx, &tomb.entry)) } /// Recursively build an RBF tree node rooted at `txid`. diff --git a/crates/brk_query/src/impl/mining/block_window.rs b/crates/brk_query/src/impl/mining/block_window.rs index ebfc1f425..65c39e959 100644 --- a/crates/brk_query/src/impl/mining/block_window.rs +++ b/crates/brk_query/src/impl/mining/block_window.rs @@ -78,7 +78,9 @@ impl BlockWindow { .collect_range_at(self.start, self.end); let all_prices: Vec = computer .prices - .spot.cents.height + .spot + .cents + .height .collect_range_at(self.start, self.end); let read_start = self.start.saturating_sub(1); let all_cum = cumulative.collect_range_at(read_start, self.end); diff --git a/crates/brk_query/src/impl/series.rs b/crates/brk_query/src/impl/series.rs index a946b4d0d..e93ad7f54 100644 --- a/crates/brk_query/src/impl/series.rs +++ b/crates/brk_query/src/impl/series.rs @@ -3,10 +3,10 @@ use std::{collections::BTreeMap, sync::LazyLock}; use brk_error::{Error, Result}; use brk_traversable::TreeNode; use brk_types::{ - BlockHashPrefix, Date, DetailedSeriesCount, Epoch, Format, Halving, Height, Index, - IndexInfo, LegacyValue, Limit, Output, OutputLegacy, PaginatedSeries, Pagination, - PaginationIndex, RangeIndex, RangeMap, SearchQuery, SeriesData, SeriesInfo, SeriesName, - SeriesOutput, SeriesOutputLegacy, SeriesSelection, Timestamp, Version, + BlockHashPrefix, Date, DetailedSeriesCount, Epoch, Format, Halving, Height, Index, IndexInfo, + LegacyValue, Limit, Output, OutputLegacy, PaginatedSeries, Pagination, PaginationIndex, + RangeIndex, RangeMap, SearchQuery, SeriesData, SeriesInfo, SeriesName, SeriesOutput, + SeriesOutputLegacy, SeriesSelection, Timestamp, Version, }; use parking_lot::RwLock; use vecdb::{AnyExportableVec, ReadableVec}; diff --git a/crates/brk_query/src/impl/tx.rs b/crates/brk_query/src/impl/tx.rs index 181466b5b..ce1b510c5 100644 --- a/crates/brk_query/src/impl/tx.rs +++ b/crates/brk_query/src/impl/tx.rs @@ -190,16 +190,15 @@ impl Query { let spending_txid = txid_reader.get(spending_tx_index.to_usize()); let spending_height: Height = tx_heights.get_shared(spending_tx_index).data()?; - let (block_hash, block_time) = - if let Some((h, ref bh, bt)) = cached_status - && h == spending_height - { - (bh.clone(), bt) - } else { - let (bh, bt) = self.block_hash_and_time(spending_height)?; - cached_status = Some((spending_height, bh.clone(), bt)); - (bh, bt) - }; + let (block_hash, block_time) = if let Some((h, ref bh, bt)) = cached_status + && h == spending_height + { + (bh.clone(), bt) + } else { + let (bh, bt) = self.block_hash_and_time(spending_height)?; + cached_status = Some((spending_height, bh.clone(), bt)); + (bh, bt) + }; outspends.push(TxOutspend { spent: true, diff --git a/crates/brk_reader/src/bisect.rs b/crates/brk_reader/src/bisect.rs index ab4028954..8d90c46f6 100644 --- a/crates/brk_reader/src/bisect.rs +++ b/crates/brk_reader/src/bisect.rs @@ -7,8 +7,8 @@ use brk_types::Height; use tracing::warn; use crate::{ - BlkIndexToBlkPath, OUT_OF_ORDER_FILE_BACKOFF, XORBytes, XORIndex, - parse::HEADER_LEN, scan::find_magic, + BlkIndexToBlkPath, OUT_OF_ORDER_FILE_BACKOFF, XORBytes, XORIndex, parse::HEADER_LEN, + scan::find_magic, }; const PROBE_BUF_LEN: usize = 4096; diff --git a/crates/brk_reader/src/blk_index_to_blk_path.rs b/crates/brk_reader/src/blk_index_to_blk_path.rs index 52a583074..1bdd5460d 100644 --- a/crates/brk_reader/src/blk_index_to_blk_path.rs +++ b/crates/brk_reader/src/blk_index_to_blk_path.rs @@ -28,7 +28,9 @@ impl BlkIndexToBlkPath { let Some(file_name) = path.file_name().and_then(|n| n.to_str()) else { continue; }; - let Some(index_str) = file_name.strip_prefix(BLK).and_then(|s| s.strip_suffix(DOT_DAT)) + let Some(index_str) = file_name + .strip_prefix(BLK) + .and_then(|s| s.strip_suffix(DOT_DAT)) else { continue; }; diff --git a/crates/brk_reader/src/pipeline/forward.rs b/crates/brk_reader/src/pipeline/forward.rs index 147025399..cdcdd8513 100644 --- a/crates/brk_reader/src/pipeline/forward.rs +++ b/crates/brk_reader/src/pipeline/forward.rs @@ -47,8 +47,14 @@ pub(super) fn pipeline_forward( } drop(parser_recv); - let read_result = - read_and_dispatch(paths, first_blk_index, xor_bytes, canonical, &parser_send, &stop); + let read_result = read_and_dispatch( + paths, + first_blk_index, + xor_bytes, + canonical, + &parser_send, + &stop, + ); drop(parser_send); read_result })?; @@ -125,8 +131,7 @@ fn read_and_dispatch( else { return ControlFlow::Continue(()); }; - if !canonical - .verify_prev(canonical_offset, &BlockHash::from(header.prev_blockhash)) + if !canonical.verify_prev(canonical_offset, &BlockHash::from(header.prev_blockhash)) { let _ = stop.set(Stop::Failed(Error::Internal( "forward pipeline: canonical batch stitched across a reorg", diff --git a/crates/brk_reader/src/pipeline/mod.rs b/crates/brk_reader/src/pipeline/mod.rs index 2cc7ad727..a37349263 100644 --- a/crates/brk_reader/src/pipeline/mod.rs +++ b/crates/brk_reader/src/pipeline/mod.rs @@ -5,10 +5,7 @@ use brk_rpc::Client; use brk_types::{Height, ReadBlock}; use crossbeam::channel::{Receiver, bounded}; -use crate::{ - BlkIndexToBlkPath, ReaderInner, XORBytes, bisect, - canonical::CanonicalRange, -}; +use crate::{BlkIndexToBlkPath, ReaderInner, XORBytes, bisect, canonical::CanonicalRange}; mod forward; mod reorder; diff --git a/crates/brk_reader/src/pipeline/tail.rs b/crates/brk_reader/src/pipeline/tail.rs index 3174f53cc..fde9306f9 100644 --- a/crates/brk_reader/src/pipeline/tail.rs +++ b/crates/brk_reader/src/pipeline/tail.rs @@ -74,9 +74,7 @@ pub(super) fn pipeline_tail( if slots[offset as usize].is_some() { return ControlFlow::Continue(()); } - if !canonical - .verify_prev(offset, &BlockHash::from(header.prev_blockhash)) - { + if !canonical.verify_prev(offset, &BlockHash::from(header.prev_blockhash)) { parse_failure = Some(Error::Internal( "tail pipeline: canonical batch stitched across a reorg", )); diff --git a/crates/brk_rpc/src/client.rs b/crates/brk_rpc/src/client.rs index 1ce776dcb..643baf3e2 100644 --- a/crates/brk_rpc/src/client.rs +++ b/crates/brk_rpc/src/client.rs @@ -1,9 +1,7 @@ use std::{thread::sleep, time::Duration}; use brk_error::{Error, Result}; -use corepc_jsonrpc::{ - Client as JsonRpcClient, Request, error::Error as JsonRpcError, simple_http, -}; +use corepc_jsonrpc::{Client as JsonRpcClient, Request, error::Error as JsonRpcError, simple_http}; use parking_lot::RwLock; use serde::Deserialize; use serde_json::{Value, value::RawValue}; diff --git a/crates/brk_rpc/src/methods.rs b/crates/brk_rpc/src/methods.rs index bf0463596..f55168d45 100644 --- a/crates/brk_rpc/src/methods.rs +++ b/crates/brk_rpc/src/methods.rs @@ -12,7 +12,9 @@ use serde::Deserialize; use serde_json::Value; use tracing::{debug, info}; -use crate::{BlockHeaderInfo, BlockInfo, BlockTemplateTx, BlockchainInfo, Client, RawTx, TxOutInfo}; +use crate::{ + BlockHeaderInfo, BlockInfo, BlockTemplateTx, BlockchainInfo, Client, RawTx, TxOutInfo, +}; /// Per-batch request count for `get_block_hashes_range`. Sized so the /// JSON request body stays well under a megabyte and bitcoind doesn't @@ -44,10 +46,9 @@ impl Client { &'a H: Into<&'a bitcoin::BlockHash>, { let hash: &bitcoin::BlockHash = hash.into(); - let r: GetBlockVerboseZero = self.0.call_with_retry( - "getblock", - &[serde_json::to_value(hash)?, Value::from(0u8)], - )?; + let r: GetBlockVerboseZero = self + .0 + .call_with_retry("getblock", &[serde_json::to_value(hash)?, Value::from(0u8)])?; r.block() .map_err(|e| Error::Parse(format!("decode getblock: {e}"))) } @@ -57,10 +58,9 @@ impl Client { &'a H: Into<&'a bitcoin::BlockHash>, { let hash: &bitcoin::BlockHash = hash.into(); - let r: GetBlockVerboseOne = self.0.call_with_retry( - "getblock", - &[serde_json::to_value(hash)?, Value::from(1u8)], - )?; + let r: GetBlockVerboseOne = self + .0 + .call_with_retry("getblock", &[serde_json::to_value(hash)?, Value::from(1u8)])?; Ok(BlockInfo { height: r.height as usize, confirmations: r.confirmations, @@ -241,7 +241,10 @@ impl Client { pub fn get_mempool_raw_tx(&self, txid: &Txid) -> Result { let hex = self.get_raw_transaction_hex(txid, None as Option<&BlockHash>)?; let tx = encode::deserialize_hex::(&hex)?; - Ok(RawTx { tx, hex: hex.into() }) + Ok(RawTx { + tx, + hex: hex.into(), + }) } /// Batched `getrawtransaction` over a slice of txids. Returns a map keyed @@ -250,10 +253,7 @@ impl Client { /// are logged and dropped so a single bad entry doesn't kill the batch. /// /// Chunked at `BATCH_CHUNK` requests per round-trip. - pub fn get_raw_transactions( - &self, - txids: &[Txid], - ) -> Result> { + pub fn get_raw_transactions(&self, txids: &[Txid]) -> Result> { let mut out: FxHashMap = FxHashMap::with_capacity_and_hasher(txids.len(), Default::default()); @@ -271,7 +271,10 @@ impl Client { for (txid, res) in chunk.iter().zip(results) { match res.and_then(|hex| { let tx = encode::deserialize_hex::(&hex)?; - Ok::<_, Error>(RawTx { tx, hex: hex.into() }) + Ok::<_, Error>(RawTx { + tx, + hex: hex.into(), + }) }) { Ok(raw) => { out.insert(txid.clone(), raw); @@ -279,7 +282,9 @@ impl Client { // Silenced: users without `-txindex` expect -5 for // every confirmed tx. Downgraded so the mempool // parent-fetch loop doesn't spam the log each cycle. - Err(e) => debug!(txid = %txid, error = %e, "getrawtransaction batch: item failed"), + Err(e) => { + debug!(txid = %txid, error = %e, "getrawtransaction batch: item failed") + } } } } diff --git a/crates/brk_server/src/api/addrs.rs b/crates/brk_server/src/api/addrs.rs index 2c5d1cbe7..76b7c605d 100644 --- a/crates/brk_server/src/api/addrs.rs +++ b/crates/brk_server/src/api/addrs.rs @@ -10,7 +10,7 @@ use brk_types::{AddrStats, AddrValidation, Transaction, Txid, Utxo, Version}; use crate::{ AppState, CacheStrategy, extended::TransformResponseExtended, - params::{AddrParam, AddrTxidsParam, ValidateAddrParam}, + params::{AddrParam, AddrTxidsParam, Empty, ValidateAddrParam}, }; pub trait AddrRoutes { @@ -28,6 +28,7 @@ impl AddrRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(path): Path, + _: Empty, State(state): State | { let strategy = state.addr_cache(Version::ONE, &path.addr, false); @@ -96,6 +97,7 @@ impl AddrRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(path): Path, + _: Empty, State(state): State | { let hash = state.sync(|q| q.addr_mempool_hash(&path.addr)); @@ -118,6 +120,7 @@ impl AddrRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(path): Path, + _: Empty, State(state): State | { let strategy = state.addr_cache(Version::ONE, &path.addr, false); @@ -140,6 +143,7 @@ impl AddrRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(path): Path, + _: Empty, State(state): State | { state.cached_json(&headers, CacheStrategy::Deploy, &uri, move |_q| Ok(AddrValidation::from_addr(&path.addr))).await diff --git a/crates/brk_server/src/api/blocks.rs b/crates/brk_server/src/api/blocks.rs index 21aa861bb..e56c2eece 100644 --- a/crates/brk_server/src/api/blocks.rs +++ b/crates/brk_server/src/api/blocks.rs @@ -11,7 +11,9 @@ use brk_types::{ use crate::{ AppState, CacheStrategy, extended::TransformResponseExtended, - params::{BlockHashParam, BlockHashStartIndex, BlockHashTxIndex, HeightParam, TimestampParam}, + params::{ + BlockHashParam, BlockHashStartIndex, BlockHashTxIndex, Empty, HeightParam, TimestampParam, + }, }; pub trait BlockRoutes { @@ -26,7 +28,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { let strategy = state.block_cache(Version::ONE, &path.hash); state.cached_json(&headers, strategy, &uri, move |q| q.block(&path.hash)).await }, @@ -48,7 +50,7 @@ impl BlockRoutes for ApiRouter { .api_route( "/api/v1/block/{hash}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { let strategy = state.block_cache(Version::ONE, &path.hash); state.cached_json(&headers, strategy, &uri, move |q| { let height = q.height_by_hash(&path.hash)?; @@ -71,7 +73,7 @@ impl BlockRoutes for ApiRouter { .api_route( "/api/block/{hash}/header", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { let strategy = state.block_cache(Version::ONE, &path.hash); state.cached_text(&headers, strategy, &uri, move |q| q.block_header_hex(&path.hash)).await }, @@ -94,7 +96,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { state.cached_text(&headers, state.height_cache(Version::ONE, path.height), &uri, move |q| q.block_hash_by_height(path.height).map(|h| h.to_string())).await }, |op| { @@ -118,7 +120,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { state.cached_json(&headers, state.timestamp_cache(Version::ONE, path.timestamp), &uri, move |q| q.block_by_timestamp(path.timestamp)).await }, |op| { @@ -140,7 +142,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { let strategy = state.block_cache(Version::ONE, &path.hash); state.cached_bytes(&headers, strategy, &uri, move |q| q.block_raw(&path.hash)).await }, @@ -165,7 +167,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { state.cached_json(&headers, state.block_status_cache(Version::ONE, &path.hash), &uri, move |q| q.block_status(&path.hash)).await }, |op| { @@ -186,7 +188,7 @@ impl BlockRoutes for ApiRouter { .api_route( "/api/blocks/tip/height", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state.cached_text(&headers, CacheStrategy::Tip, &uri, |q| Ok(q.indexed_height().to_string())).await }, |op| { @@ -203,7 +205,7 @@ impl BlockRoutes for ApiRouter { .api_route( "/api/blocks/tip/hash", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state.cached_text(&headers, CacheStrategy::Tip, &uri, |q| Ok(q.tip_blockhash().to_string())).await }, |op| { @@ -223,7 +225,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { let strategy = state.block_cache(Version::ONE, &path.hash); state.cached_text(&headers, strategy, &uri, move |q| q.block_txid_at_index(&path.hash, path.index).map(|t| t.to_string())).await }, @@ -248,7 +250,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { let strategy = state.block_cache(Version::ONE, &path.hash); state.cached_json(&headers, strategy, &uri, move |q| q.block_txids(&path.hash)).await }, @@ -273,7 +275,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { let strategy = state.block_cache(Version::ONE, &path.hash); state.cached_json(&headers, strategy, &uri, move |q| q.block_txs(&path.hash, TxIndex::default())).await }, @@ -299,7 +301,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { let strategy = state.block_cache(Version::ONE, &path.hash); state.cached_json(&headers, strategy, &uri, move |q| q.block_txs(&path.hash, path.start_index)).await }, @@ -322,7 +324,7 @@ impl BlockRoutes for ApiRouter { .api_route( "/api/blocks", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.blocks(None)) .await @@ -344,7 +346,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { state.cached_json(&headers, state.height_cache(Version::ONE, path.height), &uri, move |q| q.blocks(Some(path.height))).await }, |op| { @@ -364,7 +366,7 @@ impl BlockRoutes for ApiRouter { .api_route( "/api/v1/blocks", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.blocks_v1(None)) .await @@ -386,7 +388,7 @@ impl BlockRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(path): Path, - State(state): State| { + _: Empty, State(state): State| { state.cached_json(&headers, state.height_cache(Version::ONE, path.height), &uri, move |q| q.blocks_v1(Some(path.height))).await }, |op| { diff --git a/crates/brk_server/src/api/fees.rs b/crates/brk_server/src/api/fees.rs index 92be703e0..2a419c25c 100644 --- a/crates/brk_server/src/api/fees.rs +++ b/crates/brk_server/src/api/fees.rs @@ -5,7 +5,7 @@ use axum::{ }; use brk_types::{MempoolBlock, RecommendedFees}; -use crate::{AppState, extended::TransformResponseExtended}; +use crate::{AppState, extended::TransformResponseExtended, params::Empty}; pub trait FeesRoutes { fn add_fees_routes(self) -> Self; @@ -16,7 +16,7 @@ impl FeesRoutes for ApiRouter { self.api_route( "/api/v1/fees/mempool-blocks", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, state.mempool_cache(), &uri, |q| { q.mempool_blocks() @@ -37,7 +37,7 @@ impl FeesRoutes for ApiRouter { .api_route( "/api/v1/fees/recommended", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, state.mempool_cache(), &uri, |q| { q.recommended_fees() @@ -58,7 +58,7 @@ impl FeesRoutes for ApiRouter { .api_route( "/api/v1/fees/precise", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, state.mempool_cache(), &uri, |q| { q.recommended_fees() diff --git a/crates/brk_server/src/api/general.rs b/crates/brk_server/src/api/general.rs index 24c3d7403..4fa1af3de 100644 --- a/crates/brk_server/src/api/general.rs +++ b/crates/brk_server/src/api/general.rs @@ -6,7 +6,9 @@ use axum::{ use brk_types::{DifficultyAdjustment, HistoricalPrice, Prices, Timestamp, Version}; use crate::{ - AppState, CacheStrategy, extended::TransformResponseExtended, params::OptionalTimestampParam, + AppState, CacheStrategy, + extended::TransformResponseExtended, + params::{Empty, OptionalTimestampParam}, }; pub trait GeneralRoutes { @@ -18,7 +20,7 @@ impl GeneralRoutes for ApiRouter { self.api_route( "/api/v1/difficulty-adjustment", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Tip, &uri, |q| { q.difficulty_adjustment() @@ -39,7 +41,7 @@ impl GeneralRoutes for ApiRouter { .api_route( "/api/v1/prices", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, state.mempool_cache(), &uri, |q| { Ok(Prices { diff --git a/crates/brk_server/src/api/mempool.rs b/crates/brk_server/src/api/mempool.rs index 352f9725e..d4a1bdbd3 100644 --- a/crates/brk_server/src/api/mempool.rs +++ b/crates/brk_server/src/api/mempool.rs @@ -5,7 +5,7 @@ use axum::{ }; use brk_types::{Dollars, MempoolInfo, MempoolRecentTx, Txid}; -use crate::{AppState, extended::TransformResponseExtended}; +use crate::{AppState, extended::TransformResponseExtended, params::Empty}; pub trait MempoolRoutes { fn add_mempool_routes(self) -> Self; @@ -16,7 +16,7 @@ impl MempoolRoutes for ApiRouter { self.api_route( "/api/mempool", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, state.mempool_cache(), &uri, |q| q.mempool_info()) .await @@ -35,7 +35,7 @@ impl MempoolRoutes for ApiRouter { .api_route( "/api/mempool/txids", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, state.mempool_cache(), &uri, |q| q.mempool_txids()) .await @@ -54,7 +54,7 @@ impl MempoolRoutes for ApiRouter { .api_route( "/api/mempool/recent", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, state.mempool_cache(), &uri, |q| q.mempool_recent()) .await @@ -73,7 +73,7 @@ impl MempoolRoutes for ApiRouter { .api_route( "/api/mempool/price", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, state.mempool_cache(), &uri, |q| q.live_price()) .await diff --git a/crates/brk_server/src/api/metrics.rs b/crates/brk_server/src/api/metrics.rs index 065f4afbc..9ce44cc13 100644 --- a/crates/brk_server/src/api/metrics.rs +++ b/crates/brk_server/src/api/metrics.rs @@ -17,7 +17,7 @@ use brk_types::{ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use crate::{CacheStrategy, Error, extended::TransformResponseExtended}; +use crate::{CacheStrategy, Error, extended::TransformResponseExtended, params::Empty}; use super::AppState; use super::series_legacy; @@ -46,7 +46,7 @@ impl ApiMetricsLegacyRoutes for ApiRouter { .api_route( "/api/metrics", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Deploy, &uri, |q| Ok(q.series_catalog().clone())).await }, |op| op @@ -68,6 +68,7 @@ impl ApiMetricsLegacyRoutes for ApiRouter { async | uri: Uri, headers: HeaderMap, + _: Empty, State(state): State | { state.cached_json(&headers, CacheStrategy::Deploy, &uri, |q| Ok(q.series_count())).await @@ -91,6 +92,7 @@ impl ApiMetricsLegacyRoutes for ApiRouter { async | uri: Uri, headers: HeaderMap, + _: Empty, State(state): State | { state.cached_json(&headers, CacheStrategy::Deploy, &uri, |q| Ok(q.indexes().to_vec())).await @@ -186,6 +188,7 @@ impl ApiMetricsLegacyRoutes for ApiRouter { async | uri: Uri, headers: HeaderMap, + _: Empty, State(state): State, Path(path): Path | { @@ -273,6 +276,7 @@ impl ApiMetricsLegacyRoutes for ApiRouter { get_with( async |uri: Uri, headers: HeaderMap, + _: Empty, State(state): State, Path(path): Path| { state @@ -299,6 +303,7 @@ impl ApiMetricsLegacyRoutes for ApiRouter { get_with( async |uri: Uri, headers: HeaderMap, + _: Empty, State(state): State, Path(path): Path| { state @@ -325,6 +330,7 @@ impl ApiMetricsLegacyRoutes for ApiRouter { get_with( async |uri: Uri, headers: HeaderMap, + _: Empty, State(state): State, Path(path): Path| { state diff --git a/crates/brk_server/src/api/mining.rs b/crates/brk_server/src/api/mining.rs index c40bacb37..bde9892fa 100644 --- a/crates/brk_server/src/api/mining.rs +++ b/crates/brk_server/src/api/mining.rs @@ -14,7 +14,7 @@ use brk_types::{ use crate::{ AppState, CacheStrategy, extended::TransformResponseExtended, - params::{BlockCountParam, PoolSlugAndHeightParam, PoolSlugParam, TimePeriodParam}, + params::{BlockCountParam, Empty, PoolSlugAndHeightParam, PoolSlugParam, TimePeriodParam}, }; pub trait MiningRoutes { @@ -30,7 +30,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/pools", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { // Pool list is compiled-in, only changes on deploy state.cached_json(&headers, CacheStrategy::Deploy, &uri, |q| Ok(q.all_pools())).await }, @@ -48,7 +48,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/pools/{time_period}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.mining_pools(path.time_period)).await }, |op| { @@ -66,7 +66,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/pool/{slug}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.pool_detail(path.slug)).await }, |op| { @@ -84,7 +84,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/hashrate/pools", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, |q| q.pools_hashrate(None)).await }, |op| { @@ -101,7 +101,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/hashrate/pools/{time_period}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.pools_hashrate(Some(path.time_period))).await }, |op| { @@ -119,7 +119,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/pool/{slug}/hashrate", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.pool_hashrate(path.slug)).await }, |op| { @@ -137,7 +137,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/pool/{slug}/blocks", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.pool_blocks(path.slug, None)).await }, |op| { @@ -155,7 +155,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/pool/{slug}/blocks/{height}", get_with( - async |uri: Uri, headers: HeaderMap, Path(PoolSlugAndHeightParam {slug, height}): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(PoolSlugAndHeightParam {slug, height}): Path, _: Empty, State(state): State| { state.cached_json(&headers, state.height_cache(Version::ONE, height), &uri, move |q| q.pool_blocks(slug, Some(height))).await }, |op| { @@ -173,7 +173,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/hashrate", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, |q| q.hashrate(None)).await }, |op| { @@ -190,7 +190,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/hashrate/{time_period}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.hashrate(Some(path.time_period))).await }, |op| { @@ -208,7 +208,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/difficulty-adjustments", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, |q| q.difficulty_adjustments(None)).await }, |op| { @@ -225,7 +225,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/difficulty-adjustments/{time_period}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.difficulty_adjustments(Some(path.time_period))).await }, |op| { @@ -243,7 +243,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/reward-stats/{block_count}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.reward_stats(path.block_count)).await }, |op| { @@ -261,7 +261,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/blocks/fees/{time_period}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.block_fees(path.time_period)).await }, |op| { @@ -279,7 +279,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/blocks/rewards/{time_period}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.block_rewards(path.time_period)).await }, |op| { @@ -297,7 +297,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/blocks/fee-rates/{time_period}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.block_fee_rates(path.time_period)).await }, |op| { @@ -315,7 +315,7 @@ impl MiningRoutes for ApiRouter { .api_route( "/api/v1/mining/blocks/sizes-weights/{time_period}", get_with( - async |uri: Uri, headers: HeaderMap, Path(path): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(path): Path, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Tip, &uri, move |q| q.block_sizes_weights(path.time_period)).await }, |op| { diff --git a/crates/brk_server/src/api/series.rs b/crates/brk_server/src/api/series.rs index ba51526cc..29ad24bd3 100644 --- a/crates/brk_server/src/api/series.rs +++ b/crates/brk_server/src/api/series.rs @@ -25,7 +25,7 @@ use brk_types::{ use crate::{ AppState, CacheParams, CacheStrategy, Result, extended::{HeaderMapExtended, TransformResponseExtended}, - params::SeriesParam, + params::{Empty, SeriesParam}, }; /// Shared response pipeline for every series endpoint. @@ -42,9 +42,7 @@ pub(super) async fn serve( to_bytes: impl FnOnce(&BrkQuery, ResolvedQuery) -> BrkResult + Send + 'static, ) -> Result { let max_weight = state.max_weight_for(&addr); - let resolved = state - .run(move |q| q.resolve(params, max_weight)) - .await?; + let resolved = state.run(move |q| q.resolve(params, max_weight)).await?; let format = resolved.format(); let csv_filename = resolved.csv_filename(); @@ -114,7 +112,7 @@ impl ApiSeriesRoutes for ApiRouter { self.api_route( "/api/series", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state.cached_json(&headers, CacheStrategy::Deploy, &uri, |q| Ok(q.series_catalog().clone())).await }, |op| op @@ -135,6 +133,7 @@ impl ApiSeriesRoutes for ApiRouter { async | uri: Uri, headers: HeaderMap, + _: Empty, State(state): State | { state.cached_json(&headers, CacheStrategy::Deploy, &uri, |q| Ok(q.series_count())).await @@ -154,6 +153,7 @@ impl ApiSeriesRoutes for ApiRouter { async | uri: Uri, headers: HeaderMap, + _: Empty, State(state): State | { state.cached_json(&headers, CacheStrategy::Deploy, &uri, |q| Ok(q.indexes().to_vec())).await @@ -216,6 +216,7 @@ impl ApiSeriesRoutes for ApiRouter { async | uri: Uri, headers: HeaderMap, + _: Empty, State(state): State, Path(path): Path | { @@ -309,6 +310,7 @@ impl ApiSeriesRoutes for ApiRouter { get_with( async |uri: Uri, headers: HeaderMap, + _: Empty, State(state): State, Path(path): Path| { state @@ -334,6 +336,7 @@ impl ApiSeriesRoutes for ApiRouter { get_with( async |uri: Uri, headers: HeaderMap, + _: Empty, State(state): State, Path(path): Path| { state @@ -357,6 +360,7 @@ impl ApiSeriesRoutes for ApiRouter { get_with( async |uri: Uri, headers: HeaderMap, + _: Empty, State(state): State, Path(path): Path| { state diff --git a/crates/brk_server/src/api/series_legacy.rs b/crates/brk_server/src/api/series_legacy.rs index bb1195e8a..1ed848e93 100644 --- a/crates/brk_server/src/api/series_legacy.rs +++ b/crates/brk_server/src/api/series_legacy.rs @@ -29,6 +29,7 @@ use vecdb::ReadableOptionVec; use crate::{ AppState, CacheStrategy, Result, extended::{HeaderMapExtended, TransformResponseExtended}, + params::Empty, }; pub const SUNSET: &str = "2027-01-01T00:00:00Z"; @@ -43,7 +44,8 @@ pub async fn handler( Query(params): Query, State(state): State, ) -> Result { - let mut response = super::series::serve(state, uri, headers, addr, params, legacy_bytes).await?; + let mut response = + super::series::serve(state, uri, headers, addr, params, legacy_bytes).await?; if response.status() == StatusCode::OK { response.headers_mut().insert_deprecation(SUNSET); } @@ -151,7 +153,7 @@ impl ApiSeriesLegacyRoutes for ApiRouter { self.api_route( "/api/series/cost-basis", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Deploy, &uri, |q| q.urpd_cohorts()) .await @@ -177,6 +179,7 @@ impl ApiSeriesLegacyRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(params): Path, + _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Tip, &uri, move |q| { diff --git a/crates/brk_server/src/api/server.rs b/crates/brk_server/src/api/server.rs index 5161094c8..5072b736e 100644 --- a/crates/brk_server/src/api/server.rs +++ b/crates/brk_server/src/api/server.rs @@ -7,7 +7,7 @@ use axum::{ }; use brk_types::{DiskUsage, Health, SyncStatus}; -use crate::{CacheStrategy, VERSION, extended::TransformResponseExtended}; +use crate::{CacheStrategy, VERSION, extended::TransformResponseExtended, params::Empty}; use super::AppState; @@ -20,7 +20,7 @@ impl ServerRoutes for ApiRouter { self.api_route( "/health", get_with( - async |State(state): State| -> axum::Json { + async |_: Empty, State(state): State| -> axum::Json { let uptime = state.started_instant.elapsed(); let started_at = state.started_at.to_string(); let sync = state @@ -55,7 +55,7 @@ impl ServerRoutes for ApiRouter { .api_route( "/version", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Deploy, &uri, |_| { Ok(env!("CARGO_PKG_VERSION")) @@ -75,7 +75,7 @@ impl ServerRoutes for ApiRouter { .api_route( "/api/server/sync", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Tip, &uri, move |q| { let tip_height = q.client().get_last_height()?; @@ -99,7 +99,7 @@ impl ServerRoutes for ApiRouter { .api_route( "/api/server/disk", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { let brk_path = state.data_path.clone(); state .cached_json(&headers, CacheStrategy::Tip, &uri, move |q| { diff --git a/crates/brk_server/src/api/transactions.rs b/crates/brk_server/src/api/transactions.rs index ac02fc71b..695f214a1 100644 --- a/crates/brk_server/src/api/transactions.rs +++ b/crates/brk_server/src/api/transactions.rs @@ -5,15 +5,16 @@ use aide::axum::{ use axum::{ extract::{Path, State}, http::{HeaderMap, Uri}, + response::Response, }; use brk_types::{ CpfpInfo, MerkleProof, RbfResponse, Transaction, TxOutspend, TxStatus, Txid, Version, }; use crate::{ - AppState, CacheStrategy, + AppState, CacheStrategy, Error, Result, extended::TransformResponseExtended, - params::{TxIndexParam, TxidParam, TxidVout, TxidsParam}, + params::{Empty, TxIndexParam, TxidParam, TxidVout, TxidsParam}, }; pub trait TxRoutes { @@ -26,7 +27,7 @@ impl TxRoutes for ApiRouter { .api_route( "/api/tx-index/{index}", get_with( - async |uri: Uri, headers: HeaderMap, Path(param): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(param): Path, _: Empty, State(state): State| { state.cached_text(&headers, CacheStrategy::Immutable(Version::ONE), &uri, move |q| q.txid_by_index(param.index).map(|t| t.to_string())).await }, |op| op @@ -44,7 +45,7 @@ impl TxRoutes for ApiRouter { .api_route( "/api/v1/cpfp/{txid}", get_with( - async |uri: Uri, headers: HeaderMap, Path(param): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(param): Path, _: Empty, State(state): State| { state.cached_json(&headers, state.tx_cache(Version::ONE, ¶m.txid), &uri, move |q| q.cpfp(¶m.txid)).await }, |op| op @@ -62,7 +63,7 @@ impl TxRoutes for ApiRouter { .api_route( "/api/v1/tx/{txid}/rbf", get_with( - async |uri: Uri, headers: HeaderMap, Path(param): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(param): Path, _: Empty, State(state): State| { state.cached_json(&headers, state.mempool_cache(), &uri, move |q| q.tx_rbf(¶m.txid)).await }, |op| op @@ -84,6 +85,7 @@ impl TxRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(param): Path, + _: Empty, State(state): State | { state.cached_json(&headers, state.tx_cache(Version::ONE, ¶m.txid), &uri, move |q| q.transaction(¶m.txid)).await @@ -109,6 +111,7 @@ impl TxRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(param): Path, + _: Empty, State(state): State | { state.cached_text(&headers, state.tx_cache(Version::ONE, ¶m.txid), &uri, move |q| q.transaction_hex(¶m.txid)).await @@ -130,7 +133,7 @@ impl TxRoutes for ApiRouter { .api_route( "/api/tx/{txid}/merkleblock-proof", get_with( - async |uri: Uri, headers: HeaderMap, Path(param): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(param): Path, _: Empty, State(state): State| { state.cached_text(&headers, state.tx_cache(Version::ONE, ¶m.txid), &uri, move |q| q.merkleblock_proof(¶m.txid)).await }, |op| op @@ -148,7 +151,7 @@ impl TxRoutes for ApiRouter { .api_route( "/api/tx/{txid}/merkle-proof", get_with( - async |uri: Uri, headers: HeaderMap, Path(param): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(param): Path, _: Empty, State(state): State| { state.cached_json(&headers, state.tx_cache(Version::ONE, ¶m.txid), &uri, move |q| q.merkle_proof(¶m.txid)).await }, |op| op @@ -170,6 +173,7 @@ impl TxRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(path): Path, + _: Empty, State(state): State | { let v = Version::ONE; @@ -204,6 +208,7 @@ impl TxRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(param): Path, + _: Empty, State(state): State | { let v = Version::ONE; @@ -232,7 +237,7 @@ impl TxRoutes for ApiRouter { .api_route( "/api/tx/{txid}/raw", get_with( - async |uri: Uri, headers: HeaderMap, Path(param): Path, State(state): State| { + async |uri: Uri, headers: HeaderMap, Path(param): Path, _: Empty, State(state): State| { state.cached_bytes(&headers, state.tx_cache(Version::ONE, ¶m.txid), &uri, move |q| q.transaction_raw(¶m.txid)).await }, |op| op @@ -254,6 +259,7 @@ impl TxRoutes for ApiRouter { uri: Uri, headers: HeaderMap, Path(param): Path, + _: Empty, State(state): State | { state.cached_json(&headers, state.tx_cache(Version::ONE, ¶m.txid), &uri, move |q| q.transaction_status(¶m.txid)).await @@ -275,9 +281,10 @@ impl TxRoutes for ApiRouter { .api_route( "/api/v1/transaction-times", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { - let params = TxidsParam::from_query(uri.query().unwrap_or("")); - state.cached_json(&headers, state.mempool_cache(), &uri, move |q| q.transaction_times(¶ms.txids)).await + async |uri: Uri, headers: HeaderMap, State(state): State| -> Result { + let params = TxidsParam::from_query(uri.query().unwrap_or("")) + .map_err(Error::bad_request)?; + Ok(state.cached_json(&headers, state.mempool_cache(), &uri, move |q| q.transaction_times(¶ms.txids)).await) }, |op| op .id("get_transaction_times") @@ -292,12 +299,12 @@ impl TxRoutes for ApiRouter { .api_route( "/api/tx", post_with( - async |State(state): State, body: String| { + async |_: Empty, State(state): State, body: String| { let hex = body.trim().to_string(); state.run(move |q| q.broadcast_transaction(&hex)) .await .map(|txid| txid.to_string()) - .map_err(crate::Error::from) + .map_err(Error::from) }, |op| { op.id("post_tx") diff --git a/crates/brk_server/src/api/urpd.rs b/crates/brk_server/src/api/urpd.rs index 3ef4659cc..19e748b70 100644 --- a/crates/brk_server/src/api/urpd.rs +++ b/crates/brk_server/src/api/urpd.rs @@ -8,7 +8,7 @@ use brk_types::{Cohort, Date, Urpd, Version}; use crate::{ CacheStrategy, extended::TransformResponseExtended, - params::{UrpdCohortParam, UrpdParams, UrpdQuery}, + params::{Empty, UrpdCohortParam, UrpdParams, UrpdQuery}, }; use super::AppState; @@ -22,7 +22,7 @@ impl ApiUrpdRoutes for ApiRouter { self.api_route( "/api/urpd", get_with( - async |uri: Uri, headers: HeaderMap, State(state): State| { + async |uri: Uri, headers: HeaderMap, _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Deploy, &uri, |q| q.urpd_cohorts()) .await @@ -47,6 +47,7 @@ impl ApiUrpdRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, Path(params): Path, + _: Empty, State(state): State| { state .cached_json(&headers, CacheStrategy::Tip, &uri, move |q| { diff --git a/crates/brk_server/src/cache/mode.rs b/crates/brk_server/src/cache/mode.rs index beadd0afd..0c6ef44ec 100644 --- a/crates/brk_server/src/cache/mode.rs +++ b/crates/brk_server/src/cache/mode.rs @@ -52,9 +52,5 @@ pub(crate) fn init(mode: CdnCacheMode) { /// Cached-tier directive for stable responses. Defaults to `Live` if [`init`] /// was never called (tests, library use without a `Server`). pub(super) fn cdn_cached() -> &'static str { - CDN_CACHE_MODE - .get() - .copied() - .unwrap_or_default() - .as_str() + CDN_CACHE_MODE.get().copied().unwrap_or_default().as_str() } diff --git a/crates/brk_server/src/params/empty.rs b/crates/brk_server/src/params/empty.rs new file mode 100644 index 000000000..b3da3d1ee --- /dev/null +++ b/crates/brk_server/src/params/empty.rs @@ -0,0 +1,27 @@ +use aide::OperationInput; +use axum::{extract::FromRequestParts, http::request::Parts}; + +use crate::Error; + +/// Extractor that rejects requests carrying any query string. +/// Used on path-only endpoints to prevent cache-busting via injected +/// query params (the cache key includes the URI). +pub struct Empty; + +impl FromRequestParts for Empty +where + S: Send + Sync, +{ + type Rejection = Error; + + async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result { + match parts.uri.query() { + Some(q) if !q.is_empty() => Err(Error::bad_request(format!( + "this endpoint does not accept query parameters (got `?{q}`)" + ))), + _ => Ok(Empty), + } + } +} + +impl OperationInput for Empty {} diff --git a/crates/brk_server/src/params/mod.rs b/crates/brk_server/src/params/mod.rs index e62bc6c3b..31439c472 100644 --- a/crates/brk_server/src/params/mod.rs +++ b/crates/brk_server/src/params/mod.rs @@ -4,6 +4,7 @@ mod block_count_param; mod blockhash_param; mod blockhash_start_index; mod blockhash_tx_index; +mod empty; mod height_param; mod pool_slug_param; mod series_param; @@ -22,6 +23,7 @@ pub use block_count_param::*; pub use blockhash_param::*; pub use blockhash_start_index::*; pub use blockhash_tx_index::*; +pub use empty::*; pub use height_param::*; pub use pool_slug_param::*; pub use series_param::*; diff --git a/crates/brk_server/src/params/txids_param.rs b/crates/brk_server/src/params/txids_param.rs index b0d614b6d..c249394d9 100644 --- a/crates/brk_server/src/params/txids_param.rs +++ b/crates/brk_server/src/params/txids_param.rs @@ -13,19 +13,25 @@ pub struct TxidsParam { impl TxidsParam { /// Parsed manually from URI since serde_urlencoded doesn't support repeated keys. - pub fn from_query(query: &str) -> Self { - Self { - txids: query - .split('&') - .filter_map(|pair| { - let (key, val) = pair.split_once('=')?; - if key == "txId[]" || key == "txId%5B%5D" { - Txid::from_str(val).ok() - } else { - None - } - }) - .collect(), + /// Rejects unknown keys to prevent cache-busting via injected query params. + pub fn from_query(query: &str) -> Result { + if query.is_empty() { + return Ok(Self { txids: Vec::new() }); } + let mut txids = Vec::new(); + for pair in query.split('&') { + let (key, val) = pair.split_once('=').ok_or_else(|| { + format!("malformed query parameter `{pair}`, expected `txId[]=`") + })?; + if key == "txId[]" || key == "txId%5B%5D" { + let txid = Txid::from_str(val).map_err(|e| format!("invalid txid `{val}`: {e}"))?; + txids.push(txid); + } else { + return Err(format!( + "unknown query parameter `{key}`, expected `txId[]`" + )); + } + } + Ok(Self { txids }) } } diff --git a/crates/brk_server/src/state.rs b/crates/brk_server/src/state.rs index b97abb9fd..9a1b1a2f0 100644 --- a/crates/brk_server/src/state.rs +++ b/crates/brk_server/src/state.rs @@ -197,10 +197,9 @@ impl AppState { let encoding = ContentEncoding::negotiate(headers); let cache_key = format!("{}-{}-{}", uri, params.etag, encoding.as_str()); let result = self - .get_or_insert( - &cache_key, - async move { self.run(move |q| f(q, encoding)).await }, - ) + .get_or_insert(&cache_key, async move { + self.run(move |q| f(q, encoding)).await + }) .await; match result { @@ -296,7 +295,10 @@ impl AppState { uri, params, |h| { - h.insert(header::CONTENT_TYPE, HeaderValue::from_static("application/json")); + h.insert( + header::CONTENT_TYPE, + HeaderValue::from_static("application/json"), + ); }, move |_q, enc| { let value = value_result?; diff --git a/crates/brk_types/pools-v2.json b/crates/brk_types/pools-v2.json index 7d6c07c1f..6cf5390bd 100644 --- a/crates/brk_types/pools-v2.json +++ b/crates/brk_types/pools-v2.json @@ -2,8 +2,12 @@ { "id": 1, "name": "BlockFills", - "addresses": ["1PzVut5X6Nx7Mv4JHHKPtVM9Jr9LJ4Rbry"], - "tags": ["/BlockfillsPool/"], + "addresses": [ + "1PzVut5X6Nx7Mv4JHHKPtVM9Jr9LJ4Rbry" + ], + "tags": [ + "/BlockfillsPool/" + ], "link": "https://www.blockfills.com/mining" }, { @@ -13,7 +17,9 @@ "1EMVSMe1VJUuqv7D7SFzctnVXk4KdjXATi", "3C9sAKXrBVpJVe3b738yik4LPHpPmceBgd" ], - "tags": ["/ultimus/"], + "tags": [ + "/ultimus/" + ], "link": "https://www.ultimuspool.com" }, { @@ -24,7 +30,10 @@ "3Qqp7LwxmSjPwRaKkDToysJsM3xA4ThqFk", "bc1q39dled8an7enuxtmjql3pk7ny8kzvsxhd924sl" ], - "tags": ["terrapool.io", "Validated with Clean Energy"], + "tags": [ + "terrapool.io", + "Validated with Clean Energy" + ], "link": "https://terrapool.io" }, { @@ -35,7 +44,10 @@ "39bitUyBcUu3y3hRTtYprKbTp712t4ZWqK", "32BfKjhByDSxx3BM5vUkQ3NQq9csZR6nt6" ], - "tags": ["/LUXOR/", "Luxor Tech"], + "tags": [ + "/LUXOR/", + "Luxor Tech" + ], "link": "https://mining.luxor.tech" }, { @@ -45,7 +57,10 @@ "147SwRQdpCfj5p8PnfsXV2SsVVpVcz3aPq", "15vgygQ7ZsWdvZpctmTZK4673QBHsos6Sh" ], - "tags": ["/1THash&58COIN/", "/1THash/"], + "tags": [ + "/1THash&58COIN/", + "/1THash/" + ], "link": "https://www.1thash.top" }, { @@ -58,14 +73,22 @@ "3NA8hsjfdgVkmmVS9moHmkZsVCoLxUkvvv", "bc1qjl8uwezzlech723lpnyuza0h2cdkvxvh54v3dn" ], - "tags": ["/BTC.COM/", "/BTC.com/", "btccom"], + "tags": [ + "/BTC.COM/", + "/BTC.com/", + "btccom" + ], "link": "https://pool.btc.com" }, { "id": 7, "name": "Bitfarms", - "addresses": ["3GvEGtnvgeBJ3p3EpdZhvUkxY4pDARkbjd"], - "tags": ["BITFARMS"], + "addresses": [ + "3GvEGtnvgeBJ3p3EpdZhvUkxY4pDARkbjd" + ], + "tags": [ + "BITFARMS" + ], "link": "https://www.bitfarms.io" }, { @@ -77,70 +100,100 @@ "1MvYASoHjqynMaMnP7SBmenyEWiLsTqoU6", "3HuobiNg2wHjdPU2mQczL9on8WF7hZmaGd" ], - "tags": ["/HuoBi/", "/Huobi/"], + "tags": [ + "/HuoBi/", + "/Huobi/" + ], "link": "https://www.hpt.com" }, { "id": 9, "name": "WAYI.CN", "addresses": [], - "tags": ["/E2M & BTC.TOP/"], + "tags": [ + "/E2M & BTC.TOP/" + ], "link": "https://www.easy2mine.com" }, { "id": 10, "name": "CanoePool", - "addresses": ["1GP8eWArgpwRum76saJS4cZKCHWJHs9PQo"], - "tags": ["/CANOE/", "/canoepool/"], + "addresses": [ + "1GP8eWArgpwRum76saJS4cZKCHWJHs9PQo" + ], + "tags": [ + "/CANOE/", + "/canoepool/" + ], "link": "https://btc.canoepool.com" }, { "id": 11, "name": "BTC.TOP", - "addresses": ["1Hz96kJKF2HLPGY15JWLB5m9qGNxvt8tHJ"], - "tags": ["/BTC.TOP/"], + "addresses": [ + "1Hz96kJKF2HLPGY15JWLB5m9qGNxvt8tHJ" + ], + "tags": [ + "/BTC.TOP/" + ], "link": "https://btc.top" }, { "id": 12, "name": "Bitcoin.com", "addresses": [], - "tags": ["pool.bitcoin.com"], + "tags": [ + "pool.bitcoin.com" + ], "link": "https://www.bitcoin.com" }, { "id": 13, "name": "175btc", "addresses": [], - "tags": ["Mined By 175btc.com"], + "tags": [ + "Mined By 175btc.com" + ], "link": "https://www.175btc.com" }, { "id": 14, "name": "GBMiners", "addresses": [], - "tags": ["/mined by gbminers/"], + "tags": [ + "/mined by gbminers/" + ], "link": "https://gbminers.com" }, { "id": 15, "name": "A-XBT", - "addresses": ["1MFsp2txCPwMMBJjNNeKaduGGs8Wi1Ce7X"], - "tags": ["/A-XBT/"], + "addresses": [ + "1MFsp2txCPwMMBJjNNeKaduGGs8Wi1Ce7X" + ], + "tags": [ + "/A-XBT/" + ], "link": "https://www.a-xbt.com" }, { "id": 16, "name": "ASICMiner", "addresses": [], - "tags": ["ASICMiner"], + "tags": [ + "ASICMiner" + ], "link": "https://www.asicminer.co" }, { "id": 17, "name": "BitMinter", - "addresses": ["19PkHafEN18mquJ9ChwZt5YEFoCdPP5vYB"], - "tags": ["BitMinter"], + "addresses": [ + "19PkHafEN18mquJ9ChwZt5YEFoCdPP5vYB" + ], + "tags": [ + "BitMinter" + ], "link": "https://bitminter.com" }, { @@ -150,42 +203,55 @@ "14R2r9FkyDmyxGB9xUVwVLdgsX9YfdVamk", "165GCEAx81wce33FWEnPCRhdjcXCrBJdKn" ], - "tags": ["/Bitcoin-Russia.ru/"], + "tags": [ + "/Bitcoin-Russia.ru/" + ], "link": "https://bitcoin-russia.ru" }, { "id": 19, "name": "BTCServ", "addresses": [], - "tags": ["btcserv"], + "tags": [ + "btcserv" + ], "link": "https://btcserv.net" }, { "id": 20, "name": "simplecoin.us", "addresses": [], - "tags": ["simplecoin"], + "tags": [ + "simplecoin" + ], "link": "https://simplecoin.us" }, { "id": 21, "name": "BTC Guild", "addresses": [], - "tags": ["BTC Guild"], + "tags": [ + "BTC Guild" + ], "link": "https://www.btcguild.com" }, { "id": 22, "name": "Eligius", "addresses": [], - "tags": ["Eligius"], + "tags": [ + "Eligius" + ], "link": "https://eligius.st" }, { "id": 23, "name": "OzCoin", "addresses": [], - "tags": ["ozco.in", "ozcoin"], + "tags": [ + "ozco.in", + "ozcoin" + ], "link": "https://ozcoin.net" }, { @@ -195,63 +261,85 @@ "15xiShqUqerfjFdyfgBH1K7Gwp6cbYmsTW", "18M9o2mXNjNR96yKe7eyY6pfP6Nx4Nso3d" ], - "tags": ["EMC ", "EMC:"], + "tags": [ + "EMC ", + "EMC:" + ], "link": "https://eclipsemc.com" }, { "id": 25, "name": "MaxBTC", "addresses": [], - "tags": ["MaxBTC"], + "tags": [ + "MaxBTC" + ], "link": "https://maxbtc.com" }, { "id": 26, "name": "TripleMining", "addresses": [], - "tags": ["Triplemining.com", "triplemining"], + "tags": [ + "Triplemining.com", + "triplemining" + ], "link": "https://www.triplemining.com" }, { "id": 27, "name": "CoinLab", "addresses": [], - "tags": ["CoinLab"], + "tags": [ + "CoinLab" + ], "link": "https://coinlab.com" }, { "id": 28, "name": "50BTC", "addresses": [], - "tags": ["50BTC"], + "tags": [ + "50BTC" + ], "link": "https://www.50btc.com" }, { "id": 29, "name": "GHash.IO", - "addresses": ["1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC"], - "tags": ["ghash.io"], + "addresses": [ + "1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC" + ], + "tags": [ + "ghash.io" + ], "link": "https://ghash.io" }, { "id": 30, "name": "ST Mining Corp", "addresses": [], - "tags": ["st mining corp"], + "tags": [ + "st mining corp" + ], "link": "https://bitcointalk.org/index.php?topic=77000.msg3207708#msg3207708" }, { "id": 31, "name": "Bitparking", "addresses": [], - "tags": ["bitparking"], + "tags": [ + "bitparking" + ], "link": "https://mmpool.bitparking.com" }, { "id": 32, "name": "mmpool", "addresses": [], - "tags": ["mmpool"], + "tags": [ + "mmpool" + ], "link": "https://mmpool.org/pool" }, { @@ -265,21 +353,30 @@ "1JrYhdhP2jCY6JwuVzdk9jUwc4pctcSes7", "1Nsvmnv8VcTMD643xMYAo35Aco3XA5YPpe" ], - "tags": ["by polmine.pl", "bypmneU"], + "tags": [ + "by polmine.pl", + "bypmneU" + ], "link": "https://polmine.pl" }, { "id": 34, "name": "KnCMiner", "addresses": [], - "tags": ["KnCMiner"], + "tags": [ + "KnCMiner" + ], "link": "https://portal.kncminer.com/pool" }, { "id": 35, "name": "Bitalo", - "addresses": ["1HTejfsPZQGi3afCMEZTn2xdmoNzp13n3F"], - "tags": ["Bitalo"], + "addresses": [ + "1HTejfsPZQGi3afCMEZTn2xdmoNzp13n3F" + ], + "tags": [ + "Bitalo" + ], "link": "https://bitalo.com/mining" }, { @@ -289,49 +386,67 @@ "1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY", "bc1qf274x7penhcd8hsv3jcmwa5xxzjl2a6pa9pxwm" ], - "tags": ["七彩神仙鱼", "F2Pool", "🐟"], + "tags": [ + "七彩神仙鱼", + "F2Pool", + "🐟" + ], "link": "https://www.f2pool.com" }, { "id": 37, "name": "HHTT", "addresses": [], - "tags": ["HHTT"], + "tags": [ + "HHTT" + ], "link": "https://hhtt.1209k.com" }, { "id": 38, "name": "MegaBigPower", - "addresses": ["1K7znxRfkS8R1hcmyMvHDum1hAQreS4VQ4"], - "tags": ["megabigpower.com"], + "addresses": [ + "1K7znxRfkS8R1hcmyMvHDum1hAQreS4VQ4" + ], + "tags": [ + "megabigpower.com" + ], "link": "https://megabigpower.com" }, { "id": 39, "name": "Mt Red", "addresses": [], - "tags": ["/mtred/"], + "tags": [ + "/mtred/" + ], "link": "https://mtred.com" }, { "id": 40, "name": "NMCbit", "addresses": [], - "tags": ["nmcbit.com"], + "tags": [ + "nmcbit.com" + ], "link": "https://nmcbit.com" }, { "id": 41, "name": "Yourbtc.net", "addresses": [], - "tags": ["yourbtc.net"], + "tags": [ + "yourbtc.net" + ], "link": "https://yourbtc.net" }, { "id": 42, "name": "Give Me Coins", "addresses": [], - "tags": ["Give-Me-Coins"], + "tags": [ + "Give-Me-Coins" + ], "link": "https://give-me-coins.com" }, { @@ -341,7 +456,9 @@ "1AqTMY7kmHZxBuLUR5wJjPFUvqGs23sesr", "1CK6KHY6MHgYvmRQ4PAafKYDrg1ejbH1cE" ], - "tags": ["/slush/"], + "tags": [ + "/slush/" + ], "link": "https://braiins.com/pool" }, { @@ -386,98 +503,144 @@ "1jLVpwtNMfXWaHY4eiLDmGuBxokYLgv1X", "3FaYVQF6wCMUB9NCeRe4tUp1zZx8qqM7H1" ], - "tags": ["/AntPool/", "Mined By AntPool", "Mined by AntPool"], + "tags": [ + "/AntPool/", + "Mined By AntPool", + "Mined by AntPool" + ], "link": "https://www.antpool.com" }, { "id": 45, "name": "MultiCoin.co", "addresses": [], - "tags": ["Mined by MultiCoin.co"], + "tags": [ + "Mined by MultiCoin.co" + ], "link": "https://multicoin.co" }, { "id": 46, "name": "bcpool.io", "addresses": [], - "tags": ["bcpool.io"], + "tags": [ + "bcpool.io" + ], "link": "https://bcpool.io" }, { "id": 47, "name": "Cointerra", - "addresses": ["1BX5YoLwvqzvVwSrdD4dC32vbouHQn2tuF"], - "tags": ["cointerra"], + "addresses": [ + "1BX5YoLwvqzvVwSrdD4dC32vbouHQn2tuF" + ], + "tags": [ + "cointerra" + ], "link": "https://cointerra.com" }, { "id": 48, "name": "KanoPool", "addresses": [], - "tags": ["Kano"], + "tags": [ + "Kano" + ], "link": "https://kano.is" }, { "id": 49, "name": "Solo CK", "addresses": [], - "tags": ["/solo.ckpool.org/"], + "tags": [ + "/solo.ckpool.org/" + ], "link": "https://solo.ckpool.org" }, { "id": 50, "name": "CKPool", "addresses": [], - "tags": ["/ckpool.org/"], + "tags": [ + "/ckpool.org/" + ], "link": "https://ckpool.org" }, { "id": 51, "name": "NiceHash", "addresses": [], - "tags": ["/NiceHashSolo", "/NiceHash/", "/NiceHashMining/"], + "tags": [ + "/NiceHashSolo", + "/NiceHash/", + "/NiceHashMining/" + ], "link": "https://www.nicehash.com" }, { "id": 52, "name": "BitClub", - "addresses": ["155fzsEBHy9Ri2bMQ8uuuR3tv1YzcDywd4"], - "tags": ["/BitClub Network/"], + "addresses": [ + "155fzsEBHy9Ri2bMQ8uuuR3tv1YzcDywd4" + ], + "tags": [ + "/BitClub Network/" + ], "link": "https://bitclubpool.com" }, { "id": 53, "name": "Bitcoin Affiliate Network", "addresses": [], - "tags": ["bitcoinaffiliatenetwork.com"], + "tags": [ + "bitcoinaffiliatenetwork.com" + ], "link": "https://mining.bitcoinaffiliatenetwork.com" }, { "id": 54, "name": "BTCC", - "addresses": ["152f1muMCNa7goXYhYAQC61hxEgGacmncB"], - "tags": ["/BTCC/", "BTCChina Pool", "BTCChina.com", "btcchina.com"], + "addresses": [ + "152f1muMCNa7goXYhYAQC61hxEgGacmncB" + ], + "tags": [ + "/BTCC/", + "BTCChina Pool", + "BTCChina.com", + "btcchina.com" + ], "link": "https://pool.btcc.com" }, { "id": 55, "name": "BWPool", - "addresses": ["1JLRXD8rjRgQtTS9MvfQALfHgGWau9L9ky"], - "tags": ["BW Pool", "BWPool"], + "addresses": [ + "1JLRXD8rjRgQtTS9MvfQALfHgGWau9L9ky" + ], + "tags": [ + "BW Pool", + "BWPool" + ], "link": "https://bwpool.net" }, { "id": 56, "name": "EXX&BW", "addresses": [], - "tags": ["xbtc.exx.com&bw.com"], + "tags": [ + "xbtc.exx.com&bw.com" + ], "link": "https://xbtc.exx.com" }, { "id": 57, "name": "Bitsolo", - "addresses": ["18zRehBcA2YkYvsC7dfQiFJNyjmWvXsvon"], - "tags": ["Bitsolo Pool"], + "addresses": [ + "18zRehBcA2YkYvsC7dfQiFJNyjmWvXsvon" + ], + "tags": [ + "Bitsolo Pool" + ], "link": "https://bitsolo.net" }, { @@ -487,7 +650,10 @@ "14yfxkcpHnju97pecpM7fjuTkVdtbkcfE6", "1AcAj9p6zJn4xLXdvmdiuPCtY7YkBPTAJo" ], - "tags": ["/BitFury/", "/Bitfury/"], + "tags": [ + "/BitFury/", + "/Bitfury/" + ], "link": "https://bitfury.com" }, { @@ -498,84 +664,124 @@ "1CdJi2xRTXJF6CEJqNHYyQDNEcM3X7fUhD", "1GC6HxDvnchDdb5cGkFXsJMZBFRsKAXfwi" ], - "tags": ["/pool34/"], + "tags": [ + "/pool34/" + ], "link": "https://21.co" }, { "id": 60, "name": "digitalBTC", - "addresses": ["1MimPd6LrPKGftPRHWdfk8S3KYBfN4ELnD"], - "tags": ["/agentD/"], + "addresses": [ + "1MimPd6LrPKGftPRHWdfk8S3KYBfN4ELnD" + ], + "tags": [ + "/agentD/" + ], "link": "https://digitalbtc.com" }, { "id": 61, "name": "8baochi", - "addresses": ["1Hk9gD8xMo2XBUhE73y5zXEM8xqgffTB5f"], - "tags": ["/八宝池 8baochi.com/"], + "addresses": [ + "1Hk9gD8xMo2XBUhE73y5zXEM8xqgffTB5f" + ], + "tags": [ + "/八宝池 8baochi.com/" + ], "link": "https://8baochi.com" }, { "id": 62, "name": "myBTCcoin Pool", - "addresses": ["151T7r1MhizzJV6dskzzUkUdr7V8JxV2Dx"], - "tags": ["myBTCcoin Pool"], + "addresses": [ + "151T7r1MhizzJV6dskzzUkUdr7V8JxV2Dx" + ], + "tags": [ + "myBTCcoin Pool" + ], "link": "https://mybtccoin.com" }, { "id": 63, "name": "TBDice", - "addresses": ["1BUiW44WuJ2jiJgXiyxJVFMN8bc1GLdXRk"], - "tags": ["TBDice"], + "addresses": [ + "1BUiW44WuJ2jiJgXiyxJVFMN8bc1GLdXRk" + ], + "tags": [ + "TBDice" + ], "link": "https://tbdice.org" }, { "id": 64, "name": "HASHPOOL", "addresses": [], - "tags": ["HASHPOOL"], + "tags": [ + "HASHPOOL" + ], "link": "https://hashpool.com" }, { "id": 65, "name": "Nexious", - "addresses": ["1GBo1f2tzVx5jScV9kJXPUP9RjvYXuNzV7"], - "tags": ["/Nexious/"], + "addresses": [ + "1GBo1f2tzVx5jScV9kJXPUP9RjvYXuNzV7" + ], + "tags": [ + "/Nexious/" + ], "link": "https://nexious.com" }, { "id": 66, "name": "Bravo Mining", "addresses": [], - "tags": ["/bravo-mining/"], + "tags": [ + "/bravo-mining/" + ], "link": "https://www.bravo-mining.com" }, { "id": 67, "name": "HotPool", - "addresses": ["17judvK4AC2M6KhaBbAEGw8CTKc9Pg8wup"], - "tags": ["/HotPool/"], + "addresses": [ + "17judvK4AC2M6KhaBbAEGw8CTKc9Pg8wup" + ], + "tags": [ + "/HotPool/" + ], "link": "https://hotpool.co" }, { "id": 68, "name": "OKExPool", "addresses": [], - "tags": ["/www.okex.com/"], + "tags": [ + "/www.okex.com/" + ], "link": "https://www.okex.com" }, { "id": 69, "name": "BCMonster", - "addresses": ["1E18BNyobcoiejcDYAz5SjbrzifNDEpM88"], - "tags": ["/BCMonster/"], + "addresses": [ + "1E18BNyobcoiejcDYAz5SjbrzifNDEpM88" + ], + "tags": [ + "/BCMonster/" + ], "link": "https://www.bcmonster.com" }, { "id": 70, "name": "1Hash", - "addresses": ["1F1xcRt8H8Wa623KqmkEontwAAVqDSAWCV"], - "tags": ["Mined by 1hash.com"], + "addresses": [ + "1F1xcRt8H8Wa623KqmkEontwAAVqDSAWCV" + ], + "tags": [ + "Mined by 1hash.com" + ], "link": "https://www.1hash.com" }, { @@ -585,77 +791,110 @@ "13hQVEstgo4iPQZv9C7VELnLWF7UWtF4Q3", "1KsFhYKLs8qb1GHqrPxHoywNQpet2CtP9t" ], - "tags": ["/Bixin/", "/HaoBTC/", "HAOBTC"], + "tags": [ + "/Bixin/", + "/HaoBTC/", + "HAOBTC" + ], "link": "https://haopool.com" }, { "id": 72, "name": "TATMAS Pool", "addresses": [], - "tags": ["/ViaBTC/TATMAS Pool/"], + "tags": [ + "/ViaBTC/TATMAS Pool/" + ], "link": "https://tmsminer.com" }, { "id": 73, "name": "ViaBTC", "addresses": [], - "tags": ["/ViaBTC/", "viabtc.com deploy"], + "tags": [ + "/ViaBTC/", + "viabtc.com deploy" + ], "link": "https://viabtc.com" }, { "id": 74, "name": "ConnectBTC", - "addresses": ["1KPQkehgYAqwiC6UCcbojM3mbGjURrQJF2"], - "tags": ["/ConnectBTC - Home for Miners/"], + "addresses": [ + "1KPQkehgYAqwiC6UCcbojM3mbGjURrQJF2" + ], + "tags": [ + "/ConnectBTC - Home for Miners/" + ], "link": "https://www.connectbtc.com" }, { "id": 75, "name": "BATPOOL", - "addresses": ["167ApWWxUSFQmz2jdz9xop3oAKdLejvMML"], - "tags": ["/BATPOOL/"], + "addresses": [ + "167ApWWxUSFQmz2jdz9xop3oAKdLejvMML" + ], + "tags": [ + "/BATPOOL/" + ], "link": "https://www.batpool.com" }, { "id": 76, "name": "Waterhole", - "addresses": ["1FLH1SoLv4U68yUERhDiWzrJn5TggMqkaZ"], - "tags": ["/WATERHOLE.IO/"], + "addresses": [ + "1FLH1SoLv4U68yUERhDiWzrJn5TggMqkaZ" + ], + "tags": [ + "/WATERHOLE.IO/" + ], "link": "https://btc.waterhole.io" }, { "id": 77, "name": "DCExploration", "addresses": [], - "tags": ["/DCExploration/"], + "tags": [ + "/DCExploration/" + ], "link": "https://dcexploration.cn" }, { "id": 78, "name": "DCEX", "addresses": [], - "tags": ["/DCEX/"], + "tags": [ + "/DCEX/" + ], "link": "https://dcexploration.cn" }, { "id": 79, "name": "BTPOOL", "addresses": [], - "tags": ["/BTPOOL/"], + "tags": [ + "/BTPOOL/" + ], "link": "" }, { "id": 80, "name": "58COIN", - "addresses": ["199EDJoCpqV672qESEkfFgEqNT1iR2gj3t"], - "tags": ["/58coin.com/"], + "addresses": [ + "199EDJoCpqV672qESEkfFgEqNT1iR2gj3t" + ], + "tags": [ + "/58coin.com/" + ], "link": "https://www.58coin.com" }, { "id": 81, "name": "Bitcoin India", "addresses": [], - "tags": ["/Bitcoin-India/"], + "tags": [ + "/Bitcoin-India/" + ], "link": "https://bitcoin-india.org" }, { @@ -665,35 +904,52 @@ "12znnESiJ3bgCLftwwrg9wzQKN8fJtoBDa", "18HEMWFXM9UGPVZHUMdBPD3CMFWYn2NPRX" ], - "tags": ["--Nug--"], + "tags": [ + "--Nug--" + ], "link": "https://www.brainofshawn.com" }, { "id": 83, "name": "PHash.IO", "addresses": [], - "tags": ["/phash.cn/", "/phash.io/"], + "tags": [ + "/phash.cn/", + "/phash.io/" + ], "link": "https://phash.io" }, { "id": 84, "name": "RigPool", - "addresses": ["1JpKmtspBJQVXK67DJP64eBJcAPhDvJ9Er"], - "tags": ["/RigPool.com/"], + "addresses": [ + "1JpKmtspBJQVXK67DJP64eBJcAPhDvJ9Er" + ], + "tags": [ + "/RigPool.com/" + ], "link": "https://www.rigpool.com" }, { "id": 85, "name": "HAOZHUZHU", - "addresses": ["19qa95rTbDziNCS9EexUbh2hVY4viUU9tt"], - "tags": ["/haozhuzhu/"], + "addresses": [ + "19qa95rTbDziNCS9EexUbh2hVY4viUU9tt" + ], + "tags": [ + "/haozhuzhu/" + ], "link": "https://haozhuzhu.com" }, { "id": 86, "name": "7pool", - "addresses": ["1JLc3JxvpdL1g5zoX8sKLP4BkJQiwnJftU"], - "tags": ["/$Mined by 7pool.com/"], + "addresses": [ + "1JLc3JxvpdL1g5zoX8sKLP4BkJQiwnJftU" + ], + "tags": [ + "/$Mined by 7pool.com/" + ], "link": "https://7pool.com" }, { @@ -704,21 +960,29 @@ "1EowSPumj9D9AMTpE64Jr7vT3PJDNopVcz", "1KGbsDDAgJN2HDNBjmMHp9828qATo5B9c9" ], - "tags": ["/mined by poopbut/"], + "tags": [ + "/mined by poopbut/" + ], "link": "https://miningkings.com" }, { "id": 88, "name": "HashBX", "addresses": [], - "tags": ["/Mined by HashBX.io/"], + "tags": [ + "/Mined by HashBX.io/" + ], "link": "https://hashbx.io" }, { "id": 89, "name": "DPOOL", - "addresses": ["1ACAgPuFFidYzPMXbiKptSrwT74Dg8hq2v"], - "tags": ["/DPOOL.TOP/"], + "addresses": [ + "1ACAgPuFFidYzPMXbiKptSrwT74Dg8hq2v" + ], + "tags": [ + "/DPOOL.TOP/" + ], "link": "https://www.dpool.top" }, { @@ -734,28 +998,36 @@ "bc1qru8mtv3e3u7ms6ecjmwgeakdakclemvhnw00q9", "bc1qwlrsvgtn99rqp3fgaxq6f6jkgms80rnej0a8tc" ], - "tags": ["/Rawpool.com/"], + "tags": [ + "/Rawpool.com/" + ], "link": "https://www.rawpool.com" }, { "id": 91, "name": "haominer", "addresses": [], - "tags": ["/haominer/"], + "tags": [ + "/haominer/" + ], "link": "https://haominer.com" }, { "id": 92, "name": "Helix", "addresses": [], - "tags": ["/Helix/"], + "tags": [ + "/Helix/" + ], "link": "" }, { "id": 93, "name": "Bitcoin-Ukraine", "addresses": [], - "tags": ["/Bitcoin-Ukraine.com.ua/"], + "tags": [ + "/Bitcoin-Ukraine.com.ua/" + ], "link": "https://bitcoin-ukraine.com.ua" }, { @@ -770,56 +1042,80 @@ "3JQSigWTCHyBLRD979JWgEtWP5YiiFwcQB", "3KJrsjfg1dD6CrsTeHdHVH3KqMpvL2XWQn" ], - "tags": ["/poolin.com", "/poolin/"], + "tags": [ + "/poolin.com", + "/poolin/" + ], "link": "https://www.poolin.com" }, { "id": 95, "name": "SecretSuperstar", "addresses": [], - "tags": ["/SecretSuperstar/"], + "tags": [ + "/SecretSuperstar/" + ], "link": "" }, { "id": 96, "name": "tigerpool.net", "addresses": [], - "tags": ["/tigerpool.net"], + "tags": [ + "/tigerpool.net" + ], "link": "" }, { "id": 97, "name": "Sigmapool.com", - "addresses": ["12cKiMNhCtBhZRUBCnYXo8A4WQzMUtYjmR"], - "tags": ["/Sigmapool.com/"], + "addresses": [ + "12cKiMNhCtBhZRUBCnYXo8A4WQzMUtYjmR" + ], + "tags": [ + "/Sigmapool.com/" + ], "link": "https://sigmapool.com" }, { "id": 98, "name": "okpool.top", "addresses": [], - "tags": ["/www.okpool.top/"], + "tags": [ + "/www.okpool.top/" + ], "link": "https://www.okpool.top" }, { "id": 99, "name": "Hummerpool", "addresses": [], - "tags": ["HummerPool", "Hummerpool"], + "tags": [ + "HummerPool", + "Hummerpool" + ], "link": "https://www.hummerpool.com" }, { "id": 100, "name": "Tangpool", - "addresses": ["12Taz8FFXQ3E2AGn3ZW1SZM5bLnYGX4xR6"], - "tags": ["/Tangpool/"], + "addresses": [ + "12Taz8FFXQ3E2AGn3ZW1SZM5bLnYGX4xR6" + ], + "tags": [ + "/Tangpool/" + ], "link": "https://www.tangpool.com" }, { "id": 101, "name": "BytePool", - "addresses": ["39m5Wvn9ZqyhYmCYpsyHuGMt5YYw4Vmh1Z"], - "tags": ["/bytepool.com/"], + "addresses": [ + "39m5Wvn9ZqyhYmCYpsyHuGMt5YYw4Vmh1Z" + ], + "tags": [ + "/bytepool.com/" + ], "link": "https://www.bytepool.com" }, { @@ -830,21 +1126,31 @@ "38u1srayb1oybVB43UWKBJsrwJbdHGtPx2", "1BM1sAcrfV6d4zPKytzziu4McLQDsFC2Qc" ], - "tags": ["SpiderPool"], + "tags": [ + "SpiderPool" + ], "link": "https://www.spiderpool.com" }, { "id": 103, "name": "NovaBlock", - "addresses": ["3Bmb9Jig8A5kHdDSxvDZ6eryj3AXd3swuJ"], - "tags": ["/NovaBlock/"], + "addresses": [ + "3Bmb9Jig8A5kHdDSxvDZ6eryj3AXd3swuJ" + ], + "tags": [ + "/NovaBlock/" + ], "link": "https://novablock.com" }, { "id": 104, "name": "MiningCity", - "addresses": ["11wC5KcbgrWRBb43cwADdVrxgyF8mndVC"], - "tags": ["MiningCity"], + "addresses": [ + "11wC5KcbgrWRBb43cwADdVrxgyF8mndVC" + ], + "tags": [ + "MiningCity" + ], "link": "https://www.miningcity.com" }, { @@ -859,42 +1165,68 @@ "bc1qx9t2l3pyny2spqpqlye8svce70nppwtaxwdrp4", "3G7jcEELKh38L6kaSV8K35pTqsh5bgZW2D" ], - "tags": ["/Binance/", "binance"], + "tags": [ + "/Binance/", + "binance" + ], "link": "https://pool.binance.com" }, { "id": 106, "name": "Minerium", "addresses": [], - "tags": ["/Mined in the USA by: /Minerium.com/", "/Minerium.com/"], + "tags": [ + "/Mined in the USA by: /Minerium.com/", + "/Minerium.com/" + ], "link": "https://www.minerium.com" }, { "id": 107, "name": "Lubian.com", - "addresses": ["34Jpa4Eu3ApoPVUKNTN2WeuXVVq1jzxgPi"], - "tags": ["/Buffett/", "/lubian.com/"], + "addresses": [ + "34Jpa4Eu3ApoPVUKNTN2WeuXVVq1jzxgPi" + ], + "tags": [ + "/Buffett/", + "/lubian.com/" + ], "link": "https://www.lubian.com" }, { "id": 108, "name": "OKKONG", - "addresses": ["16JHXJ7M2MubWNX9grnqbjUqJ5PHwcCWw2"], - "tags": ["/hash.okkong.com/"], + "addresses": [ + "16JHXJ7M2MubWNX9grnqbjUqJ5PHwcCWw2" + ], + "tags": [ + "/hash.okkong.com/" + ], "link": "https://hash.okkong.com" }, { "id": 109, "name": "AAO Pool", - "addresses": ["12QVFmJH2b4455YUHkMpEnWLeRY3eJ4Jb5"], - "tags": ["/AAOPOOL/"], + "addresses": [ + "12QVFmJH2b4455YUHkMpEnWLeRY3eJ4Jb5" + ], + "tags": [ + "/AAOPOOL/" + ], "link": "https://btc.tmspool.top" }, { "id": 110, "name": "EMCDPool", - "addresses": ["1BDbsWi3Mrcjp1wdop3PWFNCNZtu4R7Hjy"], - "tags": ["/EMCD/", "/one_more_mcd/", "get___emcd", "emcd"], + "addresses": [ + "1BDbsWi3Mrcjp1wdop3PWFNCNZtu4R7Hjy" + ], + "tags": [ + "/EMCD/", + "/one_more_mcd/", + "get___emcd", + "emcd" + ], "link": "https://pool.emcd.io" }, { @@ -906,28 +1238,41 @@ "bc1qxhmdufsvnuaaaer4ynz88fspdsxq2h9e9cetdj", "bc1p8k4v4xuz55dv49svzjg43qjxq2whur7ync9tm0xgl5t4wjl9ca9snxgmlt" ], - "tags": ["/2cDw/", "Foundry USA Pool"], + "tags": [ + "/2cDw/", + "Foundry USA Pool" + ], "link": "https://foundrydigital.com" }, { "id": 112, "name": "SBI Crypto", "addresses": [], - "tags": ["/SBICrypto.com Pool/", "SBI Crypto", "SBICrypto"], + "tags": [ + "/SBICrypto.com Pool/", + "SBI Crypto", + "SBICrypto" + ], "link": "https://sbicrypto.com" }, { "id": 113, "name": "ArkPool", - "addresses": ["1QEiAhdHdMhBgVbDM7zUXWGkNhgEEJ6uLd"], - "tags": ["/ArkPool/"], + "addresses": [ + "1QEiAhdHdMhBgVbDM7zUXWGkNhgEEJ6uLd" + ], + "tags": [ + "/ArkPool/" + ], "link": "https://www.arkpool.com" }, { "id": 114, "name": "PureBTC.COM", "addresses": [], - "tags": ["/PureBTC.COM/"], + "tags": [ + "/PureBTC.COM/" + ], "link": "https://purebtc.com" }, { @@ -937,62 +1282,89 @@ "15MdAHnkxt9TMC2Rj595hsg8Hnv693pPBB", "1A32KFEX7JNPmU1PVjrtiXRrTQcesT3Nf1" ], - "tags": ["MARA Pool", "MARA Made in USA"], + "tags": [ + "MARA Pool", + "MARA Made in USA" + ], "link": "https://marapool.com" }, { "id": 116, "name": "KuCoinPool", - "addresses": ["1ArTPjj6pV3aNRhLPjJVPYoxB98VLBzUmb"], - "tags": ["KuCoinPool"], + "addresses": [ + "1ArTPjj6pV3aNRhLPjJVPYoxB98VLBzUmb" + ], + "tags": [ + "KuCoinPool" + ], "link": "https://www.kucoin.com/mining-pool" }, { "id": 117, "name": "Entrust Charity Pool", "addresses": [], - "tags": ["Entrustus"], + "tags": [ + "Entrustus" + ], "link": "pool.entustus.org" }, { "id": 118, "name": "OKMINER", - "addresses": ["15xcAZ2HfaSwYbCV6GGbasBSAekBRRC5Q2"], - "tags": ["okminer.com/euz"], + "addresses": [ + "15xcAZ2HfaSwYbCV6GGbasBSAekBRRC5Q2" + ], + "tags": [ + "okminer.com/euz" + ], "link": "https://okminer.com" }, { "id": 119, "name": "Titan", - "addresses": ["14hLEtxozmmih6Gg5xrGZLfx51bEMj21NW"], - "tags": ["Titan.io"], + "addresses": [ + "14hLEtxozmmih6Gg5xrGZLfx51bEMj21NW" + ], + "tags": [ + "Titan.io" + ], "link": "https://titan.io" }, { "id": 120, "name": "PEGA Pool", - "addresses": ["1BGFwRzjCfRR7EvRHnzfHyFjGR8XiBDFKa"], - "tags": ["/pegapool/"], + "addresses": [ + "1BGFwRzjCfRR7EvRHnzfHyFjGR8XiBDFKa" + ], + "tags": [ + "/pegapool/" + ], "link": "https://www.pega-pool.com" }, { "id": 121, "name": "BTC Nuggets", - "addresses": ["1BwZeHJo7b7M2op7VDfYnsmcpXsUYEcVHm"], + "addresses": [ + "1BwZeHJo7b7M2op7VDfYnsmcpXsUYEcVHm" + ], "tags": [], "link": "https://104.197.8.250" }, { "id": 122, "name": "CloudHashing", - "addresses": ["1ALA5v7h49QT7WYLcRsxcXqXUqEqaWmkvw"], + "addresses": [ + "1ALA5v7h49QT7WYLcRsxcXqXUqEqaWmkvw" + ], "tags": [], "link": "https://cloudhashing.com" }, { "id": 123, "name": "digitalX Mintsy", - "addresses": ["1NY15MK947MLzmPUa2gL7UgyR8prLh2xfu"], + "addresses": [ + "1NY15MK947MLzmPUa2gL7UgyR8prLh2xfu" + ], "tags": [], "link": "https://www.mintsy.co" }, @@ -1019,42 +1391,54 @@ { "id": 125, "name": "BTC Pool Party", - "addresses": ["1PmRrdp1YSkp1LxPyCfcmBHDEipG5X4eJB"], + "addresses": [ + "1PmRrdp1YSkp1LxPyCfcmBHDEipG5X4eJB" + ], "tags": [], "link": "https://btcpoolparty.com" }, { "id": 126, "name": "Multipool", - "addresses": ["1MeffGLauEj2CZ18hRQqUauTXb9JAuLbGw"], + "addresses": [ + "1MeffGLauEj2CZ18hRQqUauTXb9JAuLbGw" + ], "tags": [], "link": "https://www.multipool.us" }, { "id": 127, "name": "transactioncoinmining", - "addresses": ["1qtKetXKgqa7j1KrB19HbvfRiNUncmakk"], + "addresses": [ + "1qtKetXKgqa7j1KrB19HbvfRiNUncmakk" + ], "tags": [], "link": "https://sha256.transactioncoinmining.com" }, { "id": 128, "name": "BTCDig", - "addresses": ["15MxzsutVroEE9XiDckLxUHTCDAEZgPZJi"], + "addresses": [ + "15MxzsutVroEE9XiDckLxUHTCDAEZgPZJi" + ], "tags": [], "link": "https://btcdig.com" }, { "id": 129, "name": "Tricky's BTC Pool", - "addresses": ["1AePMyovoijxvHuKhTqWvpaAkRCF4QswC6"], + "addresses": [ + "1AePMyovoijxvHuKhTqWvpaAkRCF4QswC6" + ], "tags": [], "link": "https://pool.wemine.uk" }, { "id": 130, "name": "BTCMP", - "addresses": ["1jKSjMLnDNup6NPgCjveeP9tUn4YpT94Y"], + "addresses": [ + "1jKSjMLnDNup6NPgCjveeP9tUn4YpT94Y" + ], "tags": [], "link": "https://www.btcmp.com" }, @@ -1071,7 +1455,9 @@ { "id": 132, "name": "UNOMP", - "addresses": ["1BRY8AD7vSNUEE75NjzfgiG18mWjGQSRuJ"], + "addresses": [ + "1BRY8AD7vSNUEE75NjzfgiG18mWjGQSRuJ" + ], "tags": [], "link": "https://199.115.116.7:8925" }, @@ -1088,71 +1474,100 @@ { "id": 134, "name": "GoGreenLight", - "addresses": ["18EPLvrs2UE11kWBB3ABS7Crwj5tTBYPoa"], + "addresses": [ + "18EPLvrs2UE11kWBB3ABS7Crwj5tTBYPoa" + ], "tags": [], "link": "https://www.gogreenlight.se" }, { "id": 135, "name": "BitcoinIndia", - "addresses": ["1AZ6BkCo4zgTuuLpRStJH8iNsehXTMp456"], + "addresses": [ + "1AZ6BkCo4zgTuuLpRStJH8iNsehXTMp456" + ], "tags": [], "link": "https://pool.bitcoin-india.org" }, { "id": 136, "name": "EkanemBTC", - "addresses": ["1Cs5RT9SRk1hxsdzivAfkjesNmVVJqfqkw"], + "addresses": [ + "1Cs5RT9SRk1hxsdzivAfkjesNmVVJqfqkw" + ], "tags": [], "link": "https://ekanembtc.com" }, { "id": 137, "name": "CANOE", - "addresses": ["1Afcpc2FpPnREU6i52K3cicmHdvYRAH9Wo"], + "addresses": [ + "1Afcpc2FpPnREU6i52K3cicmHdvYRAH9Wo" + ], "tags": [], "link": "https://www.canoepool.com" }, { "id": 138, "name": "tiger", - "addresses": ["1LsFmhnne74EmU4q4aobfxfrWY4wfMVd8w"], + "addresses": [ + "1LsFmhnne74EmU4q4aobfxfrWY4wfMVd8w" + ], "tags": [], "link": "" }, { "id": 139, "name": "1M1X", - "addresses": ["1M1Xw2rczxkF3p3wiNHaTmxvbpZZ7M6vaa"], + "addresses": [ + "1M1Xw2rczxkF3p3wiNHaTmxvbpZZ7M6vaa" + ], "tags": [], "link": "" }, { "id": 140, "name": "Zulupool", - "addresses": ["1ZULUPooLEQfkrTgynLV4uHyMgQYx71ip"], - "tags": ["ZULUPooL", "ZU_test"], + "addresses": [ + "1ZULUPooLEQfkrTgynLV4uHyMgQYx71ip" + ], + "tags": [ + "ZULUPooL", + "ZU_test" + ], "link": "https://beta.zulupool.com/" }, { "id": 141, "name": "SECPOOL", - "addresses": ["3Awm3FNpmwrbvAFVThRUFqgpbVuqWisni9"], - "tags": ["SecPool"], + "addresses": [ + "3Awm3FNpmwrbvAFVThRUFqgpbVuqWisni9" + ], + "tags": [ + "SecPool" + ], "link": "https://www.secpool.com" }, { "id": 142, "name": "OCEAN", - "addresses": ["37dvwZZoT3D7RXpTCpN2yKzMmNs2i2Fd1n"], - "tags": ["OCEAN.XYZ"], + "addresses": [ + "37dvwZZoT3D7RXpTCpN2yKzMmNs2i2Fd1n" + ], + "tags": [ + "OCEAN.XYZ" + ], "link": "https://ocean.xyz/" }, { "id": 143, "name": "WhitePool", - "addresses": ["14VkxDwSAUWrzYTxV49HnYhKLWTJ3pCoUS"], - "tags": ["WhitePool"], + "addresses": [ + "14VkxDwSAUWrzYTxV49HnYhKLWTJ3pCoUS" + ], + "tags": [ + "WhitePool" + ], "link": "https://whitebit.com/mining-pool" }, { @@ -1162,49 +1577,75 @@ "1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC", "tb1q548z58kqvwyjqwy8vc2ntmg33d7s2wyfv7ukq4" ], - "tags": ["/@wiz/"], + "tags": [ + "/@wiz/" + ], "link": "https://wiz.biz/" }, { "id": 145, "name": "mononaut", - "addresses": ["mjP97q5BWtdpdsJLkEJvQWgLe9zw4MMVU6"], - "tags": ["🐵🚀"], + "addresses": [ + "mjP97q5BWtdpdsJLkEJvQWgLe9zw4MMVU6" + ], + "tags": [ + "🐵🚀" + ], "link": "https://twitter.com/mononautical" }, { "id": 146, "name": "rijndael", - "addresses": ["tb1qg8zlznrvns9u46muxamxjh7sa8wry3vutzaujm"], - "tags": ["rijndael's toaster"], + "addresses": [ + "tb1qg8zlznrvns9u46muxamxjh7sa8wry3vutzaujm" + ], + "tags": [ + "rijndael's toaster" + ], "link": "https://twitter.com/rot13maxi" }, { "id": 147, "name": "wk057", - "addresses": ["1WizkidqARMLvjGUpfDQFRcEbnHpL55kK"], - "tags": ["wizkid057's block"], + "addresses": [ + "1WizkidqARMLvjGUpfDQFRcEbnHpL55kK" + ], + "tags": [ + "wizkid057's block" + ], "link": "" }, { "id": 148, "name": "FutureBit Apollo Solo", "addresses": [], - "tags": ["Apollo", "FutureBit", "/mined by a Solo FutureBit Apollo/"], + "tags": [ + "Apollo", + "FutureBit", + "/mined by a Solo FutureBit Apollo/" + ], "link": "https://www.futurebit.io" }, { "id": 149, "name": "emzy", - "addresses": ["tb1qmf7xdqc5nvzhturuzc46qtq5kywdf3p76cpq53"], - "tags": ["Emzy was here."], + "addresses": [ + "tb1qmf7xdqc5nvzhturuzc46qtq5kywdf3p76cpq53" + ], + "tags": [ + "Emzy was here." + ], "link": "https://twitter.com/emzy" }, { "id": 150, "name": "knorrium", - "addresses": ["tb1qtfqp4g7n7wc3sr6c2cuzsq62px4pfsxgsv2krx"], - "tags": ["knorrium"], + "addresses": [ + "tb1qtfqp4g7n7wc3sr6c2cuzsq62px4pfsxgsv2krx" + ], + "tags": [ + "knorrium" + ], "link": "https://twitter.com/knorrium" }, { @@ -1220,7 +1661,8 @@ { "id": 152, "name": "Portland.HODL", - "addresses": [], + "addresses": [ + ], "tags": ["Portland.HODL"], "link": "" }, @@ -1238,42 +1680,56 @@ { "id": 154, "name": "Neopool", - "addresses": ["1HCAb2h89bUinm6QZrAPpfbk4ySBrT2V4w"], + "addresses": [ + "1HCAb2h89bUinm6QZrAPpfbk4ySBrT2V4w" + ], "tags": ["/Neopool/"], "link": "https://neopool.com/" }, { "id": 155, "name": "MaxiPool", - "addresses": ["36r3YqAXWpyqNcczjCBdHrYZ3m8X56WDzx"], + "addresses": [ + "36r3YqAXWpyqNcczjCBdHrYZ3m8X56WDzx" + ], "tags": ["/MaxiPool/"], "link": "https://maxipool.org/" }, { "id": 156, "name": "DrDetroit", - "addresses": ["tb1qtcruplnz89xw5f86kw8sj7x9r23d5yffrysx2p"], - "tags": ["DrDetroit"], + "addresses": [ + "tb1qtcruplnz89xw5f86kw8sj7x9r23d5yffrysx2p" + ], + "tags": [ + "DrDetroit" + ], "link": "https://x.com/bankhatin" }, { "id": 157, "name": "BitFuFuPool", - "addresses": ["3JP3zF7LoeoAotqkNGdvX5szUyNPwd937d"], + "addresses": [ + "3JP3zF7LoeoAotqkNGdvX5szUyNPwd937d" + ], "tags": ["/BitFuFu/"], "link": "https://www.bitfufu.com/pool" }, { "id": 158, "name": "GDPool", - "addresses": ["1DnPPFQPrfyNTiHPXhDFyqNnW9T62GEhB1"], + "addresses": [ + "1DnPPFQPrfyNTiHPXhDFyqNnW9T62GEhB1" + ], "tags": ["Lucky pool", "GDPool"], "link": "" }, { "id": 159, "name": "Mining-Dutch", - "addresses": ["1AfPSq5ZbqBaxU5QAayLQJMcXV8HZt92eq"], + "addresses": [ + "1AfPSq5ZbqBaxU5QAayLQJMcXV8HZt92eq" + ], "tags": ["/Mining-Dutch/"], "link": "https://www.mining-dutch.nl/" }, @@ -1281,7 +1737,10 @@ "id": 160, "name": "Public Pool", "addresses": [], - "tags": ["Public-Pool", "Public Pool on Umbrel"], + "tags": [ + "Public-Pool", + "Public Pool on Umbrel" + ], "link": "https://web.public-pool.io/" }, { @@ -1297,14 +1756,18 @@ { "id": 162, "name": "Innopolis Tech", - "addresses": ["bc1q75t4wewkmf3l9qg097zvtlh05v5pdz6699kv8k"], + "addresses": [ + "bc1q75t4wewkmf3l9qg097zvtlh05v5pdz6699kv8k" + ], "tags": ["Innopolis", "Innopolis.tech"], "link": "https://innopolis.tech/" }, { "id": 163, "name": "nymkappa", - "addresses": ["tb1qdyy39724wqnqqqduv6zxsf56s2ec9lgypxs59h"], + "addresses": [ + "tb1qdyy39724wqnqqqduv6zxsf56s2ec9lgypxs59h" + ], "tags": ["/@nymkappa/"], "link": "https://github.com/nymkappa" }, @@ -1312,7 +1775,10 @@ "id": 164, "name": "BTCLab", "addresses": [], - "tags": ["BTCLab", "BTCLab.dev"], + "tags": [ + "BTCLab", + "BTCLab.dev" + ], "link": "https://btclab.dev/" }, { @@ -1325,14 +1791,18 @@ { "id": 166, "name": "RedRock Pool", - "addresses": ["3554kSaWNnP3B49Xyybert7gmxq2YSnfnx"], + "addresses": [ + "3554kSaWNnP3B49Xyybert7gmxq2YSnfnx" + ], "tags": ["RedRock"], "link": "https://redrock.pro/" }, { "id": 167, "name": "Est3lar", - "addresses": ["34qGNFx6uQv6SzjYPbYVWtjvuy5DSGugt8"], + "addresses": [ + "34qGNFx6uQv6SzjYPbYVWtjvuy5DSGugt8" + ], "tags": ["/Est3lar/", "est3lar", "Est3lar", "EST3LAR"], "link": "https://est3lar.io" }, @@ -1346,8 +1816,17 @@ { "id": 169, "name": "SoloPool.com", - "addresses": ["bc1qreaftg3lr53nv84dnxhcvchmswevzlp9tdj2jd"], + "addresses": [ + "bc1qreaftg3lr53nv84dnxhcvchmswevzlp9tdj2jd" + ], "tags": ["/Mined @ SoloPool.Com/"], "link": "https://solopool.com" + }, + { + "id": 170, + "name": "Noderunners", + "addresses": [], + "tags": ["/Noderunners/"], + "link": "https://pool.noderunners.network" } ] diff --git a/crates/brk_types/src/data_range.rs b/crates/brk_types/src/data_range.rs deleted file mode 100644 index bdead12a4..000000000 --- a/crates/brk_types/src/data_range.rs +++ /dev/null @@ -1,56 +0,0 @@ -use schemars::JsonSchema; -use serde::Deserialize; - -use crate::{Limit, RangeIndex, de_unquote_limit}; - -/// Range parameters for slicing data -#[derive(Default, Debug, Deserialize, JsonSchema)] -pub struct DataRange { - /// Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` - #[serde(default, alias = "s", alias = "from", alias = "f")] - start: Option, - - /// Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` - #[serde(default, alias = "e", alias = "to", alias = "t")] - end: Option, - - /// Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` - #[serde( - default, - alias = "l", - alias = "count", - alias = "c", - deserialize_with = "de_unquote_limit" - )] - limit: Option, -} - -impl DataRange { - pub fn set_start(mut self, start: i64) -> Self { - self.start.replace(RangeIndex::Int(start)); - self - } - - pub fn set_end(mut self, end: i64) -> Self { - self.end.replace(RangeIndex::Int(end)); - self - } - - pub fn set_limit(mut self, limit: Limit) -> Self { - self.limit.replace(limit); - self - } - - pub fn start(&self) -> Option { - self.start - } - - pub fn end(&self) -> Option { - self.end - } - - pub fn limit(&self) -> Option { - self.limit - } - -} diff --git a/crates/brk_types/src/data_range_format.rs b/crates/brk_types/src/data_range_format.rs index ce87cdd24..3761c55ff 100644 --- a/crates/brk_types/src/data_range_format.rs +++ b/crates/brk_types/src/data_range_format.rs @@ -1,38 +1,11 @@ -use derive_more::Deref; use schemars::JsonSchema; use serde::Deserialize; -use crate::{DataRange, Format, Limit}; +use crate::with_range_format::with_range_format; -/// Data range with output format for API query parameters -#[derive(Default, Debug, Deref, Deserialize, JsonSchema)] -pub struct DataRangeFormat { - #[deref] - #[serde(flatten)] - pub range: DataRange, - - /// Format of the output - #[serde(default)] - format: Format, -} - -impl DataRangeFormat { - pub fn format(&self) -> Format { - self.format - } - - pub fn set_start(mut self, start: i64) -> Self { - self.range = self.range.set_start(start); - self - } - - pub fn set_end(mut self, end: i64) -> Self { - self.range = self.range.set_end(end); - self - } - - pub fn set_limit(mut self, limit: Limit) -> Self { - self.range = self.range.set_limit(limit); - self - } +with_range_format! { + /// Range parameters with output format for API query parameters. + #[derive(Default, Debug, Deserialize, JsonSchema)] + #[serde(deny_unknown_fields)] + pub struct DataRangeFormat {} } diff --git a/crates/brk_types/src/lib.rs b/crates/brk_types/src/lib.rs index d902fa541..d58bf3188 100644 --- a/crates/brk_types/src/lib.rs +++ b/crates/brk_types/src/lib.rs @@ -45,7 +45,6 @@ mod cents_squared_sats; mod cohort; mod coinbase_tag; mod cpfp; -mod data_range; mod data_range_format; mod date; mod day1; @@ -189,6 +188,7 @@ mod vout; mod vsize; mod week1; mod weight; +mod with_range_format; mod witness; mod year; mod year1; @@ -237,7 +237,6 @@ pub use cents_squared_sats::*; pub use cohort::*; pub use coinbase_tag::*; pub use cpfp::*; -pub use data_range::*; pub use data_range_format::*; pub use date::*; pub use day1::*; diff --git a/crates/brk_types/src/output_type.rs b/crates/brk_types/src/output_type.rs index 3e2fb7405..eb46c153f 100644 --- a/crates/brk_types/src/output_type.rs +++ b/crates/brk_types/src/output_type.rs @@ -1,4 +1,7 @@ -#![allow(unreachable_patterns, reason = "P2PK65 and P2PK33 both serialize as 'p2pk'")] +#![allow( + unreachable_patterns, + reason = "P2PK65 and P2PK33 both serialize as 'p2pk'" +)] use bitcoin::{AddressType, ScriptBuf, opcodes::all::OP_PUSHBYTES_2}; use brk_error::Error; diff --git a/crates/brk_types/src/pool_slug.rs b/crates/brk_types/src/pool_slug.rs index e158d6a29..e6949fc2e 100644 --- a/crates/brk_types/src/pool_slug.rs +++ b/crates/brk_types/src/pool_slug.rs @@ -201,8 +201,7 @@ pub enum PoolSlug { Est3lar, BraiinsSolo, SoloPool, - #[serde(skip)] - Dummy170, + Noderunners, #[serde(skip)] Dummy171, #[serde(skip)] diff --git a/crates/brk_types/src/pools.rs b/crates/brk_types/src/pools.rs index 8d1f7ee46..2ff5c3a05 100644 --- a/crates/brk_types/src/pools.rs +++ b/crates/brk_types/src/pools.rs @@ -7,7 +7,7 @@ use crate::PoolSlug; use super::Pool; const JSON_DATA: &str = include_str!("../pools-v2.json"); -const POOL_COUNT: usize = 170; +const POOL_COUNT: usize = 171; const TESTNET_IDS: &[u16] = &[145, 146, 149, 150, 156, 163]; #[derive(Deserialize)] diff --git a/crates/brk_types/src/range_map.rs b/crates/brk_types/src/range_map.rs index c79a572dd..55695cf4f 100644 --- a/crates/brk_types/src/range_map.rs +++ b/crates/brk_types/src/range_map.rs @@ -140,7 +140,11 @@ impl, V: From + Copy + Default> Ran return None; } let pos = self.first_indexes.partition_point(|&first| first <= index); - if pos > 0 { Some(V::from(pos - 1)) } else { None } + if pos > 0 { + Some(V::from(pos - 1)) + } else { + None + } } #[inline] diff --git a/crates/brk_types/src/sats.rs b/crates/brk_types/src/sats.rs index fd498e3a1..6fcdd2460 100644 --- a/crates/brk_types/src/sats.rs +++ b/crates/brk_types/src/sats.rs @@ -210,7 +210,10 @@ impl Sum for Sats { impl Div for Sats { type Output = Self; - #[allow(clippy::suspicious_arithmetic_impl, reason = "cents-precision upscale before division")] + #[allow( + clippy::suspicious_arithmetic_impl, + reason = "cents-precision upscale before division" + )] fn div(self, rhs: Dollars) -> Self::Output { let raw_cents = u64::from(Cents::from(rhs)); (self.0 * 100) diff --git a/crates/brk_types/src/series_selection.rs b/crates/brk_types/src/series_selection.rs index 5440d8785..2f1cc1e8d 100644 --- a/crates/brk_types/src/series_selection.rs +++ b/crates/brk_types/src/series_selection.rs @@ -1,23 +1,21 @@ -use derive_more::Deref; use schemars::JsonSchema; use serde::Deserialize; -use crate::{DataRangeFormat, Index, SeriesList, SeriesName}; +use crate::{DataRangeFormat, Index, SeriesList, SeriesName, with_range_format::with_range_format}; -/// Selection of series to query -#[derive(Debug, Deref, Deserialize, JsonSchema)] -pub struct SeriesSelection { - /// Requested series - #[serde(alias = "m", alias = "metrics")] - pub series: SeriesList, +with_range_format! { + /// Selection of series to query + #[derive(Debug, Deserialize, JsonSchema)] + #[serde(deny_unknown_fields)] + pub struct SeriesSelection { + /// Requested series + #[serde(alias = "m", alias = "metrics")] + pub series: SeriesList, - /// Index to query - #[serde(alias = "i")] - pub index: Index, - - #[deref] - #[serde(flatten)] - pub range: DataRangeFormat, + /// Index to query + #[serde(alias = "i")] + pub index: Index, + } } impl From<(Index, SeriesName, DataRangeFormat)> for SeriesSelection { @@ -26,7 +24,10 @@ impl From<(Index, SeriesName, DataRangeFormat)> for SeriesSelection { Self { index, series: SeriesList::from(series), - range, + start: range.start(), + end: range.end(), + limit: range.limit(), + format: range.format(), } } } @@ -37,7 +38,10 @@ impl From<(Index, SeriesList, DataRangeFormat)> for SeriesSelection { Self { index, series, - range, + start: range.start(), + end: range.end(), + limit: range.limit(), + format: range.format(), } } } diff --git a/crates/brk_types/src/series_selection_legacy.rs b/crates/brk_types/src/series_selection_legacy.rs index f89832cce..4533bc172 100644 --- a/crates/brk_types/src/series_selection_legacy.rs +++ b/crates/brk_types/src/series_selection_legacy.rs @@ -1,26 +1,34 @@ use schemars::JsonSchema; use serde::Deserialize; -use crate::{DataRangeFormat, Index, SeriesList, SeriesSelection}; +use crate::{Index, SeriesList, SeriesSelection, with_range_format::with_range_format}; -/// Legacy series selection parameters (deprecated) -#[derive(Debug, Deserialize, JsonSchema)] -pub struct SeriesSelectionLegacy { - #[serde(alias = "i")] - pub index: Index, - #[serde(alias = "v")] - pub ids: SeriesList, - #[serde(flatten)] - pub range: DataRangeFormat, +with_range_format! { + /// Legacy series selection parameters (deprecated) + #[derive(Debug, Deserialize, JsonSchema)] + #[serde(deny_unknown_fields)] + pub struct SeriesSelectionLegacy { + #[serde(alias = "i")] + pub index: Index, + #[serde(alias = "v")] + pub ids: SeriesList, + } } impl From for SeriesSelection { #[inline] fn from(value: SeriesSelectionLegacy) -> Self { + let start = value.start(); + let end = value.end(); + let limit = value.limit(); + let format = value.format(); SeriesSelection { index: value.index, series: value.ids, - range: value.range, + start, + end, + limit, + format, } } } diff --git a/crates/brk_types/src/with_range_format.rs b/crates/brk_types/src/with_range_format.rs new file mode 100644 index 000000000..192b93239 --- /dev/null +++ b/crates/brk_types/src/with_range_format.rs @@ -0,0 +1,63 @@ +/// Expands a struct definition by appending shared range/format fields +/// (`start`, `end`, `limit`, `format` plus their aliases) and emitting +/// matching accessors. Used to keep `DataRangeFormat`, `SeriesSelection` +/// and `SeriesSelectionLegacy` in sync without `#[serde(flatten)]`, since +/// `deny_unknown_fields` is silently inert through any flatten chain. +macro_rules! with_range_format { + ( + $(#[$attr:meta])* + pub struct $name:ident { + $($body:tt)* + } + ) => { + $(#[$attr])* + pub struct $name { + $($body)* + /// Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` + #[serde(default, alias = "s", alias = "from", alias = "f")] + pub(crate) start: Option<$crate::RangeIndex>, + + /// Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` + #[serde(default, alias = "e", alias = "to", alias = "t")] + pub(crate) end: Option<$crate::RangeIndex>, + + /// Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` + #[serde( + default, + alias = "l", + alias = "count", + alias = "c", + deserialize_with = "crate::de_unquote_limit" + )] + pub(crate) limit: Option<$crate::Limit>, + + /// Format of the output + #[serde(default)] + pub(crate) format: $crate::Format, + } + + impl $name { + pub fn start(&self) -> Option<$crate::RangeIndex> { self.start } + pub fn end(&self) -> Option<$crate::RangeIndex> { self.end } + pub fn limit(&self) -> Option<$crate::Limit> { self.limit } + pub fn format(&self) -> $crate::Format { self.format } + + pub fn set_start(mut self, start: i64) -> Self { + self.start = Some($crate::RangeIndex::Int(start)); + self + } + + pub fn set_end(mut self, end: i64) -> Self { + self.end = Some($crate::RangeIndex::Int(end)); + self + } + + pub fn set_limit(mut self, limit: $crate::Limit) -> Self { + self.limit = Some(limit); + self + } + } + }; +} + +pub(crate) use with_range_format; diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 20c786398..7869c7b98 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -379,7 +379,7 @@ Matches mempool.space/bitcoin-cli behavior. * @property {(VSize|null)=} adjustedVsize - Adjusted virtual size (accounting for sigops) */ /** - * Data range with output format for API query parameters + * Range parameters with output format for API query parameters. * * @typedef {Object} DataRangeFormat * @property {(RangeIndex|null)=} start - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` @@ -789,7 +789,7 @@ Matches mempool.space/bitcoin-cli behavior. /** * URL-friendly mining pool identifier * - * @typedef {("unknown"|"blockfills"|"ultimuspool"|"terrapool"|"luxor"|"onethash"|"btccom"|"bitfarms"|"huobipool"|"wayicn"|"canoepool"|"btctop"|"bitcoincom"|"pool175btc"|"gbminers"|"axbt"|"asicminer"|"bitminter"|"bitcoinrussia"|"btcserv"|"simplecoinus"|"btcguild"|"eligius"|"ozcoin"|"eclipsemc"|"maxbtc"|"triplemining"|"coinlab"|"pool50btc"|"ghashio"|"stminingcorp"|"bitparking"|"mmpool"|"polmine"|"kncminer"|"bitalo"|"f2pool"|"hhtt"|"megabigpower"|"mtred"|"nmcbit"|"yourbtcnet"|"givemecoins"|"braiinspool"|"antpool"|"multicoinco"|"bcpoolio"|"cointerra"|"kanopool"|"solock"|"ckpool"|"nicehash"|"bitclub"|"bitcoinaffiliatenetwork"|"btcc"|"bwpool"|"exxbw"|"bitsolo"|"bitfury"|"twentyoneinc"|"digitalbtc"|"eightbaochi"|"mybtccoinpool"|"tbdice"|"hashpool"|"nexious"|"bravomining"|"hotpool"|"okexpool"|"bcmonster"|"onehash"|"bixin"|"tatmaspool"|"viabtc"|"connectbtc"|"batpool"|"waterhole"|"dcexploration"|"dcex"|"btpool"|"fiftyeightcoin"|"bitcoinindia"|"shawnp0wers"|"phashio"|"rigpool"|"haozhuzhu"|"sevenpool"|"miningkings"|"hashbx"|"dpool"|"rawpool"|"haominer"|"helix"|"bitcoinukraine"|"poolin"|"secretsuperstar"|"tigerpoolnet"|"sigmapoolcom"|"okpooltop"|"hummerpool"|"tangpool"|"bytepool"|"spiderpool"|"novablock"|"miningcity"|"binancepool"|"minerium"|"lubiancom"|"okkong"|"aaopool"|"emcdpool"|"foundryusa"|"sbicrypto"|"arkpool"|"purebtccom"|"marapool"|"kucoinpool"|"entrustcharitypool"|"okminer"|"titan"|"pegapool"|"btcnuggets"|"cloudhashing"|"digitalxmintsy"|"telco214"|"btcpoolparty"|"multipool"|"transactioncoinmining"|"btcdig"|"trickysbtcpool"|"btcmp"|"eobot"|"unomp"|"patels"|"gogreenlight"|"bitcoinindiapool"|"ekanembtc"|"canoe"|"tiger"|"onem1x"|"zulupool"|"secpool"|"ocean"|"whitepool"|"wiz"|"wk057"|"futurebitapollosolo"|"carbonnegative"|"portlandhodl"|"phoenix"|"neopool"|"maxipool"|"bitfufupool"|"gdpool"|"miningdutch"|"publicpool"|"miningsquared"|"innopolistech"|"btclab"|"parasite"|"redrockpool"|"est3lar"|"braiinssolo"|"solopool")} PoolSlug + * @typedef {("unknown"|"blockfills"|"ultimuspool"|"terrapool"|"luxor"|"onethash"|"btccom"|"bitfarms"|"huobipool"|"wayicn"|"canoepool"|"btctop"|"bitcoincom"|"pool175btc"|"gbminers"|"axbt"|"asicminer"|"bitminter"|"bitcoinrussia"|"btcserv"|"simplecoinus"|"btcguild"|"eligius"|"ozcoin"|"eclipsemc"|"maxbtc"|"triplemining"|"coinlab"|"pool50btc"|"ghashio"|"stminingcorp"|"bitparking"|"mmpool"|"polmine"|"kncminer"|"bitalo"|"f2pool"|"hhtt"|"megabigpower"|"mtred"|"nmcbit"|"yourbtcnet"|"givemecoins"|"braiinspool"|"antpool"|"multicoinco"|"bcpoolio"|"cointerra"|"kanopool"|"solock"|"ckpool"|"nicehash"|"bitclub"|"bitcoinaffiliatenetwork"|"btcc"|"bwpool"|"exxbw"|"bitsolo"|"bitfury"|"twentyoneinc"|"digitalbtc"|"eightbaochi"|"mybtccoinpool"|"tbdice"|"hashpool"|"nexious"|"bravomining"|"hotpool"|"okexpool"|"bcmonster"|"onehash"|"bixin"|"tatmaspool"|"viabtc"|"connectbtc"|"batpool"|"waterhole"|"dcexploration"|"dcex"|"btpool"|"fiftyeightcoin"|"bitcoinindia"|"shawnp0wers"|"phashio"|"rigpool"|"haozhuzhu"|"sevenpool"|"miningkings"|"hashbx"|"dpool"|"rawpool"|"haominer"|"helix"|"bitcoinukraine"|"poolin"|"secretsuperstar"|"tigerpoolnet"|"sigmapoolcom"|"okpooltop"|"hummerpool"|"tangpool"|"bytepool"|"spiderpool"|"novablock"|"miningcity"|"binancepool"|"minerium"|"lubiancom"|"okkong"|"aaopool"|"emcdpool"|"foundryusa"|"sbicrypto"|"arkpool"|"purebtccom"|"marapool"|"kucoinpool"|"entrustcharitypool"|"okminer"|"titan"|"pegapool"|"btcnuggets"|"cloudhashing"|"digitalxmintsy"|"telco214"|"btcpoolparty"|"multipool"|"transactioncoinmining"|"btcdig"|"trickysbtcpool"|"btcmp"|"eobot"|"unomp"|"patels"|"gogreenlight"|"bitcoinindiapool"|"ekanembtc"|"canoe"|"tiger"|"onem1x"|"zulupool"|"secpool"|"ocean"|"whitepool"|"wiz"|"wk057"|"futurebitapollosolo"|"carbonnegative"|"portlandhodl"|"phoenix"|"neopool"|"maxipool"|"bitfufupool"|"gdpool"|"miningdutch"|"publicpool"|"miningsquared"|"innopolistech"|"btclab"|"parasite"|"redrockpool"|"est3lar"|"braiinssolo"|"solopool"|"noderunners")} PoolSlug */ /** * Mining pool slug + block height path parameters @@ -6414,6 +6414,7 @@ function createTransferPattern(client, acc) { * @property {BlocksDominancePattern} est3lar * @property {BlocksDominancePattern} braiinssolo * @property {BlocksDominancePattern} solopool + * @property {BlocksDominancePattern} noderunners */ /** @@ -7473,7 +7474,8 @@ class BrkClient extends BrkClientBase { "redrockpool": "RedRock Pool", "est3lar": "Est3lar", "braiinssolo": "Braiins Solo", - "solopool": "SoloPool.com" + "solopool": "SoloPool.com", + "noderunners": "Noderunners" }); TERM_NAMES = /** @type {const} */ ({ @@ -9550,6 +9552,7 @@ class BrkClient extends BrkClientBase { est3lar: createBlocksDominancePattern(this, 'est3lar'), braiinssolo: createBlocksDominancePattern(this, 'braiinssolo'), solopool: createBlocksDominancePattern(this, 'solopool'), + noderunners: createBlocksDominancePattern(this, 'noderunners'), }, }, prices: { diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 5bad2a28c..3bc368f3e 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -54,7 +54,7 @@ BasisPointsSigned32 = int # Bitcoin amount as floating point (1 BTC = 100,000,000 satoshis) Bitcoin = float # URL-friendly mining pool identifier -PoolSlug = Literal["unknown", "blockfills", "ultimuspool", "terrapool", "luxor", "onethash", "btccom", "bitfarms", "huobipool", "wayicn", "canoepool", "btctop", "bitcoincom", "pool175btc", "gbminers", "axbt", "asicminer", "bitminter", "bitcoinrussia", "btcserv", "simplecoinus", "btcguild", "eligius", "ozcoin", "eclipsemc", "maxbtc", "triplemining", "coinlab", "pool50btc", "ghashio", "stminingcorp", "bitparking", "mmpool", "polmine", "kncminer", "bitalo", "f2pool", "hhtt", "megabigpower", "mtred", "nmcbit", "yourbtcnet", "givemecoins", "braiinspool", "antpool", "multicoinco", "bcpoolio", "cointerra", "kanopool", "solock", "ckpool", "nicehash", "bitclub", "bitcoinaffiliatenetwork", "btcc", "bwpool", "exxbw", "bitsolo", "bitfury", "twentyoneinc", "digitalbtc", "eightbaochi", "mybtccoinpool", "tbdice", "hashpool", "nexious", "bravomining", "hotpool", "okexpool", "bcmonster", "onehash", "bixin", "tatmaspool", "viabtc", "connectbtc", "batpool", "waterhole", "dcexploration", "dcex", "btpool", "fiftyeightcoin", "bitcoinindia", "shawnp0wers", "phashio", "rigpool", "haozhuzhu", "sevenpool", "miningkings", "hashbx", "dpool", "rawpool", "haominer", "helix", "bitcoinukraine", "poolin", "secretsuperstar", "tigerpoolnet", "sigmapoolcom", "okpooltop", "hummerpool", "tangpool", "bytepool", "spiderpool", "novablock", "miningcity", "binancepool", "minerium", "lubiancom", "okkong", "aaopool", "emcdpool", "foundryusa", "sbicrypto", "arkpool", "purebtccom", "marapool", "kucoinpool", "entrustcharitypool", "okminer", "titan", "pegapool", "btcnuggets", "cloudhashing", "digitalxmintsy", "telco214", "btcpoolparty", "multipool", "transactioncoinmining", "btcdig", "trickysbtcpool", "btcmp", "eobot", "unomp", "patels", "gogreenlight", "bitcoinindiapool", "ekanembtc", "canoe", "tiger", "onem1x", "zulupool", "secpool", "ocean", "whitepool", "wiz", "wk057", "futurebitapollosolo", "carbonnegative", "portlandhodl", "phoenix", "neopool", "maxipool", "bitfufupool", "gdpool", "miningdutch", "publicpool", "miningsquared", "innopolistech", "btclab", "parasite", "redrockpool", "est3lar", "braiinssolo", "solopool"] +PoolSlug = Literal["unknown", "blockfills", "ultimuspool", "terrapool", "luxor", "onethash", "btccom", "bitfarms", "huobipool", "wayicn", "canoepool", "btctop", "bitcoincom", "pool175btc", "gbminers", "axbt", "asicminer", "bitminter", "bitcoinrussia", "btcserv", "simplecoinus", "btcguild", "eligius", "ozcoin", "eclipsemc", "maxbtc", "triplemining", "coinlab", "pool50btc", "ghashio", "stminingcorp", "bitparking", "mmpool", "polmine", "kncminer", "bitalo", "f2pool", "hhtt", "megabigpower", "mtred", "nmcbit", "yourbtcnet", "givemecoins", "braiinspool", "antpool", "multicoinco", "bcpoolio", "cointerra", "kanopool", "solock", "ckpool", "nicehash", "bitclub", "bitcoinaffiliatenetwork", "btcc", "bwpool", "exxbw", "bitsolo", "bitfury", "twentyoneinc", "digitalbtc", "eightbaochi", "mybtccoinpool", "tbdice", "hashpool", "nexious", "bravomining", "hotpool", "okexpool", "bcmonster", "onehash", "bixin", "tatmaspool", "viabtc", "connectbtc", "batpool", "waterhole", "dcexploration", "dcex", "btpool", "fiftyeightcoin", "bitcoinindia", "shawnp0wers", "phashio", "rigpool", "haozhuzhu", "sevenpool", "miningkings", "hashbx", "dpool", "rawpool", "haominer", "helix", "bitcoinukraine", "poolin", "secretsuperstar", "tigerpoolnet", "sigmapoolcom", "okpooltop", "hummerpool", "tangpool", "bytepool", "spiderpool", "novablock", "miningcity", "binancepool", "minerium", "lubiancom", "okkong", "aaopool", "emcdpool", "foundryusa", "sbicrypto", "arkpool", "purebtccom", "marapool", "kucoinpool", "entrustcharitypool", "okminer", "titan", "pegapool", "btcnuggets", "cloudhashing", "digitalxmintsy", "telco214", "btcpoolparty", "multipool", "transactioncoinmining", "btcdig", "trickysbtcpool", "btcmp", "eobot", "unomp", "patels", "gogreenlight", "bitcoinindiapool", "ekanembtc", "canoe", "tiger", "onem1x", "zulupool", "secpool", "ocean", "whitepool", "wiz", "wk057", "futurebitapollosolo", "carbonnegative", "portlandhodl", "phoenix", "neopool", "maxipool", "bitfufupool", "gdpool", "miningdutch", "publicpool", "miningsquared", "innopolistech", "btclab", "parasite", "redrockpool", "est3lar", "braiinssolo", "solopool", "noderunners"] # Fee rate in sat/vB FeeRate = float # Weight in weight units (WU). Max block weight is 4,000,000 WU. @@ -673,7 +673,7 @@ class CpfpInfo(TypedDict): class DataRangeFormat(TypedDict): """ - Data range with output format for API query parameters + Range parameters with output format for API query parameters. Attributes: start: Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` @@ -5577,6 +5577,7 @@ class SeriesTree_Pools_Minor: self.est3lar: BlocksDominancePattern = BlocksDominancePattern(client, 'est3lar') self.braiinssolo: BlocksDominancePattern = BlocksDominancePattern(client, 'braiinssolo') self.solopool: BlocksDominancePattern = BlocksDominancePattern(client, 'solopool') + self.noderunners: BlocksDominancePattern = BlocksDominancePattern(client, 'noderunners') class SeriesTree_Pools: """Series tree node.""" @@ -6666,6 +6667,7 @@ class BrkClient(BrkClientBase): "nexious": "Nexious", "nicehash": "NiceHash", "nmcbit": "NMCbit", + "noderunners": "Noderunners", "novablock": "NovaBlock", "ocean": "OCEAN", "okexpool": "OKExPool", diff --git a/website/scripts/options/series.js b/website/scripts/options/series.js index b81a304aa..72fbb3b4d 100644 --- a/website/scripts/options/series.js +++ b/website/scripts/options/series.js @@ -518,7 +518,7 @@ export function sumsAndAveragesCumulativeWith({ return [ { name: "Compare", - title: title(metric), + title: title(`Average ${metric}`), bottom: ROLLING_WINDOWS.flatMap((w) => series({ pattern: average[w.key],