diff --git a/Cargo.lock b/Cargo.lock index d0fdb1b1e..e82a0438b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -609,6 +609,7 @@ dependencies = [ "owo-colors", "tracing", "tracing-appender", + "tracing-log", "tracing-subscriber", ] @@ -3589,6 +3590,17 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-subscriber" version = "0.3.22" diff --git a/crates/brk_cli/src/main.rs b/crates/brk_cli/src/main.rs index a73eab8ca..b6444caad 100644 --- a/crates/brk_cli/src/main.rs +++ b/crates/brk_cli/src/main.rs @@ -55,14 +55,17 @@ pub fn run() -> color_eyre::Result<()> { let mut indexer = Indexer::forced_import(&config.brkdir())?; - // Pre-run indexer if too far behind, then drop and reimport to reduce memory - let chain_height = client.get_last_height()?; - let indexed_height = indexer.vecs.starting_height(); - if chain_height.saturating_sub(*indexed_height) > 1000 { - indexer.index(&blocks, &client, &exit)?; - drop(indexer); - Mimalloc::collect(); - indexer = Indexer::forced_import(&config.brkdir())?; + #[cfg(not(debug_assertions))] + { + // Pre-run indexer if too far behind, then drop and reimport to reduce memory + let chain_height = client.get_last_height()?; + let indexed_height = indexer.vecs.starting_height(); + if chain_height.saturating_sub(*indexed_height) > 1000 { + indexer.index(&blocks, &client, &exit)?; + drop(indexer); + Mimalloc::collect(); + indexer = Indexer::forced_import(&config.brkdir())?; + } } let mut computer = Computer::forced_import(&config.brkdir(), &indexer, config.fetcher())?; diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 5feb29f7d..cf1b6d1e9 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -638,18 +638,15 @@ pub struct MetricPattern6By { } impl MetricPattern6By { - pub fn by_quarterindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::QuarterIndex) + pub fn by_dateindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::DateIndex) } - pub fn by_semesterindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::SemesterIndex) - } - pub fn by_yearindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::YearIndex) + pub fn by_height(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::Height) } } -/// Index accessor for metrics with 3 indexes. +/// Index accessor for metrics with 2 indexes. pub struct MetricPattern6 { client: Arc, name: Arc, @@ -683,9 +680,8 @@ impl AnyMetricPattern for MetricPattern6 { fn indexes(&self) -> &'static [Index] { &[ - Index::QuarterIndex, - Index::SemesterIndex, - Index::YearIndex, + Index::DateIndex, + Index::Height, ] } } @@ -693,9 +689,8 @@ impl AnyMetricPattern for MetricPattern6 { impl MetricPattern for MetricPattern6 { fn get(&self, index: Index) -> Option> { match index { - Index::QuarterIndex => Some(self.by.by_quarterindex()), - Index::SemesterIndex => Some(self.by.by_semesterindex()), - Index::YearIndex => Some(self.by.by_yearindex()), + Index::DateIndex => Some(self.by.by_dateindex()), + Index::Height => Some(self.by.by_height()), _ => None, } } @@ -712,12 +707,9 @@ impl MetricPattern7By { pub fn by_dateindex(&self) -> Endpoint { Endpoint::new(self.client.clone(), self.name.clone(), Index::DateIndex) } - pub fn by_height(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::Height) - } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern7 { client: Arc, name: Arc, @@ -752,7 +744,6 @@ impl AnyMetricPattern for MetricPattern7 { fn indexes(&self) -> &'static [Index] { &[ Index::DateIndex, - Index::Height, ] } } @@ -761,7 +752,6 @@ impl MetricPattern for MetricPattern7 { fn get(&self, index: Index) -> Option> { match index { Index::DateIndex => Some(self.by.by_dateindex()), - Index::Height => Some(self.by.by_height()), _ => None, } } @@ -775,15 +765,12 @@ pub struct MetricPattern8By { } impl MetricPattern8By { - pub fn by_dateindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DateIndex) - } - pub fn by_monthindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::MonthIndex) + pub fn by_decadeindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::DecadeIndex) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern8 { client: Arc, name: Arc, @@ -817,8 +804,7 @@ impl AnyMetricPattern for MetricPattern8 { fn indexes(&self) -> &'static [Index] { &[ - Index::DateIndex, - Index::MonthIndex, + Index::DecadeIndex, ] } } @@ -826,8 +812,7 @@ impl AnyMetricPattern for MetricPattern8 { impl MetricPattern for MetricPattern8 { fn get(&self, index: Index) -> Option> { match index { - Index::DateIndex => Some(self.by.by_dateindex()), - Index::MonthIndex => Some(self.by.by_monthindex()), + Index::DecadeIndex => Some(self.by.by_decadeindex()), _ => None, } } @@ -841,15 +826,12 @@ pub struct MetricPattern9By { } impl MetricPattern9By { - pub fn by_dateindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DateIndex) - } - pub fn by_weekindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::WeekIndex) + pub fn by_difficultyepoch(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::DifficultyEpoch) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern9 { client: Arc, name: Arc, @@ -883,8 +865,7 @@ impl AnyMetricPattern for MetricPattern9 { fn indexes(&self) -> &'static [Index] { &[ - Index::DateIndex, - Index::WeekIndex, + Index::DifficultyEpoch, ] } } @@ -892,8 +873,7 @@ impl AnyMetricPattern for MetricPattern9 { impl MetricPattern for MetricPattern9 { fn get(&self, index: Index) -> Option> { match index { - Index::DateIndex => Some(self.by.by_dateindex()), - Index::WeekIndex => Some(self.by.by_weekindex()), + Index::DifficultyEpoch => Some(self.by.by_difficultyepoch()), _ => None, } } @@ -907,15 +887,12 @@ pub struct MetricPattern10By { } impl MetricPattern10By { - pub fn by_decadeindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DecadeIndex) - } - pub fn by_yearindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::YearIndex) + pub fn by_emptyoutputindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::EmptyOutputIndex) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern10 { client: Arc, name: Arc, @@ -949,8 +926,7 @@ impl AnyMetricPattern for MetricPattern10 { fn indexes(&self) -> &'static [Index] { &[ - Index::DecadeIndex, - Index::YearIndex, + Index::EmptyOutputIndex, ] } } @@ -958,8 +934,7 @@ impl AnyMetricPattern for MetricPattern10 { impl MetricPattern for MetricPattern10 { fn get(&self, index: Index) -> Option> { match index { - Index::DecadeIndex => Some(self.by.by_decadeindex()), - Index::YearIndex => Some(self.by.by_yearindex()), + Index::EmptyOutputIndex => Some(self.by.by_emptyoutputindex()), _ => None, } } @@ -973,15 +948,12 @@ pub struct MetricPattern11By { } impl MetricPattern11By { - pub fn by_difficultyepoch(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DifficultyEpoch) - } pub fn by_halvingepoch(&self) -> Endpoint { Endpoint::new(self.client.clone(), self.name.clone(), Index::HalvingEpoch) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern11 { client: Arc, name: Arc, @@ -1015,7 +987,6 @@ impl AnyMetricPattern for MetricPattern11 { fn indexes(&self) -> &'static [Index] { &[ - Index::DifficultyEpoch, Index::HalvingEpoch, ] } @@ -1024,7 +995,6 @@ impl AnyMetricPattern for MetricPattern11 { impl MetricPattern for MetricPattern11 { fn get(&self, index: Index) -> Option> { match index { - Index::DifficultyEpoch => Some(self.by.by_difficultyepoch()), Index::HalvingEpoch => Some(self.by.by_halvingepoch()), _ => None, } @@ -1039,15 +1009,12 @@ pub struct MetricPattern12By { } impl MetricPattern12By { - pub fn by_difficultyepoch(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DifficultyEpoch) - } pub fn by_height(&self) -> Endpoint { Endpoint::new(self.client.clone(), self.name.clone(), Index::Height) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern12 { client: Arc, name: Arc, @@ -1081,7 +1048,6 @@ impl AnyMetricPattern for MetricPattern12 { fn indexes(&self) -> &'static [Index] { &[ - Index::DifficultyEpoch, Index::Height, ] } @@ -1090,7 +1056,6 @@ impl AnyMetricPattern for MetricPattern12 { impl MetricPattern for MetricPattern12 { fn get(&self, index: Index) -> Option> { match index { - Index::DifficultyEpoch => Some(self.by.by_difficultyepoch()), Index::Height => Some(self.by.by_height()), _ => None, } @@ -1105,15 +1070,12 @@ pub struct MetricPattern13By { } impl MetricPattern13By { - pub fn by_halvingepoch(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::HalvingEpoch) - } - pub fn by_height(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::Height) + pub fn by_txinindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::TxInIndex) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern13 { client: Arc, name: Arc, @@ -1147,8 +1109,7 @@ impl AnyMetricPattern for MetricPattern13 { fn indexes(&self) -> &'static [Index] { &[ - Index::HalvingEpoch, - Index::Height, + Index::TxInIndex, ] } } @@ -1156,8 +1117,7 @@ impl AnyMetricPattern for MetricPattern13 { impl MetricPattern for MetricPattern13 { fn get(&self, index: Index) -> Option> { match index { - Index::HalvingEpoch => Some(self.by.by_halvingepoch()), - Index::Height => Some(self.by.by_height()), + Index::TxInIndex => Some(self.by.by_txinindex()), _ => None, } } @@ -1171,15 +1131,12 @@ pub struct MetricPattern14By { } impl MetricPattern14By { - pub fn by_height(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::Height) - } - pub fn by_txindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::TxIndex) + pub fn by_monthindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::MonthIndex) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern14 { client: Arc, name: Arc, @@ -1213,8 +1170,7 @@ impl AnyMetricPattern for MetricPattern14 { fn indexes(&self) -> &'static [Index] { &[ - Index::Height, - Index::TxIndex, + Index::MonthIndex, ] } } @@ -1222,8 +1178,7 @@ impl AnyMetricPattern for MetricPattern14 { impl MetricPattern for MetricPattern14 { fn get(&self, index: Index) -> Option> { match index { - Index::Height => Some(self.by.by_height()), - Index::TxIndex => Some(self.by.by_txindex()), + Index::MonthIndex => Some(self.by.by_monthindex()), _ => None, } } @@ -1237,15 +1192,12 @@ pub struct MetricPattern15By { } impl MetricPattern15By { - pub fn by_monthindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::MonthIndex) - } - pub fn by_quarterindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::QuarterIndex) + pub fn by_opreturnindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::OpReturnIndex) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern15 { client: Arc, name: Arc, @@ -1279,8 +1231,7 @@ impl AnyMetricPattern for MetricPattern15 { fn indexes(&self) -> &'static [Index] { &[ - Index::MonthIndex, - Index::QuarterIndex, + Index::OpReturnIndex, ] } } @@ -1288,8 +1239,7 @@ impl AnyMetricPattern for MetricPattern15 { impl MetricPattern for MetricPattern15 { fn get(&self, index: Index) -> Option> { match index { - Index::MonthIndex => Some(self.by.by_monthindex()), - Index::QuarterIndex => Some(self.by.by_quarterindex()), + Index::OpReturnIndex => Some(self.by.by_opreturnindex()), _ => None, } } @@ -1303,15 +1253,12 @@ pub struct MetricPattern16By { } impl MetricPattern16By { - pub fn by_monthindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::MonthIndex) - } - pub fn by_semesterindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::SemesterIndex) + pub fn by_txoutindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::TxOutIndex) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern16 { client: Arc, name: Arc, @@ -1345,8 +1292,7 @@ impl AnyMetricPattern for MetricPattern16 { fn indexes(&self) -> &'static [Index] { &[ - Index::MonthIndex, - Index::SemesterIndex, + Index::TxOutIndex, ] } } @@ -1354,8 +1300,7 @@ impl AnyMetricPattern for MetricPattern16 { impl MetricPattern for MetricPattern16 { fn get(&self, index: Index) -> Option> { match index { - Index::MonthIndex => Some(self.by.by_monthindex()), - Index::SemesterIndex => Some(self.by.by_semesterindex()), + Index::TxOutIndex => Some(self.by.by_txoutindex()), _ => None, } } @@ -1369,15 +1314,12 @@ pub struct MetricPattern17By { } impl MetricPattern17By { - pub fn by_monthindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::MonthIndex) - } - pub fn by_weekindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::WeekIndex) + pub fn by_p2aaddressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2AAddressIndex) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern17 { client: Arc, name: Arc, @@ -1411,8 +1353,7 @@ impl AnyMetricPattern for MetricPattern17 { fn indexes(&self) -> &'static [Index] { &[ - Index::MonthIndex, - Index::WeekIndex, + Index::P2AAddressIndex, ] } } @@ -1420,8 +1361,7 @@ impl AnyMetricPattern for MetricPattern17 { impl MetricPattern for MetricPattern17 { fn get(&self, index: Index) -> Option> { match index { - Index::MonthIndex => Some(self.by.by_monthindex()), - Index::WeekIndex => Some(self.by.by_weekindex()), + Index::P2AAddressIndex => Some(self.by.by_p2aaddressindex()), _ => None, } } @@ -1435,15 +1375,12 @@ pub struct MetricPattern18By { } impl MetricPattern18By { - pub fn by_monthindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::MonthIndex) - } - pub fn by_yearindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::YearIndex) + pub fn by_p2msoutputindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2MSOutputIndex) } } -/// Index accessor for metrics with 2 indexes. +/// Index accessor for metrics with 1 indexes. pub struct MetricPattern18 { client: Arc, name: Arc, @@ -1477,8 +1414,7 @@ impl AnyMetricPattern for MetricPattern18 { fn indexes(&self) -> &'static [Index] { &[ - Index::MonthIndex, - Index::YearIndex, + Index::P2MSOutputIndex, ] } } @@ -1486,8 +1422,7 @@ impl AnyMetricPattern for MetricPattern18 { impl MetricPattern for MetricPattern18 { fn get(&self, index: Index) -> Option> { match index { - Index::MonthIndex => Some(self.by.by_monthindex()), - Index::YearIndex => Some(self.by.by_yearindex()), + Index::P2MSOutputIndex => Some(self.by.by_p2msoutputindex()), _ => None, } } @@ -1501,8 +1436,8 @@ pub struct MetricPattern19By { } impl MetricPattern19By { - pub fn by_dateindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DateIndex) + pub fn by_p2pk33addressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PK33AddressIndex) } } @@ -1540,7 +1475,7 @@ impl AnyMetricPattern for MetricPattern19 { fn indexes(&self) -> &'static [Index] { &[ - Index::DateIndex, + Index::P2PK33AddressIndex, ] } } @@ -1548,7 +1483,7 @@ impl AnyMetricPattern for MetricPattern19 { impl MetricPattern for MetricPattern19 { fn get(&self, index: Index) -> Option> { match index { - Index::DateIndex => Some(self.by.by_dateindex()), + Index::P2PK33AddressIndex => Some(self.by.by_p2pk33addressindex()), _ => None, } } @@ -1562,8 +1497,8 @@ pub struct MetricPattern20By { } impl MetricPattern20By { - pub fn by_decadeindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DecadeIndex) + pub fn by_p2pk65addressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PK65AddressIndex) } } @@ -1601,7 +1536,7 @@ impl AnyMetricPattern for MetricPattern20 { fn indexes(&self) -> &'static [Index] { &[ - Index::DecadeIndex, + Index::P2PK65AddressIndex, ] } } @@ -1609,7 +1544,7 @@ impl AnyMetricPattern for MetricPattern20 { impl MetricPattern for MetricPattern20 { fn get(&self, index: Index) -> Option> { match index { - Index::DecadeIndex => Some(self.by.by_decadeindex()), + Index::P2PK65AddressIndex => Some(self.by.by_p2pk65addressindex()), _ => None, } } @@ -1623,8 +1558,8 @@ pub struct MetricPattern21By { } impl MetricPattern21By { - pub fn by_difficultyepoch(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DifficultyEpoch) + pub fn by_p2pkhaddressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PKHAddressIndex) } } @@ -1662,7 +1597,7 @@ impl AnyMetricPattern for MetricPattern21 { fn indexes(&self) -> &'static [Index] { &[ - Index::DifficultyEpoch, + Index::P2PKHAddressIndex, ] } } @@ -1670,7 +1605,7 @@ impl AnyMetricPattern for MetricPattern21 { impl MetricPattern for MetricPattern21 { fn get(&self, index: Index) -> Option> { match index { - Index::DifficultyEpoch => Some(self.by.by_difficultyepoch()), + Index::P2PKHAddressIndex => Some(self.by.by_p2pkhaddressindex()), _ => None, } } @@ -1684,8 +1619,8 @@ pub struct MetricPattern22By { } impl MetricPattern22By { - pub fn by_emptyoutputindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::EmptyOutputIndex) + pub fn by_p2shaddressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2SHAddressIndex) } } @@ -1723,7 +1658,7 @@ impl AnyMetricPattern for MetricPattern22 { fn indexes(&self) -> &'static [Index] { &[ - Index::EmptyOutputIndex, + Index::P2SHAddressIndex, ] } } @@ -1731,7 +1666,7 @@ impl AnyMetricPattern for MetricPattern22 { impl MetricPattern for MetricPattern22 { fn get(&self, index: Index) -> Option> { match index { - Index::EmptyOutputIndex => Some(self.by.by_emptyoutputindex()), + Index::P2SHAddressIndex => Some(self.by.by_p2shaddressindex()), _ => None, } } @@ -1745,8 +1680,8 @@ pub struct MetricPattern23By { } impl MetricPattern23By { - pub fn by_height(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::Height) + pub fn by_p2traddressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2TRAddressIndex) } } @@ -1784,7 +1719,7 @@ impl AnyMetricPattern for MetricPattern23 { fn indexes(&self) -> &'static [Index] { &[ - Index::Height, + Index::P2TRAddressIndex, ] } } @@ -1792,7 +1727,7 @@ impl AnyMetricPattern for MetricPattern23 { impl MetricPattern for MetricPattern23 { fn get(&self, index: Index) -> Option> { match index { - Index::Height => Some(self.by.by_height()), + Index::P2TRAddressIndex => Some(self.by.by_p2traddressindex()), _ => None, } } @@ -1806,8 +1741,8 @@ pub struct MetricPattern24By { } impl MetricPattern24By { - pub fn by_txinindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::TxInIndex) + pub fn by_p2wpkhaddressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2WPKHAddressIndex) } } @@ -1845,7 +1780,7 @@ impl AnyMetricPattern for MetricPattern24 { fn indexes(&self) -> &'static [Index] { &[ - Index::TxInIndex, + Index::P2WPKHAddressIndex, ] } } @@ -1853,7 +1788,7 @@ impl AnyMetricPattern for MetricPattern24 { impl MetricPattern for MetricPattern24 { fn get(&self, index: Index) -> Option> { match index { - Index::TxInIndex => Some(self.by.by_txinindex()), + Index::P2WPKHAddressIndex => Some(self.by.by_p2wpkhaddressindex()), _ => None, } } @@ -1867,8 +1802,8 @@ pub struct MetricPattern25By { } impl MetricPattern25By { - pub fn by_opreturnindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::OpReturnIndex) + pub fn by_p2wshaddressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::P2WSHAddressIndex) } } @@ -1906,7 +1841,7 @@ impl AnyMetricPattern for MetricPattern25 { fn indexes(&self) -> &'static [Index] { &[ - Index::OpReturnIndex, + Index::P2WSHAddressIndex, ] } } @@ -1914,7 +1849,7 @@ impl AnyMetricPattern for MetricPattern25 { impl MetricPattern for MetricPattern25 { fn get(&self, index: Index) -> Option> { match index { - Index::OpReturnIndex => Some(self.by.by_opreturnindex()), + Index::P2WSHAddressIndex => Some(self.by.by_p2wshaddressindex()), _ => None, } } @@ -1928,8 +1863,8 @@ pub struct MetricPattern26By { } impl MetricPattern26By { - pub fn by_txoutindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::TxOutIndex) + pub fn by_quarterindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::QuarterIndex) } } @@ -1967,7 +1902,7 @@ impl AnyMetricPattern for MetricPattern26 { fn indexes(&self) -> &'static [Index] { &[ - Index::TxOutIndex, + Index::QuarterIndex, ] } } @@ -1975,7 +1910,7 @@ impl AnyMetricPattern for MetricPattern26 { impl MetricPattern for MetricPattern26 { fn get(&self, index: Index) -> Option> { match index { - Index::TxOutIndex => Some(self.by.by_txoutindex()), + Index::QuarterIndex => Some(self.by.by_quarterindex()), _ => None, } } @@ -1989,8 +1924,8 @@ pub struct MetricPattern27By { } impl MetricPattern27By { - pub fn by_p2aaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2AAddressIndex) + pub fn by_semesterindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::SemesterIndex) } } @@ -2028,7 +1963,7 @@ impl AnyMetricPattern for MetricPattern27 { fn indexes(&self) -> &'static [Index] { &[ - Index::P2AAddressIndex, + Index::SemesterIndex, ] } } @@ -2036,7 +1971,7 @@ impl AnyMetricPattern for MetricPattern27 { impl MetricPattern for MetricPattern27 { fn get(&self, index: Index) -> Option> { match index { - Index::P2AAddressIndex => Some(self.by.by_p2aaddressindex()), + Index::SemesterIndex => Some(self.by.by_semesterindex()), _ => None, } } @@ -2050,8 +1985,8 @@ pub struct MetricPattern28By { } impl MetricPattern28By { - pub fn by_p2msoutputindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2MSOutputIndex) + pub fn by_txindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::TxIndex) } } @@ -2089,7 +2024,7 @@ impl AnyMetricPattern for MetricPattern28 { fn indexes(&self) -> &'static [Index] { &[ - Index::P2MSOutputIndex, + Index::TxIndex, ] } } @@ -2097,7 +2032,7 @@ impl AnyMetricPattern for MetricPattern28 { impl MetricPattern for MetricPattern28 { fn get(&self, index: Index) -> Option> { match index { - Index::P2MSOutputIndex => Some(self.by.by_p2msoutputindex()), + Index::TxIndex => Some(self.by.by_txindex()), _ => None, } } @@ -2111,8 +2046,8 @@ pub struct MetricPattern29By { } impl MetricPattern29By { - pub fn by_p2pk33addressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PK33AddressIndex) + pub fn by_unknownoutputindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::UnknownOutputIndex) } } @@ -2150,7 +2085,7 @@ impl AnyMetricPattern for MetricPattern29 { fn indexes(&self) -> &'static [Index] { &[ - Index::P2PK33AddressIndex, + Index::UnknownOutputIndex, ] } } @@ -2158,7 +2093,7 @@ impl AnyMetricPattern for MetricPattern29 { impl MetricPattern for MetricPattern29 { fn get(&self, index: Index) -> Option> { match index { - Index::P2PK33AddressIndex => Some(self.by.by_p2pk33addressindex()), + Index::UnknownOutputIndex => Some(self.by.by_unknownoutputindex()), _ => None, } } @@ -2172,8 +2107,8 @@ pub struct MetricPattern30By { } impl MetricPattern30By { - pub fn by_p2pk65addressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PK65AddressIndex) + pub fn by_weekindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::WeekIndex) } } @@ -2211,7 +2146,7 @@ impl AnyMetricPattern for MetricPattern30 { fn indexes(&self) -> &'static [Index] { &[ - Index::P2PK65AddressIndex, + Index::WeekIndex, ] } } @@ -2219,7 +2154,7 @@ impl AnyMetricPattern for MetricPattern30 { impl MetricPattern for MetricPattern30 { fn get(&self, index: Index) -> Option> { match index { - Index::P2PK65AddressIndex => Some(self.by.by_p2pk65addressindex()), + Index::WeekIndex => Some(self.by.by_weekindex()), _ => None, } } @@ -2233,8 +2168,8 @@ pub struct MetricPattern31By { } impl MetricPattern31By { - pub fn by_p2pkhaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PKHAddressIndex) + pub fn by_yearindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::YearIndex) } } @@ -2272,7 +2207,7 @@ impl AnyMetricPattern for MetricPattern31 { fn indexes(&self) -> &'static [Index] { &[ - Index::P2PKHAddressIndex, + Index::YearIndex, ] } } @@ -2280,7 +2215,7 @@ impl AnyMetricPattern for MetricPattern31 { impl MetricPattern for MetricPattern31 { fn get(&self, index: Index) -> Option> { match index { - Index::P2PKHAddressIndex => Some(self.by.by_p2pkhaddressindex()), + Index::YearIndex => Some(self.by.by_yearindex()), _ => None, } } @@ -2294,8 +2229,8 @@ pub struct MetricPattern32By { } impl MetricPattern32By { - pub fn by_p2shaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2SHAddressIndex) + pub fn by_loadedaddressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::LoadedAddressIndex) } } @@ -2333,7 +2268,7 @@ impl AnyMetricPattern for MetricPattern32 { fn indexes(&self) -> &'static [Index] { &[ - Index::P2SHAddressIndex, + Index::LoadedAddressIndex, ] } } @@ -2341,7 +2276,7 @@ impl AnyMetricPattern for MetricPattern32 { impl MetricPattern for MetricPattern32 { fn get(&self, index: Index) -> Option> { match index { - Index::P2SHAddressIndex => Some(self.by.by_p2shaddressindex()), + Index::LoadedAddressIndex => Some(self.by.by_loadedaddressindex()), _ => None, } } @@ -2355,8 +2290,8 @@ pub struct MetricPattern33By { } impl MetricPattern33By { - pub fn by_p2traddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2TRAddressIndex) + pub fn by_emptyaddressindex(&self) -> Endpoint { + Endpoint::new(self.client.clone(), self.name.clone(), Index::EmptyAddressIndex) } } @@ -2392,372 +2327,6 @@ impl AnyMetricPattern for MetricPattern33 { &self.name } - fn indexes(&self) -> &'static [Index] { - &[ - Index::P2TRAddressIndex, - ] - } -} - -impl MetricPattern for MetricPattern33 { - fn get(&self, index: Index) -> Option> { - match index { - Index::P2TRAddressIndex => Some(self.by.by_p2traddressindex()), - _ => None, - } - } -} - -/// Container for index endpoint methods. -pub struct MetricPattern34By { - client: Arc, - name: Arc, - _marker: std::marker::PhantomData, -} - -impl MetricPattern34By { - pub fn by_p2wpkhaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2WPKHAddressIndex) - } -} - -/// Index accessor for metrics with 1 indexes. -pub struct MetricPattern34 { - client: Arc, - name: Arc, - pub by: MetricPattern34By, -} - -impl MetricPattern34 { - pub fn new(client: Arc, name: String) -> Self { - let name: Arc = name.into(); - Self { - client: client.clone(), - name: name.clone(), - by: MetricPattern34By { - client, - name, - _marker: std::marker::PhantomData, - } - } - } - - /// Get the metric name. - pub fn name(&self) -> &str { - &self.name - } -} - -impl AnyMetricPattern for MetricPattern34 { - fn name(&self) -> &str { - &self.name - } - - fn indexes(&self) -> &'static [Index] { - &[ - Index::P2WPKHAddressIndex, - ] - } -} - -impl MetricPattern for MetricPattern34 { - fn get(&self, index: Index) -> Option> { - match index { - Index::P2WPKHAddressIndex => Some(self.by.by_p2wpkhaddressindex()), - _ => None, - } - } -} - -/// Container for index endpoint methods. -pub struct MetricPattern35By { - client: Arc, - name: Arc, - _marker: std::marker::PhantomData, -} - -impl MetricPattern35By { - pub fn by_p2wshaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2WSHAddressIndex) - } -} - -/// Index accessor for metrics with 1 indexes. -pub struct MetricPattern35 { - client: Arc, - name: Arc, - pub by: MetricPattern35By, -} - -impl MetricPattern35 { - pub fn new(client: Arc, name: String) -> Self { - let name: Arc = name.into(); - Self { - client: client.clone(), - name: name.clone(), - by: MetricPattern35By { - client, - name, - _marker: std::marker::PhantomData, - } - } - } - - /// Get the metric name. - pub fn name(&self) -> &str { - &self.name - } -} - -impl AnyMetricPattern for MetricPattern35 { - fn name(&self) -> &str { - &self.name - } - - fn indexes(&self) -> &'static [Index] { - &[ - Index::P2WSHAddressIndex, - ] - } -} - -impl MetricPattern for MetricPattern35 { - fn get(&self, index: Index) -> Option> { - match index { - Index::P2WSHAddressIndex => Some(self.by.by_p2wshaddressindex()), - _ => None, - } - } -} - -/// Container for index endpoint methods. -pub struct MetricPattern36By { - client: Arc, - name: Arc, - _marker: std::marker::PhantomData, -} - -impl MetricPattern36By { - pub fn by_txindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::TxIndex) - } -} - -/// Index accessor for metrics with 1 indexes. -pub struct MetricPattern36 { - client: Arc, - name: Arc, - pub by: MetricPattern36By, -} - -impl MetricPattern36 { - pub fn new(client: Arc, name: String) -> Self { - let name: Arc = name.into(); - Self { - client: client.clone(), - name: name.clone(), - by: MetricPattern36By { - client, - name, - _marker: std::marker::PhantomData, - } - } - } - - /// Get the metric name. - pub fn name(&self) -> &str { - &self.name - } -} - -impl AnyMetricPattern for MetricPattern36 { - fn name(&self) -> &str { - &self.name - } - - fn indexes(&self) -> &'static [Index] { - &[ - Index::TxIndex, - ] - } -} - -impl MetricPattern for MetricPattern36 { - fn get(&self, index: Index) -> Option> { - match index { - Index::TxIndex => Some(self.by.by_txindex()), - _ => None, - } - } -} - -/// Container for index endpoint methods. -pub struct MetricPattern37By { - client: Arc, - name: Arc, - _marker: std::marker::PhantomData, -} - -impl MetricPattern37By { - pub fn by_unknownoutputindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::UnknownOutputIndex) - } -} - -/// Index accessor for metrics with 1 indexes. -pub struct MetricPattern37 { - client: Arc, - name: Arc, - pub by: MetricPattern37By, -} - -impl MetricPattern37 { - pub fn new(client: Arc, name: String) -> Self { - let name: Arc = name.into(); - Self { - client: client.clone(), - name: name.clone(), - by: MetricPattern37By { - client, - name, - _marker: std::marker::PhantomData, - } - } - } - - /// Get the metric name. - pub fn name(&self) -> &str { - &self.name - } -} - -impl AnyMetricPattern for MetricPattern37 { - fn name(&self) -> &str { - &self.name - } - - fn indexes(&self) -> &'static [Index] { - &[ - Index::UnknownOutputIndex, - ] - } -} - -impl MetricPattern for MetricPattern37 { - fn get(&self, index: Index) -> Option> { - match index { - Index::UnknownOutputIndex => Some(self.by.by_unknownoutputindex()), - _ => None, - } - } -} - -/// Container for index endpoint methods. -pub struct MetricPattern38By { - client: Arc, - name: Arc, - _marker: std::marker::PhantomData, -} - -impl MetricPattern38By { - pub fn by_loadedaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::LoadedAddressIndex) - } -} - -/// Index accessor for metrics with 1 indexes. -pub struct MetricPattern38 { - client: Arc, - name: Arc, - pub by: MetricPattern38By, -} - -impl MetricPattern38 { - pub fn new(client: Arc, name: String) -> Self { - let name: Arc = name.into(); - Self { - client: client.clone(), - name: name.clone(), - by: MetricPattern38By { - client, - name, - _marker: std::marker::PhantomData, - } - } - } - - /// Get the metric name. - pub fn name(&self) -> &str { - &self.name - } -} - -impl AnyMetricPattern for MetricPattern38 { - fn name(&self) -> &str { - &self.name - } - - fn indexes(&self) -> &'static [Index] { - &[ - Index::LoadedAddressIndex, - ] - } -} - -impl MetricPattern for MetricPattern38 { - fn get(&self, index: Index) -> Option> { - match index { - Index::LoadedAddressIndex => Some(self.by.by_loadedaddressindex()), - _ => None, - } - } -} - -/// Container for index endpoint methods. -pub struct MetricPattern39By { - client: Arc, - name: Arc, - _marker: std::marker::PhantomData, -} - -impl MetricPattern39By { - pub fn by_emptyaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::EmptyAddressIndex) - } -} - -/// Index accessor for metrics with 1 indexes. -pub struct MetricPattern39 { - client: Arc, - name: Arc, - pub by: MetricPattern39By, -} - -impl MetricPattern39 { - pub fn new(client: Arc, name: String) -> Self { - let name: Arc = name.into(); - Self { - client: client.clone(), - name: name.clone(), - by: MetricPattern39By { - client, - name, - _marker: std::marker::PhantomData, - } - } - } - - /// Get the metric name. - pub fn name(&self) -> &str { - &self.name - } -} - -impl AnyMetricPattern for MetricPattern39 { - fn name(&self) -> &str { - &self.name - } - fn indexes(&self) -> &'static [Index] { &[ Index::EmptyAddressIndex, @@ -2765,7 +2334,7 @@ impl AnyMetricPattern for MetricPattern39 { } } -impl MetricPattern for MetricPattern39 { +impl MetricPattern for MetricPattern33 { fn get(&self, index: Index) -> Option> { match index { Index::EmptyAddressIndex => Some(self.by.by_emptyaddressindex()), @@ -2778,9 +2347,9 @@ impl MetricPattern for MetricPattern39 { /// Pattern struct for repeated tree structure. pub struct RealizedPattern3 { - pub adjusted_sopr: MetricPattern19, - pub adjusted_sopr_30d_ema: MetricPattern19, - pub adjusted_sopr_7d_ema: MetricPattern19, + pub adjusted_sopr: MetricPattern7, + pub adjusted_sopr_30d_ema: MetricPattern7, + pub adjusted_sopr_7d_ema: MetricPattern7, pub adjusted_value_created: MetricPattern1, pub adjusted_value_destroyed: MetricPattern1, pub mvrv: MetricPattern4, @@ -2799,14 +2368,14 @@ pub struct RealizedPattern3 { pub realized_price_extra: ActivePriceRatioPattern, pub realized_profit: BlockCountPattern, pub realized_profit_rel_to_realized_cap: BlockCountPattern, - pub realized_profit_to_loss_ratio: MetricPattern19, + pub realized_profit_to_loss_ratio: MetricPattern7, pub realized_value: MetricPattern1, - pub sell_side_risk_ratio: MetricPattern19, - pub sell_side_risk_ratio_30d_ema: MetricPattern19, - pub sell_side_risk_ratio_7d_ema: MetricPattern19, - pub sopr: MetricPattern19, - pub sopr_30d_ema: MetricPattern19, - pub sopr_7d_ema: MetricPattern19, + pub sell_side_risk_ratio: MetricPattern7, + pub sell_side_risk_ratio_30d_ema: MetricPattern7, + pub sell_side_risk_ratio_7d_ema: MetricPattern7, + pub sopr: MetricPattern7, + pub sopr_30d_ema: MetricPattern7, + pub sopr_7d_ema: MetricPattern7, pub total_realized_pnl: MetricPattern1, pub value_created: MetricPattern1, pub value_destroyed: MetricPattern1, @@ -2816,9 +2385,9 @@ impl RealizedPattern3 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - adjusted_sopr: MetricPattern19::new(client.clone(), _m(&acc, "adjusted_sopr")), - adjusted_sopr_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "adjusted_sopr_30d_ema")), - adjusted_sopr_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "adjusted_sopr_7d_ema")), + adjusted_sopr: MetricPattern7::new(client.clone(), _m(&acc, "adjusted_sopr")), + adjusted_sopr_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "adjusted_sopr_30d_ema")), + adjusted_sopr_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "adjusted_sopr_7d_ema")), adjusted_value_created: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created")), adjusted_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), mvrv: MetricPattern4::new(client.clone(), _m(&acc, "mvrv")), @@ -2837,14 +2406,14 @@ impl RealizedPattern3 { realized_price_extra: ActivePriceRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), realized_profit: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), - realized_profit_to_loss_ratio: MetricPattern19::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), + realized_profit_to_loss_ratio: MetricPattern7::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), - sell_side_risk_ratio: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), - sopr: MetricPattern19::new(client.clone(), _m(&acc, "sopr")), - sopr_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sopr_30d_ema")), - sopr_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sopr_7d_ema")), + sell_side_risk_ratio: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), + sell_side_risk_ratio_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), + sell_side_risk_ratio_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + sopr: MetricPattern7::new(client.clone(), _m(&acc, "sopr")), + sopr_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sopr_30d_ema")), + sopr_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sopr_7d_ema")), total_realized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_realized_pnl")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), @@ -2854,9 +2423,9 @@ impl RealizedPattern3 { /// Pattern struct for repeated tree structure. pub struct RealizedPattern4 { - pub adjusted_sopr: MetricPattern19, - pub adjusted_sopr_30d_ema: MetricPattern19, - pub adjusted_sopr_7d_ema: MetricPattern19, + pub adjusted_sopr: MetricPattern7, + pub adjusted_sopr_30d_ema: MetricPattern7, + pub adjusted_sopr_7d_ema: MetricPattern7, pub adjusted_value_created: MetricPattern1, pub adjusted_value_destroyed: MetricPattern1, pub mvrv: MetricPattern4, @@ -2875,12 +2444,12 @@ pub struct RealizedPattern4 { pub realized_profit: BlockCountPattern, pub realized_profit_rel_to_realized_cap: BlockCountPattern, pub realized_value: MetricPattern1, - pub sell_side_risk_ratio: MetricPattern19, - pub sell_side_risk_ratio_30d_ema: MetricPattern19, - pub sell_side_risk_ratio_7d_ema: MetricPattern19, - pub sopr: MetricPattern19, - pub sopr_30d_ema: MetricPattern19, - pub sopr_7d_ema: MetricPattern19, + pub sell_side_risk_ratio: MetricPattern7, + pub sell_side_risk_ratio_30d_ema: MetricPattern7, + pub sell_side_risk_ratio_7d_ema: MetricPattern7, + pub sopr: MetricPattern7, + pub sopr_30d_ema: MetricPattern7, + pub sopr_7d_ema: MetricPattern7, pub total_realized_pnl: MetricPattern1, pub value_created: MetricPattern1, pub value_destroyed: MetricPattern1, @@ -2890,9 +2459,9 @@ impl RealizedPattern4 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - adjusted_sopr: MetricPattern19::new(client.clone(), _m(&acc, "adjusted_sopr")), - adjusted_sopr_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "adjusted_sopr_30d_ema")), - adjusted_sopr_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "adjusted_sopr_7d_ema")), + adjusted_sopr: MetricPattern7::new(client.clone(), _m(&acc, "adjusted_sopr")), + adjusted_sopr_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "adjusted_sopr_30d_ema")), + adjusted_sopr_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "adjusted_sopr_7d_ema")), adjusted_value_created: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created")), adjusted_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), mvrv: MetricPattern4::new(client.clone(), _m(&acc, "mvrv")), @@ -2911,12 +2480,12 @@ impl RealizedPattern4 { realized_profit: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), - sell_side_risk_ratio: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), - sopr: MetricPattern19::new(client.clone(), _m(&acc, "sopr")), - sopr_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sopr_30d_ema")), - sopr_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sopr_7d_ema")), + sell_side_risk_ratio: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), + sell_side_risk_ratio_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), + sell_side_risk_ratio_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + sopr: MetricPattern7::new(client.clone(), _m(&acc, "sopr")), + sopr_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sopr_30d_ema")), + sopr_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sopr_7d_ema")), total_realized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_realized_pnl")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), @@ -3010,14 +2579,14 @@ pub struct RealizedPattern2 { pub realized_price_extra: ActivePriceRatioPattern, pub realized_profit: BlockCountPattern, pub realized_profit_rel_to_realized_cap: BlockCountPattern, - pub realized_profit_to_loss_ratio: MetricPattern19, + pub realized_profit_to_loss_ratio: MetricPattern7, pub realized_value: MetricPattern1, - pub sell_side_risk_ratio: MetricPattern19, - pub sell_side_risk_ratio_30d_ema: MetricPattern19, - pub sell_side_risk_ratio_7d_ema: MetricPattern19, - pub sopr: MetricPattern19, - pub sopr_30d_ema: MetricPattern19, - pub sopr_7d_ema: MetricPattern19, + pub sell_side_risk_ratio: MetricPattern7, + pub sell_side_risk_ratio_30d_ema: MetricPattern7, + pub sell_side_risk_ratio_7d_ema: MetricPattern7, + pub sopr: MetricPattern7, + pub sopr_30d_ema: MetricPattern7, + pub sopr_7d_ema: MetricPattern7, pub total_realized_pnl: MetricPattern1, pub value_created: MetricPattern1, pub value_destroyed: MetricPattern1, @@ -3043,14 +2612,14 @@ impl RealizedPattern2 { realized_price_extra: ActivePriceRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), realized_profit: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), - realized_profit_to_loss_ratio: MetricPattern19::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), + realized_profit_to_loss_ratio: MetricPattern7::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), - sell_side_risk_ratio: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), - sopr: MetricPattern19::new(client.clone(), _m(&acc, "sopr")), - sopr_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sopr_30d_ema")), - sopr_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sopr_7d_ema")), + sell_side_risk_ratio: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), + sell_side_risk_ratio_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), + sell_side_risk_ratio_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + sopr: MetricPattern7::new(client.clone(), _m(&acc, "sopr")), + sopr_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sopr_30d_ema")), + sopr_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sopr_7d_ema")), total_realized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_realized_pnl")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), @@ -3076,12 +2645,12 @@ pub struct RealizedPattern { pub realized_profit: BlockCountPattern, pub realized_profit_rel_to_realized_cap: BlockCountPattern, pub realized_value: MetricPattern1, - pub sell_side_risk_ratio: MetricPattern19, - pub sell_side_risk_ratio_30d_ema: MetricPattern19, - pub sell_side_risk_ratio_7d_ema: MetricPattern19, - pub sopr: MetricPattern19, - pub sopr_30d_ema: MetricPattern19, - pub sopr_7d_ema: MetricPattern19, + pub sell_side_risk_ratio: MetricPattern7, + pub sell_side_risk_ratio_30d_ema: MetricPattern7, + pub sell_side_risk_ratio_7d_ema: MetricPattern7, + pub sopr: MetricPattern7, + pub sopr_30d_ema: MetricPattern7, + pub sopr_7d_ema: MetricPattern7, pub total_realized_pnl: MetricPattern1, pub value_created: MetricPattern1, pub value_destroyed: MetricPattern1, @@ -3107,12 +2676,12 @@ impl RealizedPattern { realized_profit: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), - sell_side_risk_ratio: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), - sopr: MetricPattern19::new(client.clone(), _m(&acc, "sopr")), - sopr_30d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sopr_30d_ema")), - sopr_7d_ema: MetricPattern19::new(client.clone(), _m(&acc, "sopr_7d_ema")), + sell_side_risk_ratio: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), + sell_side_risk_ratio_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), + sell_side_risk_ratio_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + sopr: MetricPattern7::new(client.clone(), _m(&acc, "sopr")), + sopr_30d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sopr_30d_ema")), + sopr_7d_ema: MetricPattern7::new(client.clone(), _m(&acc, "sopr_7d_ema")), total_realized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_realized_pnl")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), @@ -3274,48 +2843,48 @@ impl PercentilesPattern2 { /// Pattern struct for repeated tree structure. pub struct RelativePattern5 { - pub neg_unrealized_loss_rel_to_market_cap: MetricPattern3, - pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern3, - pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub net_unrealized_pnl_rel_to_market_cap: MetricPattern3, - pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern3, - pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub nupl: MetricPattern4, - pub supply_in_loss_rel_to_circulating_supply: MetricPattern3, - pub supply_in_loss_rel_to_own_supply: MetricPattern3, - pub supply_in_profit_rel_to_circulating_supply: MetricPattern3, - pub supply_in_profit_rel_to_own_supply: MetricPattern3, + pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, + pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, + pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub nupl: MetricPattern1, + pub supply_in_loss_rel_to_circulating_supply: MetricPattern1, + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_circulating_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, pub supply_rel_to_circulating_supply: MetricPattern4, - pub unrealized_loss_rel_to_market_cap: MetricPattern3, - pub unrealized_loss_rel_to_own_market_cap: MetricPattern3, - pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub unrealized_profit_rel_to_market_cap: MetricPattern3, - pub unrealized_profit_rel_to_own_market_cap: MetricPattern3, - pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3, + pub unrealized_loss_rel_to_market_cap: MetricPattern1, + pub unrealized_loss_rel_to_own_market_cap: MetricPattern1, + pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub unrealized_profit_rel_to_market_cap: MetricPattern1, + pub unrealized_profit_rel_to_own_market_cap: MetricPattern1, + pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, } impl RelativePattern5 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - neg_unrealized_loss_rel_to_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), - neg_unrealized_loss_rel_to_own_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), - neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), - net_unrealized_pnl_rel_to_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), - net_unrealized_pnl_rel_to_own_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), - net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), - nupl: MetricPattern4::new(client.clone(), _m(&acc, "nupl")), - supply_in_loss_rel_to_circulating_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), - supply_in_loss_rel_to_own_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_circulating_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), + neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), + neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), + neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), + net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), + net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), + net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), + nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")), + supply_in_loss_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), + supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), + supply_in_profit_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), + supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), supply_rel_to_circulating_supply: MetricPattern4::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), - unrealized_loss_rel_to_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), - unrealized_loss_rel_to_own_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), - unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), - unrealized_profit_rel_to_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), - unrealized_profit_rel_to_own_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), - unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), + unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), + unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), + unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), + unrealized_profit_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), + unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), + unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), } } } @@ -3400,36 +2969,36 @@ impl PriceAgoPattern { /// Pattern struct for repeated tree structure. pub struct PeriodLumpSumStackPattern { - pub _10y: ActiveSupplyPattern, - pub _1m: ActiveSupplyPattern, - pub _1w: ActiveSupplyPattern, - pub _1y: ActiveSupplyPattern, - pub _2y: ActiveSupplyPattern, - pub _3m: ActiveSupplyPattern, - pub _3y: ActiveSupplyPattern, - pub _4y: ActiveSupplyPattern, - pub _5y: ActiveSupplyPattern, - pub _6m: ActiveSupplyPattern, - pub _6y: ActiveSupplyPattern, - pub _8y: ActiveSupplyPattern, + pub _10y: _24hCoinbaseSumPattern, + pub _1m: _24hCoinbaseSumPattern, + pub _1w: _24hCoinbaseSumPattern, + pub _1y: _24hCoinbaseSumPattern, + pub _2y: _24hCoinbaseSumPattern, + pub _3m: _24hCoinbaseSumPattern, + pub _3y: _24hCoinbaseSumPattern, + pub _4y: _24hCoinbaseSumPattern, + pub _5y: _24hCoinbaseSumPattern, + pub _6m: _24hCoinbaseSumPattern, + pub _6y: _24hCoinbaseSumPattern, + pub _8y: _24hCoinbaseSumPattern, } impl PeriodLumpSumStackPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _10y: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "10y".to_string() } else { format!("10y_{acc}") }), - _1m: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "1m".to_string() } else { format!("1m_{acc}") }), - _1w: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "1w".to_string() } else { format!("1w_{acc}") }), - _1y: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "1y".to_string() } else { format!("1y_{acc}") }), - _2y: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "2y".to_string() } else { format!("2y_{acc}") }), - _3m: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "3m".to_string() } else { format!("3m_{acc}") }), - _3y: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "3y".to_string() } else { format!("3y_{acc}") }), - _4y: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "4y".to_string() } else { format!("4y_{acc}") }), - _5y: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "5y".to_string() } else { format!("5y_{acc}") }), - _6m: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "6m".to_string() } else { format!("6m_{acc}") }), - _6y: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "6y".to_string() } else { format!("6y_{acc}") }), - _8y: ActiveSupplyPattern::new(client.clone(), if acc.is_empty() { "8y".to_string() } else { format!("8y_{acc}") }), + _10y: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "10y".to_string() } else { format!("10y_{acc}") }), + _1m: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "1m".to_string() } else { format!("1m_{acc}") }), + _1w: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "1w".to_string() } else { format!("1w_{acc}") }), + _1y: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "1y".to_string() } else { format!("1y_{acc}") }), + _2y: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "2y".to_string() } else { format!("2y_{acc}") }), + _3m: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "3m".to_string() } else { format!("3m_{acc}") }), + _3y: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "3y".to_string() } else { format!("3y_{acc}") }), + _4y: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "4y".to_string() } else { format!("4y_{acc}") }), + _5y: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "5y".to_string() } else { format!("5y_{acc}") }), + _6m: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "6m".to_string() } else { format!("6m_{acc}") }), + _6y: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "6y".to_string() } else { format!("6y_{acc}") }), + _8y: _24hCoinbaseSumPattern::new(client.clone(), if acc.is_empty() { "8y".to_string() } else { format!("8y_{acc}") }), } } } @@ -3504,66 +3073,66 @@ impl ClassAveragePricePattern { } } -/// Pattern struct for repeated tree structure. -pub struct RelativePattern2 { - pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern3, - pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern3, - pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub supply_in_loss_rel_to_own_supply: MetricPattern3, - pub supply_in_profit_rel_to_own_supply: MetricPattern3, - pub unrealized_loss_rel_to_own_market_cap: MetricPattern3, - pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub unrealized_profit_rel_to_own_market_cap: MetricPattern3, - pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3, -} - -impl RelativePattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - neg_unrealized_loss_rel_to_own_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), - neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), - net_unrealized_pnl_rel_to_own_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), - net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), - supply_in_loss_rel_to_own_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), - unrealized_loss_rel_to_own_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), - unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), - unrealized_profit_rel_to_own_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), - unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct RelativePattern { - pub neg_unrealized_loss_rel_to_market_cap: MetricPattern3, - pub net_unrealized_pnl_rel_to_market_cap: MetricPattern3, - pub nupl: MetricPattern4, - pub supply_in_loss_rel_to_circulating_supply: MetricPattern3, - pub supply_in_loss_rel_to_own_supply: MetricPattern3, - pub supply_in_profit_rel_to_circulating_supply: MetricPattern3, - pub supply_in_profit_rel_to_own_supply: MetricPattern3, + pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, + pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1, + pub nupl: MetricPattern1, + pub supply_in_loss_rel_to_circulating_supply: MetricPattern1, + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_circulating_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, pub supply_rel_to_circulating_supply: MetricPattern4, - pub unrealized_loss_rel_to_market_cap: MetricPattern3, - pub unrealized_profit_rel_to_market_cap: MetricPattern3, + pub unrealized_loss_rel_to_market_cap: MetricPattern1, + pub unrealized_profit_rel_to_market_cap: MetricPattern1, } impl RelativePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - neg_unrealized_loss_rel_to_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), - net_unrealized_pnl_rel_to_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), - nupl: MetricPattern4::new(client.clone(), _m(&acc, "nupl")), - supply_in_loss_rel_to_circulating_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), - supply_in_loss_rel_to_own_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_circulating_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern3::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), + neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), + net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), + nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")), + supply_in_loss_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), + supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), + supply_in_profit_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), + supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), supply_rel_to_circulating_supply: MetricPattern4::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), - unrealized_loss_rel_to_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), - unrealized_profit_rel_to_market_cap: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), + unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), + unrealized_profit_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct RelativePattern2 { + pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, + pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, + pub unrealized_loss_rel_to_own_market_cap: MetricPattern1, + pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub unrealized_profit_rel_to_own_market_cap: MetricPattern1, + pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, +} + +impl RelativePattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), + neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), + net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), + net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), + supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), + supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), + unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), + unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), + unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), + unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), } } } @@ -3599,31 +3168,61 @@ impl AddrCountPattern { } /// Pattern struct for repeated tree structure. -pub struct UnrealizedPattern { - pub neg_unrealized_loss: MetricPattern3, - pub net_unrealized_pnl: MetricPattern3, - pub supply_in_loss: SupplyInLossPattern, - pub supply_in_loss_value: SupplyInLossValuePattern, - pub supply_in_profit: SupplyInLossPattern, - pub supply_in_profit_value: SupplyInLossValuePattern, - pub total_unrealized_pnl: MetricPattern3, - pub unrealized_loss: MetricPattern3, - pub unrealized_profit: MetricPattern3, +pub struct OhlcPattern { + pub dateindex: MetricPattern7, + pub decade: MetricPattern8, + pub difficultyepoch: MetricPattern9, + pub height: MetricPattern12, + pub month: MetricPattern14, + pub quarter: MetricPattern26, + pub semester: MetricPattern27, + pub week: MetricPattern30, + pub year: MetricPattern31, } -impl UnrealizedPattern { +impl OhlcPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - neg_unrealized_loss: MetricPattern3::new(client.clone(), _m(&acc, "neg_unrealized_loss")), - net_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl")), - supply_in_loss: SupplyInLossPattern::new(client.clone(), _m(&acc, "supply_in_loss")), - supply_in_loss_value: SupplyInLossValuePattern::new(client.clone(), _m(&acc, "supply_in_loss")), - supply_in_profit: SupplyInLossPattern::new(client.clone(), _m(&acc, "supply_in_profit")), - supply_in_profit_value: SupplyInLossValuePattern::new(client.clone(), _m(&acc, "supply_in_profit")), - total_unrealized_pnl: MetricPattern3::new(client.clone(), _m(&acc, "total_unrealized_pnl")), - unrealized_loss: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_loss")), - unrealized_profit: MetricPattern3::new(client.clone(), _m(&acc, "unrealized_profit")), + dateindex: MetricPattern7::new(client.clone(), acc.clone()), + decade: MetricPattern8::new(client.clone(), acc.clone()), + difficultyepoch: MetricPattern9::new(client.clone(), acc.clone()), + height: MetricPattern12::new(client.clone(), acc.clone()), + month: MetricPattern14::new(client.clone(), acc.clone()), + quarter: MetricPattern26::new(client.clone(), acc.clone()), + semester: MetricPattern27::new(client.clone(), acc.clone()), + week: MetricPattern30::new(client.clone(), acc.clone()), + year: MetricPattern31::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct FeeRatePattern { + pub average: MetricPattern1, + pub max: MetricPattern1, + pub median: MetricPattern12, + pub min: MetricPattern1, + pub pct10: MetricPattern12, + pub pct25: MetricPattern12, + pub pct75: MetricPattern12, + pub pct90: MetricPattern12, + pub txindex: MetricPattern28, +} + +impl FeeRatePattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + average: MetricPattern1::new(client.clone(), _m(&acc, "average")), + max: MetricPattern1::new(client.clone(), _m(&acc, "max")), + median: MetricPattern12::new(client.clone(), _m(&acc, "median")), + min: MetricPattern1::new(client.clone(), _m(&acc, "min")), + pct10: MetricPattern12::new(client.clone(), _m(&acc, "pct10")), + pct25: MetricPattern12::new(client.clone(), _m(&acc, "pct25")), + pct75: MetricPattern12::new(client.clone(), _m(&acc, "pct75")), + pct90: MetricPattern12::new(client.clone(), _m(&acc, "pct90")), + txindex: MetricPattern28::new(client.clone(), acc.clone()), } } } @@ -3633,6 +3232,7 @@ pub struct _0satsPattern { pub activity: ActivityPattern2, pub addr_count: MetricPattern1, pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, pub realized: RealizedPattern, pub relative: RelativePattern, pub supply: SupplyPattern2, @@ -3646,9 +3246,88 @@ impl _0satsPattern { activity: ActivityPattern2::new(client.clone(), acc.clone()), addr_count: MetricPattern1::new(client.clone(), _m(&acc, "addr_count")), cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), acc.clone()), realized: RealizedPattern::new(client.clone(), acc.clone()), relative: RelativePattern::new(client.clone(), acc.clone()), - supply: SupplyPattern2::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), + unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct UnrealizedPattern { + pub neg_unrealized_loss: MetricPattern1, + pub net_unrealized_pnl: MetricPattern1, + pub supply_in_loss: _24hCoinbaseSumPattern, + pub supply_in_profit: _24hCoinbaseSumPattern, + pub total_unrealized_pnl: MetricPattern1, + pub unrealized_loss: MetricPattern1, + pub unrealized_profit: MetricPattern1, +} + +impl UnrealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + neg_unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")), + net_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl")), + supply_in_loss: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_loss")), + supply_in_profit: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_profit")), + total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_unrealized_pnl")), + unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss")), + unrealized_profit: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btcPattern { + pub activity: ActivityPattern2, + pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, + pub realized: RealizedPattern, + pub relative: RelativePattern, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, +} + +impl _100btcPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: ActivityPattern2::new(client.clone(), acc.clone()), + cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), acc.clone()), + realized: RealizedPattern::new(client.clone(), acc.clone()), + relative: RelativePattern::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), + unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _10yPattern { + pub activity: ActivityPattern2, + pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, + pub realized: RealizedPattern4, + pub relative: RelativePattern, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, +} + +impl _10yPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: ActivityPattern2::new(client.clone(), acc.clone()), + cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), acc.clone()), + realized: RealizedPattern4::new(client.clone(), acc.clone()), + relative: RelativePattern::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), } } @@ -3680,36 +3359,11 @@ impl PeriodCagrPattern { } } -/// Pattern struct for repeated tree structure. -pub struct BitcoinPattern { - pub average: MetricPattern2, - pub base: MetricPattern23, - pub cumulative: MetricPattern1, - pub max: MetricPattern2, - pub min: MetricPattern2, - pub percentiles: PercentilesPattern, - pub sum: MetricPattern2, -} - -impl BitcoinPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - average: MetricPattern2::new(client.clone(), _m(&acc, "average")), - base: MetricPattern23::new(client.clone(), acc.clone()), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), - max: MetricPattern2::new(client.clone(), _m(&acc, "max")), - min: MetricPattern2::new(client.clone(), _m(&acc, "min")), - percentiles: PercentilesPattern::new(client.clone(), acc.clone()), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct _0satsPattern2 { pub activity: ActivityPattern2, pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, pub realized: RealizedPattern, pub relative: RelativePattern4, pub supply: SupplyPattern2, @@ -3722,9 +3376,10 @@ impl _0satsPattern2 { Self { activity: ActivityPattern2::new(client.clone(), acc.clone()), cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), acc.clone()), realized: RealizedPattern::new(client.clone(), acc.clone()), relative: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")), - supply: SupplyPattern2::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), } } @@ -3734,6 +3389,7 @@ impl _0satsPattern2 { pub struct _10yTo12yPattern { pub activity: ActivityPattern2, pub cost_basis: CostBasisPattern2, + pub outputs: OutputsPattern, pub realized: RealizedPattern2, pub relative: RelativePattern2, pub supply: SupplyPattern2, @@ -3746,64 +3402,43 @@ impl _10yTo12yPattern { Self { activity: ActivityPattern2::new(client.clone(), acc.clone()), cost_basis: CostBasisPattern2::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), acc.clone()), realized: RealizedPattern2::new(client.clone(), acc.clone()), relative: RelativePattern2::new(client.clone(), acc.clone()), - supply: SupplyPattern2::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. -pub struct _10yPattern { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern, - pub realized: RealizedPattern4, - pub relative: RelativePattern, - pub supply: SupplyPattern2, - pub unrealized: UnrealizedPattern, +pub struct BitcoinPattern { + pub average: MetricPattern2, + pub cumulative: MetricPattern1, + pub height: MetricPattern12, + pub max: MetricPattern2, + pub min: MetricPattern2, + pub percentiles: PercentilesPattern, + pub sum: MetricPattern2, } -impl _10yPattern { +impl BitcoinPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - activity: ActivityPattern2::new(client.clone(), acc.clone()), - cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), - realized: RealizedPattern4::new(client.clone(), acc.clone()), - relative: RelativePattern::new(client.clone(), acc.clone()), - supply: SupplyPattern2::new(client.clone(), acc.clone()), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), + average: MetricPattern2::new(client.clone(), _m(&acc, "average")), + cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + height: MetricPattern12::new(client.clone(), acc.clone()), + max: MetricPattern2::new(client.clone(), _m(&acc, "max")), + min: MetricPattern2::new(client.clone(), _m(&acc, "min")), + percentiles: PercentilesPattern::new(client.clone(), acc.clone()), + sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), } } } /// Pattern struct for repeated tree structure. -pub struct _100btcPattern { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern, - pub realized: RealizedPattern, - pub relative: RelativePattern, - pub supply: SupplyPattern2, - pub unrealized: UnrealizedPattern, -} - -impl _100btcPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: ActivityPattern2::new(client.clone(), acc.clone()), - cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), - realized: RealizedPattern::new(client.clone(), acc.clone()), - relative: RelativePattern::new(client.clone(), acc.clone()), - supply: SupplyPattern2::new(client.clone(), acc.clone()), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct BlockSizePattern { +pub struct SizePattern { pub average: MetricPattern2, pub cumulative: MetricPattern1, pub max: MetricPattern2, @@ -3812,7 +3447,7 @@ pub struct BlockSizePattern { pub sum: MetricPattern2, } -impl BlockSizePattern { +impl SizePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -3830,9 +3465,9 @@ impl BlockSizePattern { pub struct ActivityPattern2 { pub coinblocks_destroyed: BlockCountPattern, pub coindays_destroyed: BlockCountPattern, - pub satblocks_destroyed: MetricPattern23, - pub satdays_destroyed: MetricPattern23, - pub sent: SentPattern, + pub satblocks_destroyed: MetricPattern12, + pub satdays_destroyed: MetricPattern12, + pub sent: UnclaimedRewardsPattern, } impl ActivityPattern2 { @@ -3841,131 +3476,127 @@ impl ActivityPattern2 { Self { coinblocks_destroyed: BlockCountPattern::new(client.clone(), _m(&acc, "coinblocks_destroyed")), coindays_destroyed: BlockCountPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), - satblocks_destroyed: MetricPattern23::new(client.clone(), _m(&acc, "satblocks_destroyed")), - satdays_destroyed: MetricPattern23::new(client.clone(), _m(&acc, "satdays_destroyed")), - sent: SentPattern::new(client.clone(), _m(&acc, "sent")), + satblocks_destroyed: MetricPattern12::new(client.clone(), _m(&acc, "satblocks_destroyed")), + satdays_destroyed: MetricPattern12::new(client.clone(), _m(&acc, "satdays_destroyed")), + sent: UnclaimedRewardsPattern::new(client.clone(), _m(&acc, "sent")), } } } /// Pattern struct for repeated tree structure. pub struct PercentilesPattern { - pub median: MetricPattern19, - pub pct10: MetricPattern19, - pub pct25: MetricPattern19, - pub pct75: MetricPattern19, - pub pct90: MetricPattern19, + pub median: MetricPattern7, + pub pct10: MetricPattern7, + pub pct25: MetricPattern7, + pub pct75: MetricPattern7, + pub pct90: MetricPattern7, } impl PercentilesPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - median: MetricPattern19::new(client.clone(), _m(&acc, "median")), - pct10: MetricPattern19::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern19::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern19::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern19::new(client.clone(), _m(&acc, "pct90")), + median: MetricPattern7::new(client.clone(), _m(&acc, "median")), + pct10: MetricPattern7::new(client.clone(), _m(&acc, "pct10")), + pct25: MetricPattern7::new(client.clone(), _m(&acc, "pct25")), + pct75: MetricPattern7::new(client.clone(), _m(&acc, "pct75")), + pct90: MetricPattern7::new(client.clone(), _m(&acc, "pct90")), } } } /// Pattern struct for repeated tree structure. -pub struct IntervalPattern { - pub average: MetricPattern2, - pub base: MetricPattern23, - pub max: MetricPattern2, - pub min: MetricPattern2, - pub percentiles: PercentilesPattern, +pub struct DateindexPattern2 { + pub close: MetricPattern7, + pub high: MetricPattern7, + pub low: MetricPattern7, + pub open: MetricPattern7, } -impl IntervalPattern { +impl DateindexPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: MetricPattern2::new(client.clone(), _m(&acc, "average")), - base: MetricPattern23::new(client.clone(), acc.clone()), - max: MetricPattern2::new(client.clone(), _m(&acc, "max")), - min: MetricPattern2::new(client.clone(), _m(&acc, "min")), - percentiles: PercentilesPattern::new(client.clone(), acc.clone()), + close: MetricPattern7::new(client.clone(), _m(&acc, "close_cents")), + high: MetricPattern7::new(client.clone(), _m(&acc, "high_cents")), + low: MetricPattern7::new(client.clone(), _m(&acc, "low_cents")), + open: MetricPattern7::new(client.clone(), _m(&acc, "open_cents")), } } } /// Pattern struct for repeated tree structure. -pub struct SupplyInLossPattern { - pub base: MetricPattern7, - pub bitcoin: MetricPattern4, - pub dollars: MetricPattern4, - pub sats: MetricPattern5, +pub struct SplitPattern2 { + pub close: MetricPattern1, + pub high: HighPattern, + pub low: HighPattern, + pub open: MetricPattern1, } -impl SupplyInLossPattern { +impl SplitPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - base: MetricPattern7::new(client.clone(), acc.clone()), - bitcoin: MetricPattern4::new(client.clone(), _m(&acc, "btc")), - dollars: MetricPattern4::new(client.clone(), _m(&acc, "usd")), - sats: MetricPattern5::new(client.clone(), acc.clone()), + close: MetricPattern1::new(client.clone(), _m(&acc, "close")), + high: HighPattern::new(client.clone(), _m(&acc, "high")), + low: HighPattern::new(client.clone(), _m(&acc, "low")), + open: MetricPattern1::new(client.clone(), _m(&acc, "open")), } } } /// Pattern struct for repeated tree structure. -pub struct PriceHighSatsPattern { - pub dateindex: MetricPattern19, - pub difficultyepoch: MetricPattern21, - pub height: MetricPattern23, +pub struct HighPattern { + pub dateindex: MetricPattern7, + pub difficultyepoch: MetricPattern9, + pub height: MetricPattern12, pub rest: MetricPattern5, } -impl PriceHighSatsPattern { +impl HighPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - dateindex: MetricPattern19::new(client.clone(), acc.clone()), - difficultyepoch: MetricPattern21::new(client.clone(), _m(&acc, "max")), - height: MetricPattern23::new(client.clone(), acc.clone()), + dateindex: MetricPattern7::new(client.clone(), acc.clone()), + difficultyepoch: MetricPattern9::new(client.clone(), _m(&acc, "max")), + height: MetricPattern12::new(client.clone(), acc.clone()), rest: MetricPattern5::new(client.clone(), _m(&acc, "max")), } } } /// Pattern struct for repeated tree structure. -pub struct TxVsizePattern { - pub average: MetricPattern1, - pub max: MetricPattern1, - pub min: MetricPattern1, - pub percentiles: PercentilesPattern, +pub struct _24hCoinbaseSumPattern { + pub bitcoin: MetricPattern12, + pub dollars: MetricPattern12, + pub sats: MetricPattern12, } -impl TxVsizePattern { +impl _24hCoinbaseSumPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: MetricPattern1::new(client.clone(), _m(&acc, "average")), - max: MetricPattern1::new(client.clone(), _m(&acc, "max")), - min: MetricPattern1::new(client.clone(), _m(&acc, "min")), - percentiles: PercentilesPattern::new(client.clone(), acc.clone()), + bitcoin: MetricPattern12::new(client.clone(), _m(&acc, "btc")), + dollars: MetricPattern12::new(client.clone(), _m(&acc, "usd")), + sats: MetricPattern12::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. -pub struct UnclaimedRewardsPattern { - pub bitcoin: BlockCountPattern, - pub dollars: BlockCountPattern, - pub sats: BlockCountPattern, +pub struct SegwitAdoptionPattern { + pub cumulative: MetricPattern2, + pub height: MetricPattern12, + pub sum: MetricPattern2, } -impl UnclaimedRewardsPattern { +impl SegwitAdoptionPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - bitcoin: BlockCountPattern::new(client.clone(), _m(&acc, "btc")), - dollars: BlockCountPattern::new(client.clone(), _m(&acc, "usd")), - sats: BlockCountPattern::new(client.clone(), acc.clone()), + cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), + height: MetricPattern12::new(client.clone(), acc.clone()), + sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), } } } @@ -3989,37 +3620,19 @@ impl CostBasisPattern2 { } /// Pattern struct for repeated tree structure. -pub struct ActiveSupplyPattern { - pub bitcoin: MetricPattern1, - pub dollars: MetricPattern1, - pub sats: MetricPattern1, -} - -impl ActiveSupplyPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - bitcoin: MetricPattern1::new(client.clone(), _m(&acc, "btc")), - dollars: MetricPattern1::new(client.clone(), _m(&acc, "usd")), - sats: MetricPattern1::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct SentPattern { +pub struct UnclaimedRewardsPattern { pub bitcoin: BlockCountPattern, pub dollars: BlockCountPattern, - pub sats: SatsPattern, + pub sats: BlockCountPattern, } -impl SentPattern { +impl UnclaimedRewardsPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { bitcoin: BlockCountPattern::new(client.clone(), _m(&acc, "btc")), dollars: BlockCountPattern::new(client.clone(), _m(&acc, "usd")), - sats: SatsPattern::new(client.clone(), acc.clone()), + sats: BlockCountPattern::new(client.clone(), acc.clone()), } } } @@ -4043,69 +3656,17 @@ impl CoinbasePattern { } /// Pattern struct for repeated tree structure. -pub struct SupplyPattern2 { - pub supply: ActiveSupplyPattern, - pub supply_half: ActiveSupplyPattern, - pub utxo_count: MetricPattern1, +pub struct RelativePattern4 { + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, } -impl SupplyPattern2 { +impl RelativePattern4 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - supply: ActiveSupplyPattern::new(client.clone(), _m(&acc, "supply")), - supply_half: ActiveSupplyPattern::new(client.clone(), _m(&acc, "supply_half")), - utxo_count: MetricPattern1::new(client.clone(), _m(&acc, "utxo_count")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct SatsPattern { - pub base: MetricPattern23, - pub cumulative: MetricPattern2, - pub sum: MetricPattern2, -} - -impl SatsPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - base: MetricPattern23::new(client.clone(), acc.clone()), - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CostBasisPattern { - pub max: MetricPattern1, - pub min: MetricPattern1, -} - -impl CostBasisPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")), - min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct SupplyInLossValuePattern { - pub bitcoin: MetricPattern23, - pub dollars: MetricPattern23, -} - -impl SupplyInLossValuePattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - bitcoin: MetricPattern23::new(client.clone(), _m(&acc, "btc")), - dollars: MetricPattern23::new(client.clone(), _m(&acc, "usd")), + supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "loss_rel_to_own_supply")), + supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "profit_rel_to_own_supply")), } } } @@ -4127,17 +3688,49 @@ impl _1dReturns1mSdPattern { } /// Pattern struct for repeated tree structure. -pub struct RelativePattern4 { - pub supply_in_loss_rel_to_own_supply: MetricPattern3, - pub supply_in_profit_rel_to_own_supply: MetricPattern3, +pub struct CostBasisPattern { + pub max: MetricPattern1, + pub min: MetricPattern1, } -impl RelativePattern4 { +impl CostBasisPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - supply_in_loss_rel_to_own_supply: MetricPattern3::new(client.clone(), _m(&acc, "loss_rel_to_own_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern3::new(client.clone(), _m(&acc, "profit_rel_to_own_supply")), + max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")), + min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct SupplyPattern2 { + pub halved: _24hCoinbaseSumPattern, + pub total: _24hCoinbaseSumPattern, +} + +impl SupplyPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + halved: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "half")), + total: _24hCoinbaseSumPattern::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct SatsPattern { + pub ohlc: OhlcPattern, + pub split: SplitPattern2, +} + +impl SatsPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + ohlc: OhlcPattern::new(client.clone(), _m(&acc, "ohlc_sats")), + split: SplitPattern2::new(client.clone(), _m(&acc, "sats")), } } } @@ -4172,6 +3765,34 @@ impl RealizedPriceExtraPattern { } } +/// Pattern struct for repeated tree structure. +pub struct OutputsPattern { + pub utxo_count: MetricPattern1, +} + +impl OutputsPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + utxo_count: MetricPattern1::new(client.clone(), _m(&acc, "utxo_count")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct EmptyPattern { + pub identity: MetricPattern18, +} + +impl EmptyPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + identity: MetricPattern18::new(client.clone(), acc.clone()), + } + } +} + // Catalog tree /// Catalog tree node. @@ -4217,77 +3838,77 @@ impl CatalogTree { /// Catalog tree node. pub struct CatalogTree_Addresses { - pub first_p2aaddressindex: MetricPattern23, - pub first_p2pk33addressindex: MetricPattern23, - pub first_p2pk65addressindex: MetricPattern23, - pub first_p2pkhaddressindex: MetricPattern23, - pub first_p2shaddressindex: MetricPattern23, - pub first_p2traddressindex: MetricPattern23, - pub first_p2wpkhaddressindex: MetricPattern23, - pub first_p2wshaddressindex: MetricPattern23, - pub p2abytes: MetricPattern27, - pub p2pk33bytes: MetricPattern29, - pub p2pk65bytes: MetricPattern30, - pub p2pkhbytes: MetricPattern31, - pub p2shbytes: MetricPattern32, - pub p2trbytes: MetricPattern33, - pub p2wpkhbytes: MetricPattern34, - pub p2wshbytes: MetricPattern35, + pub first_p2aaddressindex: MetricPattern12, + pub first_p2pk33addressindex: MetricPattern12, + pub first_p2pk65addressindex: MetricPattern12, + pub first_p2pkhaddressindex: MetricPattern12, + pub first_p2shaddressindex: MetricPattern12, + pub first_p2traddressindex: MetricPattern12, + pub first_p2wpkhaddressindex: MetricPattern12, + pub first_p2wshaddressindex: MetricPattern12, + pub p2abytes: MetricPattern17, + pub p2pk33bytes: MetricPattern19, + pub p2pk65bytes: MetricPattern20, + pub p2pkhbytes: MetricPattern21, + pub p2shbytes: MetricPattern22, + pub p2trbytes: MetricPattern23, + pub p2wpkhbytes: MetricPattern24, + pub p2wshbytes: MetricPattern25, } impl CatalogTree_Addresses { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_p2aaddressindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2aaddressindex")), - first_p2pk33addressindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2pk33addressindex")), - first_p2pk65addressindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2pk65addressindex")), - first_p2pkhaddressindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2pkhaddressindex")), - first_p2shaddressindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2shaddressindex")), - first_p2traddressindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2traddressindex")), - first_p2wpkhaddressindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2wpkhaddressindex")), - first_p2wshaddressindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2wshaddressindex")), - p2abytes: MetricPattern27::new(client.clone(), format!("{base_path}_p2abytes")), - p2pk33bytes: MetricPattern29::new(client.clone(), format!("{base_path}_p2pk33bytes")), - p2pk65bytes: MetricPattern30::new(client.clone(), format!("{base_path}_p2pk65bytes")), - p2pkhbytes: MetricPattern31::new(client.clone(), format!("{base_path}_p2pkhbytes")), - p2shbytes: MetricPattern32::new(client.clone(), format!("{base_path}_p2shbytes")), - p2trbytes: MetricPattern33::new(client.clone(), format!("{base_path}_p2trbytes")), - p2wpkhbytes: MetricPattern34::new(client.clone(), format!("{base_path}_p2wpkhbytes")), - p2wshbytes: MetricPattern35::new(client.clone(), format!("{base_path}_p2wshbytes")), + first_p2aaddressindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2aaddressindex")), + first_p2pk33addressindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2pk33addressindex")), + first_p2pk65addressindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2pk65addressindex")), + first_p2pkhaddressindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2pkhaddressindex")), + first_p2shaddressindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2shaddressindex")), + first_p2traddressindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2traddressindex")), + first_p2wpkhaddressindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2wpkhaddressindex")), + first_p2wshaddressindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2wshaddressindex")), + p2abytes: MetricPattern17::new(client.clone(), format!("{base_path}_p2abytes")), + p2pk33bytes: MetricPattern19::new(client.clone(), format!("{base_path}_p2pk33bytes")), + p2pk65bytes: MetricPattern20::new(client.clone(), format!("{base_path}_p2pk65bytes")), + p2pkhbytes: MetricPattern21::new(client.clone(), format!("{base_path}_p2pkhbytes")), + p2shbytes: MetricPattern22::new(client.clone(), format!("{base_path}_p2shbytes")), + p2trbytes: MetricPattern23::new(client.clone(), format!("{base_path}_p2trbytes")), + p2wpkhbytes: MetricPattern24::new(client.clone(), format!("{base_path}_p2wpkhbytes")), + p2wshbytes: MetricPattern25::new(client.clone(), format!("{base_path}_p2wshbytes")), } } } /// Catalog tree node. pub struct CatalogTree_Blocks { - pub blockhash: MetricPattern23, + pub blockhash: MetricPattern12, pub count: CatalogTree_Blocks_Count, pub difficulty: CatalogTree_Blocks_Difficulty, pub halving: CatalogTree_Blocks_Halving, - pub interval: IntervalPattern, + pub interval: CatalogTree_Blocks_Interval, pub mining: CatalogTree_Blocks_Mining, pub rewards: CatalogTree_Blocks_Rewards, pub size: CatalogTree_Blocks_Size, pub time: CatalogTree_Blocks_Time, - pub timestamp: MetricPattern23, - pub total_size: MetricPattern23, + pub timestamp: MetricPattern12, + pub total_size: MetricPattern12, pub weight: CatalogTree_Blocks_Weight, } impl CatalogTree_Blocks { pub fn new(client: Arc, base_path: String) -> Self { Self { - blockhash: MetricPattern23::new(client.clone(), format!("{base_path}_blockhash")), + blockhash: MetricPattern12::new(client.clone(), format!("{base_path}_blockhash")), count: CatalogTree_Blocks_Count::new(client.clone(), format!("{base_path}_count")), difficulty: CatalogTree_Blocks_Difficulty::new(client.clone(), format!("{base_path}_difficulty")), halving: CatalogTree_Blocks_Halving::new(client.clone(), format!("{base_path}_halving")), - interval: IntervalPattern::new(client.clone(), "block_interval".to_string()), + interval: CatalogTree_Blocks_Interval::new(client.clone(), format!("{base_path}_interval")), mining: CatalogTree_Blocks_Mining::new(client.clone(), format!("{base_path}_mining")), rewards: CatalogTree_Blocks_Rewards::new(client.clone(), format!("{base_path}_rewards")), size: CatalogTree_Blocks_Size::new(client.clone(), format!("{base_path}_size")), time: CatalogTree_Blocks_Time::new(client.clone(), format!("{base_path}_time")), - timestamp: MetricPattern23::new(client.clone(), format!("{base_path}_timestamp")), - total_size: MetricPattern23::new(client.clone(), format!("{base_path}_total_size")), + timestamp: MetricPattern12::new(client.clone(), format!("{base_path}_timestamp")), + total_size: MetricPattern12::new(client.clone(), format!("{base_path}_total_size")), weight: CatalogTree_Blocks_Weight::new(client.clone(), format!("{base_path}_weight")), } } @@ -4296,13 +3917,13 @@ impl CatalogTree_Blocks { /// Catalog tree node. pub struct CatalogTree_Blocks_Count { pub _1m_block_count: MetricPattern1, - pub _1m_start: MetricPattern23, + pub _1m_start: MetricPattern12, pub _1w_block_count: MetricPattern1, - pub _1w_start: MetricPattern23, + pub _1w_start: MetricPattern12, pub _1y_block_count: MetricPattern1, - pub _1y_start: MetricPattern23, + pub _1y_start: MetricPattern12, pub _24h_block_count: MetricPattern1, - pub _24h_start: MetricPattern23, + pub _24h_start: MetricPattern12, pub block_count: BlockCountPattern, pub block_count_target: MetricPattern4, } @@ -4311,13 +3932,13 @@ impl CatalogTree_Blocks_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { _1m_block_count: MetricPattern1::new(client.clone(), format!("{base_path}_1m_block_count")), - _1m_start: MetricPattern23::new(client.clone(), format!("{base_path}_1m_start")), + _1m_start: MetricPattern12::new(client.clone(), format!("{base_path}_1m_start")), _1w_block_count: MetricPattern1::new(client.clone(), format!("{base_path}_1w_block_count")), - _1w_start: MetricPattern23::new(client.clone(), format!("{base_path}_1w_start")), + _1w_start: MetricPattern12::new(client.clone(), format!("{base_path}_1w_start")), _1y_block_count: MetricPattern1::new(client.clone(), format!("{base_path}_1y_block_count")), - _1y_start: MetricPattern23::new(client.clone(), format!("{base_path}_1y_start")), + _1y_start: MetricPattern12::new(client.clone(), format!("{base_path}_1y_start")), _24h_block_count: MetricPattern1::new(client.clone(), format!("{base_path}_24h_block_count")), - _24h_start: MetricPattern23::new(client.clone(), format!("{base_path}_24h_start")), + _24h_start: MetricPattern12::new(client.clone(), format!("{base_path}_24h_start")), block_count: BlockCountPattern::new(client.clone(), "block_count".to_string()), block_count_target: MetricPattern4::new(client.clone(), format!("{base_path}_block_count_target")), } @@ -4326,19 +3947,19 @@ impl CatalogTree_Blocks_Count { /// Catalog tree node. pub struct CatalogTree_Blocks_Difficulty { - pub base: MetricPattern23, + pub base: MetricPattern12, pub blocks_before_next_difficulty_adjustment: MetricPattern1, pub days_before_next_difficulty_adjustment: MetricPattern1, - pub difficultyepoch: MetricPattern4, + pub epoch: MetricPattern4, } impl CatalogTree_Blocks_Difficulty { pub fn new(client: Arc, base_path: String) -> Self { Self { - base: MetricPattern23::new(client.clone(), format!("{base_path}_base")), + base: MetricPattern12::new(client.clone(), format!("{base_path}_base")), blocks_before_next_difficulty_adjustment: MetricPattern1::new(client.clone(), format!("{base_path}_blocks_before_next_difficulty_adjustment")), days_before_next_difficulty_adjustment: MetricPattern1::new(client.clone(), format!("{base_path}_days_before_next_difficulty_adjustment")), - difficultyepoch: MetricPattern4::new(client.clone(), format!("{base_path}_difficultyepoch")), + epoch: MetricPattern4::new(client.clone(), format!("{base_path}_epoch")), } } } @@ -4347,7 +3968,7 @@ impl CatalogTree_Blocks_Difficulty { pub struct CatalogTree_Blocks_Halving { pub blocks_before_next_halving: MetricPattern1, pub days_before_next_halving: MetricPattern1, - pub halvingepoch: MetricPattern4, + pub epoch: MetricPattern4, } impl CatalogTree_Blocks_Halving { @@ -4355,7 +3976,36 @@ impl CatalogTree_Blocks_Halving { Self { blocks_before_next_halving: MetricPattern1::new(client.clone(), format!("{base_path}_blocks_before_next_halving")), days_before_next_halving: MetricPattern1::new(client.clone(), format!("{base_path}_days_before_next_halving")), - halvingepoch: MetricPattern4::new(client.clone(), format!("{base_path}_halvingepoch")), + epoch: MetricPattern4::new(client.clone(), format!("{base_path}_epoch")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Blocks_Interval { + pub average: MetricPattern2, + pub base: MetricPattern12, + pub max: MetricPattern2, + pub median: MetricPattern7, + pub min: MetricPattern2, + pub pct10: MetricPattern7, + pub pct25: MetricPattern7, + pub pct75: MetricPattern7, + pub pct90: MetricPattern7, +} + +impl CatalogTree_Blocks_Interval { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + average: MetricPattern2::new(client.clone(), format!("{base_path}_average")), + base: MetricPattern12::new(client.clone(), format!("{base_path}_base")), + max: MetricPattern2::new(client.clone(), format!("{base_path}_max")), + median: MetricPattern7::new(client.clone(), format!("{base_path}_median")), + min: MetricPattern2::new(client.clone(), format!("{base_path}_min")), + pct10: MetricPattern7::new(client.clone(), format!("{base_path}_pct10")), + pct25: MetricPattern7::new(client.clone(), format!("{base_path}_pct25")), + pct75: MetricPattern7::new(client.clone(), format!("{base_path}_pct75")), + pct90: MetricPattern7::new(client.clone(), format!("{base_path}_pct90")), } } } @@ -4409,12 +4059,11 @@ impl CatalogTree_Blocks_Mining { /// Catalog tree node. pub struct CatalogTree_Blocks_Rewards { - pub _24h_coinbase_sum: MetricPattern23, - pub _24h_coinbase_usd_sum: MetricPattern23, + pub _24h_coinbase_sum: _24hCoinbaseSumPattern, pub coinbase: CoinbasePattern, - pub fee_dominance: MetricPattern19, + pub fee_dominance: MetricPattern7, pub subsidy: CoinbasePattern, - pub subsidy_dominance: MetricPattern19, + pub subsidy_dominance: MetricPattern7, pub subsidy_usd_1y_sma: MetricPattern4, pub unclaimed_rewards: UnclaimedRewardsPattern, } @@ -4422,12 +4071,11 @@ pub struct CatalogTree_Blocks_Rewards { impl CatalogTree_Blocks_Rewards { pub fn new(client: Arc, base_path: String) -> Self { Self { - _24h_coinbase_sum: MetricPattern23::new(client.clone(), format!("{base_path}_24h_coinbase_sum")), - _24h_coinbase_usd_sum: MetricPattern23::new(client.clone(), format!("{base_path}_24h_coinbase_usd_sum")), + _24h_coinbase_sum: _24hCoinbaseSumPattern::new(client.clone(), "24h_coinbase_sum".to_string()), coinbase: CoinbasePattern::new(client.clone(), "coinbase".to_string()), - fee_dominance: MetricPattern19::new(client.clone(), format!("{base_path}_fee_dominance")), + fee_dominance: MetricPattern7::new(client.clone(), format!("{base_path}_fee_dominance")), subsidy: CoinbasePattern::new(client.clone(), "subsidy".to_string()), - subsidy_dominance: MetricPattern19::new(client.clone(), format!("{base_path}_subsidy_dominance")), + subsidy_dominance: MetricPattern7::new(client.clone(), format!("{base_path}_subsidy_dominance")), subsidy_usd_1y_sma: MetricPattern4::new(client.clone(), format!("{base_path}_subsidy_usd_1y_sma")), unclaimed_rewards: UnclaimedRewardsPattern::new(client.clone(), "unclaimed_rewards".to_string()), } @@ -4436,53 +4084,76 @@ impl CatalogTree_Blocks_Rewards { /// Catalog tree node. pub struct CatalogTree_Blocks_Size { - pub block_size: BlockSizePattern, - pub block_vbytes: BlockSizePattern, - pub vbytes: MetricPattern23, + pub size: SizePattern, + pub vbytes: CatalogTree_Blocks_Size_Vbytes, } impl CatalogTree_Blocks_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { - block_size: BlockSizePattern::new(client.clone(), "block_size".to_string()), - block_vbytes: BlockSizePattern::new(client.clone(), "block_vbytes".to_string()), - vbytes: MetricPattern23::new(client.clone(), format!("{base_path}_vbytes")), + size: SizePattern::new(client.clone(), "block_size".to_string()), + vbytes: CatalogTree_Blocks_Size_Vbytes::new(client.clone(), format!("{base_path}_vbytes")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Blocks_Size_Vbytes { + pub average: MetricPattern2, + pub base: MetricPattern12, + pub cumulative: MetricPattern1, + pub max: MetricPattern2, + pub min: MetricPattern2, + pub percentiles: PercentilesPattern, + pub sum: MetricPattern2, +} + +impl CatalogTree_Blocks_Size_Vbytes { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + average: MetricPattern2::new(client.clone(), format!("{base_path}_average")), + base: MetricPattern12::new(client.clone(), format!("{base_path}_base")), + cumulative: MetricPattern1::new(client.clone(), format!("{base_path}_cumulative")), + max: MetricPattern2::new(client.clone(), format!("{base_path}_max")), + min: MetricPattern2::new(client.clone(), format!("{base_path}_min")), + percentiles: PercentilesPattern::new(client.clone(), "block_vbytes".to_string()), + sum: MetricPattern2::new(client.clone(), format!("{base_path}_sum")), } } } /// Catalog tree node. pub struct CatalogTree_Blocks_Time { - pub date: MetricPattern23, - pub date_fixed: MetricPattern23, + pub date: MetricPattern12, + pub date_fixed: MetricPattern12, pub timestamp: MetricPattern2, - pub timestamp_fixed: MetricPattern23, + pub timestamp_fixed: MetricPattern12, } impl CatalogTree_Blocks_Time { pub fn new(client: Arc, base_path: String) -> Self { Self { - date: MetricPattern23::new(client.clone(), format!("{base_path}_date")), - date_fixed: MetricPattern23::new(client.clone(), format!("{base_path}_date_fixed")), + date: MetricPattern12::new(client.clone(), format!("{base_path}_date")), + date_fixed: MetricPattern12::new(client.clone(), format!("{base_path}_date_fixed")), timestamp: MetricPattern2::new(client.clone(), format!("{base_path}_timestamp")), - timestamp_fixed: MetricPattern23::new(client.clone(), format!("{base_path}_timestamp_fixed")), + timestamp_fixed: MetricPattern12::new(client.clone(), format!("{base_path}_timestamp_fixed")), } } } /// Catalog tree node. pub struct CatalogTree_Blocks_Weight { - pub base: MetricPattern23, - pub block_fullness: BitcoinPattern, - pub block_weight: BlockSizePattern, + pub base: MetricPattern12, + pub fullness: BitcoinPattern, + pub weight: SizePattern, } impl CatalogTree_Blocks_Weight { pub fn new(client: Arc, base_path: String) -> Self { Self { - base: MetricPattern23::new(client.clone(), format!("{base_path}_base")), - block_fullness: BitcoinPattern::new(client.clone(), "block_fullness".to_string()), - block_weight: BlockSizePattern::new(client.clone(), "block_weight".to_string()), + base: MetricPattern12::new(client.clone(), format!("{base_path}_base")), + fullness: BitcoinPattern::new(client.clone(), "block_fullness".to_string()), + weight: SizePattern::new(client.clone(), "block_weight".to_string()), } } } @@ -4598,15 +4269,15 @@ impl CatalogTree_Cointime_Pricing { /// Catalog tree node. pub struct CatalogTree_Cointime_Supply { - pub active_supply: ActiveSupplyPattern, - pub vaulted_supply: ActiveSupplyPattern, + pub active_supply: _24hCoinbaseSumPattern, + pub vaulted_supply: _24hCoinbaseSumPattern, } impl CatalogTree_Cointime_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { - active_supply: ActiveSupplyPattern::new(client.clone(), "active_supply".to_string()), - vaulted_supply: ActiveSupplyPattern::new(client.clone(), "vaulted_supply".to_string()), + active_supply: _24hCoinbaseSumPattern::new(client.clone(), "active_supply".to_string()), + vaulted_supply: _24hCoinbaseSumPattern::new(client.clone(), "vaulted_supply".to_string()), } } } @@ -4681,10 +4352,10 @@ pub struct CatalogTree_Distribution { pub address_cohorts: CatalogTree_Distribution_AddressCohorts, pub addresses_data: CatalogTree_Distribution_AddressesData, pub any_address_indexes: CatalogTree_Distribution_AnyAddressIndexes, - pub chain_state: MetricPattern23, + pub chain_state: MetricPattern12, pub empty_addr_count: AddrCountPattern, - pub emptyaddressindex: MetricPattern39, - pub loadedaddressindex: MetricPattern38, + pub emptyaddressindex: MetricPattern33, + pub loadedaddressindex: MetricPattern32, pub utxo_cohorts: CatalogTree_Distribution_UtxoCohorts, } @@ -4695,10 +4366,10 @@ impl CatalogTree_Distribution { address_cohorts: CatalogTree_Distribution_AddressCohorts::new(client.clone(), format!("{base_path}_address_cohorts")), addresses_data: CatalogTree_Distribution_AddressesData::new(client.clone(), format!("{base_path}_addresses_data")), any_address_indexes: CatalogTree_Distribution_AnyAddressIndexes::new(client.clone(), format!("{base_path}_any_address_indexes")), - chain_state: MetricPattern23::new(client.clone(), format!("{base_path}_chain_state")), + chain_state: MetricPattern12::new(client.clone(), format!("{base_path}_chain_state")), empty_addr_count: AddrCountPattern::new(client.clone(), "empty_addr_count".to_string()), - emptyaddressindex: MetricPattern39::new(client.clone(), format!("{base_path}_emptyaddressindex")), - loadedaddressindex: MetricPattern38::new(client.clone(), format!("{base_path}_loadedaddressindex")), + emptyaddressindex: MetricPattern33::new(client.clone(), format!("{base_path}_emptyaddressindex")), + loadedaddressindex: MetricPattern32::new(client.clone(), format!("{base_path}_loadedaddressindex")), utxo_cohorts: CatalogTree_Distribution_UtxoCohorts::new(client.clone(), format!("{base_path}_utxo_cohorts")), } } @@ -4838,42 +4509,42 @@ impl CatalogTree_Distribution_AddressCohorts_LtAmount { /// Catalog tree node. pub struct CatalogTree_Distribution_AddressesData { - pub empty: MetricPattern39, - pub loaded: MetricPattern38, + pub empty: MetricPattern33, + pub loaded: MetricPattern32, } impl CatalogTree_Distribution_AddressesData { pub fn new(client: Arc, base_path: String) -> Self { Self { - empty: MetricPattern39::new(client.clone(), format!("{base_path}_empty")), - loaded: MetricPattern38::new(client.clone(), format!("{base_path}_loaded")), + empty: MetricPattern33::new(client.clone(), format!("{base_path}_empty")), + loaded: MetricPattern32::new(client.clone(), format!("{base_path}_loaded")), } } } /// Catalog tree node. pub struct CatalogTree_Distribution_AnyAddressIndexes { - pub p2a: MetricPattern27, - pub p2pk33: MetricPattern29, - pub p2pk65: MetricPattern30, - pub p2pkh: MetricPattern31, - pub p2sh: MetricPattern32, - pub p2tr: MetricPattern33, - pub p2wpkh: MetricPattern34, - pub p2wsh: MetricPattern35, + pub p2a: MetricPattern17, + pub p2pk33: MetricPattern19, + pub p2pk65: MetricPattern20, + pub p2pkh: MetricPattern21, + pub p2sh: MetricPattern22, + pub p2tr: MetricPattern23, + pub p2wpkh: MetricPattern24, + pub p2wsh: MetricPattern25, } impl CatalogTree_Distribution_AnyAddressIndexes { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2a: MetricPattern27::new(client.clone(), format!("{base_path}_p2a")), - p2pk33: MetricPattern29::new(client.clone(), format!("{base_path}_p2pk33")), - p2pk65: MetricPattern30::new(client.clone(), format!("{base_path}_p2pk65")), - p2pkh: MetricPattern31::new(client.clone(), format!("{base_path}_p2pkh")), - p2sh: MetricPattern32::new(client.clone(), format!("{base_path}_p2sh")), - p2tr: MetricPattern33::new(client.clone(), format!("{base_path}_p2tr")), - p2wpkh: MetricPattern34::new(client.clone(), format!("{base_path}_p2wpkh")), - p2wsh: MetricPattern35::new(client.clone(), format!("{base_path}_p2wsh")), + p2a: MetricPattern17::new(client.clone(), format!("{base_path}_p2a")), + p2pk33: MetricPattern19::new(client.clone(), format!("{base_path}_p2pk33")), + p2pk65: MetricPattern20::new(client.clone(), format!("{base_path}_p2pk65")), + p2pkh: MetricPattern21::new(client.clone(), format!("{base_path}_p2pkh")), + p2sh: MetricPattern22::new(client.clone(), format!("{base_path}_p2sh")), + p2tr: MetricPattern23::new(client.clone(), format!("{base_path}_p2tr")), + p2wpkh: MetricPattern24::new(client.clone(), format!("{base_path}_p2wpkh")), + p2wsh: MetricPattern25::new(client.clone(), format!("{base_path}_p2wsh")), } } } @@ -4968,6 +4639,7 @@ impl CatalogTree_Distribution_UtxoCohorts_AgeRange { pub struct CatalogTree_Distribution_UtxoCohorts_All { pub activity: ActivityPattern2, pub cost_basis: CostBasisPattern2, + pub outputs: OutputsPattern, pub realized: RealizedPattern3, pub relative: CatalogTree_Distribution_UtxoCohorts_All_Relative, pub supply: SupplyPattern2, @@ -4979,9 +4651,10 @@ impl CatalogTree_Distribution_UtxoCohorts_All { Self { activity: ActivityPattern2::new(client.clone(), "".to_string()), cost_basis: CostBasisPattern2::new(client.clone(), "".to_string()), + outputs: OutputsPattern::new(client.clone(), "utxo_count".to_string()), realized: RealizedPattern3::new(client.clone(), "".to_string()), relative: CatalogTree_Distribution_UtxoCohorts_All_Relative::new(client.clone(), format!("{base_path}_relative")), - supply: SupplyPattern2::new(client.clone(), "".to_string()), + supply: SupplyPattern2::new(client.clone(), "supply".to_string()), unrealized: UnrealizedPattern::new(client.clone(), "".to_string()), } } @@ -4989,23 +4662,23 @@ impl CatalogTree_Distribution_UtxoCohorts_All { /// Catalog tree node. pub struct CatalogTree_Distribution_UtxoCohorts_All_Relative { - pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub supply_in_loss_rel_to_own_supply: MetricPattern3, - pub supply_in_profit_rel_to_own_supply: MetricPattern3, - pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3, - pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3, + pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, + pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, } impl CatalogTree_Distribution_UtxoCohorts_All_Relative { pub fn new(client: Arc, base_path: String) -> Self { Self { - neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), format!("{base_path}_neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), - net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), format!("{base_path}_net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), - supply_in_loss_rel_to_own_supply: MetricPattern3::new(client.clone(), format!("{base_path}_supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern3::new(client.clone(), format!("{base_path}_supply_in_profit_rel_to_own_supply")), - unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), format!("{base_path}_unrealized_loss_rel_to_own_total_unrealized_pnl")), - unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3::new(client.clone(), format!("{base_path}_unrealized_profit_rel_to_own_total_unrealized_pnl")), + neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), format!("{base_path}_neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), + net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), format!("{base_path}_net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), + supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), format!("{base_path}_supply_in_loss_rel_to_own_supply")), + supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), format!("{base_path}_supply_in_profit_rel_to_own_supply")), + unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), format!("{base_path}_unrealized_loss_rel_to_own_total_unrealized_pnl")), + unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), format!("{base_path}_unrealized_profit_rel_to_own_total_unrealized_pnl")), } } } @@ -5259,6 +4932,7 @@ impl CatalogTree_Distribution_UtxoCohorts_Term { pub struct CatalogTree_Distribution_UtxoCohorts_Term_Long { pub activity: ActivityPattern2, pub cost_basis: CostBasisPattern2, + pub outputs: OutputsPattern, pub realized: RealizedPattern2, pub relative: RelativePattern5, pub supply: SupplyPattern2, @@ -5270,9 +4944,10 @@ impl CatalogTree_Distribution_UtxoCohorts_Term_Long { Self { activity: ActivityPattern2::new(client.clone(), "lth".to_string()), cost_basis: CostBasisPattern2::new(client.clone(), "lth".to_string()), + outputs: OutputsPattern::new(client.clone(), "lth_utxo_count".to_string()), realized: RealizedPattern2::new(client.clone(), "lth".to_string()), relative: RelativePattern5::new(client.clone(), "lth".to_string()), - supply: SupplyPattern2::new(client.clone(), "lth".to_string()), + supply: SupplyPattern2::new(client.clone(), "lth_supply".to_string()), unrealized: UnrealizedPattern::new(client.clone(), "lth".to_string()), } } @@ -5282,6 +4957,7 @@ impl CatalogTree_Distribution_UtxoCohorts_Term_Long { pub struct CatalogTree_Distribution_UtxoCohorts_Term_Short { pub activity: ActivityPattern2, pub cost_basis: CostBasisPattern2, + pub outputs: OutputsPattern, pub realized: RealizedPattern3, pub relative: RelativePattern5, pub supply: SupplyPattern2, @@ -5293,9 +4969,10 @@ impl CatalogTree_Distribution_UtxoCohorts_Term_Short { Self { activity: ActivityPattern2::new(client.clone(), "sth".to_string()), cost_basis: CostBasisPattern2::new(client.clone(), "sth".to_string()), + outputs: OutputsPattern::new(client.clone(), "sth_utxo_count".to_string()), realized: RealizedPattern3::new(client.clone(), "sth".to_string()), relative: RelativePattern5::new(client.clone(), "sth".to_string()), - supply: SupplyPattern2::new(client.clone(), "sth".to_string()), + supply: SupplyPattern2::new(client.clone(), "sth_supply".to_string()), unrealized: UnrealizedPattern::new(client.clone(), "sth".to_string()), } } @@ -5384,195 +5061,318 @@ impl CatalogTree_Distribution_UtxoCohorts_Year { /// Catalog tree node. pub struct CatalogTree_Indexes { pub address: CatalogTree_Indexes_Address, - pub block: CatalogTree_Indexes_Block, - pub time: CatalogTree_Indexes_Time, - pub transaction: CatalogTree_Indexes_Transaction, + pub dateindex: CatalogTree_Indexes_Dateindex, + pub decadeindex: CatalogTree_Indexes_Decadeindex, + pub difficultyepoch: CatalogTree_Indexes_Difficultyepoch, + pub halvingepoch: CatalogTree_Indexes_Halvingepoch, + pub height: CatalogTree_Indexes_Height, + pub monthindex: CatalogTree_Indexes_Monthindex, + pub quarterindex: CatalogTree_Indexes_Quarterindex, + pub semesterindex: CatalogTree_Indexes_Semesterindex, + pub txindex: CatalogTree_Indexes_Txindex, + pub txinindex: EmptyPattern, + pub txoutindex: EmptyPattern, + pub weekindex: CatalogTree_Indexes_Weekindex, + pub yearindex: CatalogTree_Indexes_Yearindex, } impl CatalogTree_Indexes { pub fn new(client: Arc, base_path: String) -> Self { Self { address: CatalogTree_Indexes_Address::new(client.clone(), format!("{base_path}_address")), - block: CatalogTree_Indexes_Block::new(client.clone(), format!("{base_path}_block")), - time: CatalogTree_Indexes_Time::new(client.clone(), format!("{base_path}_time")), - transaction: CatalogTree_Indexes_Transaction::new(client.clone(), format!("{base_path}_transaction")), + dateindex: CatalogTree_Indexes_Dateindex::new(client.clone(), format!("{base_path}_dateindex")), + decadeindex: CatalogTree_Indexes_Decadeindex::new(client.clone(), format!("{base_path}_decadeindex")), + difficultyepoch: CatalogTree_Indexes_Difficultyepoch::new(client.clone(), format!("{base_path}_difficultyepoch")), + halvingepoch: CatalogTree_Indexes_Halvingepoch::new(client.clone(), format!("{base_path}_halvingepoch")), + height: CatalogTree_Indexes_Height::new(client.clone(), format!("{base_path}_height")), + monthindex: CatalogTree_Indexes_Monthindex::new(client.clone(), format!("{base_path}_monthindex")), + quarterindex: CatalogTree_Indexes_Quarterindex::new(client.clone(), format!("{base_path}_quarterindex")), + semesterindex: CatalogTree_Indexes_Semesterindex::new(client.clone(), format!("{base_path}_semesterindex")), + txindex: CatalogTree_Indexes_Txindex::new(client.clone(), format!("{base_path}_txindex")), + txinindex: EmptyPattern::new(client.clone(), "txinindex".to_string()), + txoutindex: EmptyPattern::new(client.clone(), "txoutindex".to_string()), + weekindex: CatalogTree_Indexes_Weekindex::new(client.clone(), format!("{base_path}_weekindex")), + yearindex: CatalogTree_Indexes_Yearindex::new(client.clone(), format!("{base_path}_yearindex")), } } } /// Catalog tree node. pub struct CatalogTree_Indexes_Address { - pub emptyoutputindex: MetricPattern22, - pub opreturnindex: MetricPattern25, - pub p2aaddressindex: MetricPattern27, - pub p2msoutputindex: MetricPattern28, - pub p2pk33addressindex: MetricPattern29, - pub p2pk65addressindex: MetricPattern30, - pub p2pkhaddressindex: MetricPattern31, - pub p2shaddressindex: MetricPattern32, - pub p2traddressindex: MetricPattern33, - pub p2wpkhaddressindex: MetricPattern34, - pub p2wshaddressindex: MetricPattern35, - pub unknownoutputindex: MetricPattern37, + pub empty: EmptyPattern, + pub opreturn: EmptyPattern, + pub p2a: EmptyPattern, + pub p2ms: EmptyPattern, + pub p2pk33: EmptyPattern, + pub p2pk65: EmptyPattern, + pub p2pkh: EmptyPattern, + pub p2sh: EmptyPattern, + pub p2tr: EmptyPattern, + pub p2wpkh: EmptyPattern, + pub p2wsh: EmptyPattern, + pub unknown: EmptyPattern, } impl CatalogTree_Indexes_Address { pub fn new(client: Arc, base_path: String) -> Self { Self { - emptyoutputindex: MetricPattern22::new(client.clone(), format!("{base_path}_emptyoutputindex")), - opreturnindex: MetricPattern25::new(client.clone(), format!("{base_path}_opreturnindex")), - p2aaddressindex: MetricPattern27::new(client.clone(), format!("{base_path}_p2aaddressindex")), - p2msoutputindex: MetricPattern28::new(client.clone(), format!("{base_path}_p2msoutputindex")), - p2pk33addressindex: MetricPattern29::new(client.clone(), format!("{base_path}_p2pk33addressindex")), - p2pk65addressindex: MetricPattern30::new(client.clone(), format!("{base_path}_p2pk65addressindex")), - p2pkhaddressindex: MetricPattern31::new(client.clone(), format!("{base_path}_p2pkhaddressindex")), - p2shaddressindex: MetricPattern32::new(client.clone(), format!("{base_path}_p2shaddressindex")), - p2traddressindex: MetricPattern33::new(client.clone(), format!("{base_path}_p2traddressindex")), - p2wpkhaddressindex: MetricPattern34::new(client.clone(), format!("{base_path}_p2wpkhaddressindex")), - p2wshaddressindex: MetricPattern35::new(client.clone(), format!("{base_path}_p2wshaddressindex")), - unknownoutputindex: MetricPattern37::new(client.clone(), format!("{base_path}_unknownoutputindex")), + empty: EmptyPattern::new(client.clone(), "emptyoutputindex".to_string()), + opreturn: EmptyPattern::new(client.clone(), "opreturnindex".to_string()), + p2a: EmptyPattern::new(client.clone(), "p2aaddressindex".to_string()), + p2ms: EmptyPattern::new(client.clone(), "p2msoutputindex".to_string()), + p2pk33: EmptyPattern::new(client.clone(), "p2pk33addressindex".to_string()), + p2pk65: EmptyPattern::new(client.clone(), "p2pk65addressindex".to_string()), + p2pkh: EmptyPattern::new(client.clone(), "p2pkhaddressindex".to_string()), + p2sh: EmptyPattern::new(client.clone(), "p2shaddressindex".to_string()), + p2tr: EmptyPattern::new(client.clone(), "p2traddressindex".to_string()), + p2wpkh: EmptyPattern::new(client.clone(), "p2wpkhaddressindex".to_string()), + p2wsh: EmptyPattern::new(client.clone(), "p2wshaddressindex".to_string()), + unknown: EmptyPattern::new(client.clone(), "unknownoutputindex".to_string()), } } } /// Catalog tree node. -pub struct CatalogTree_Indexes_Block { - pub dateindex: MetricPattern23, - pub difficultyepoch: MetricPattern12, +pub struct CatalogTree_Indexes_Dateindex { + pub date: MetricPattern7, + pub first_height: MetricPattern7, + pub height_count: MetricPattern7, + pub identity: MetricPattern7, + pub monthindex: MetricPattern7, + pub weekindex: MetricPattern7, +} + +impl CatalogTree_Indexes_Dateindex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + date: MetricPattern7::new(client.clone(), format!("{base_path}_date")), + first_height: MetricPattern7::new(client.clone(), format!("{base_path}_first_height")), + height_count: MetricPattern7::new(client.clone(), format!("{base_path}_height_count")), + identity: MetricPattern7::new(client.clone(), format!("{base_path}_identity")), + monthindex: MetricPattern7::new(client.clone(), format!("{base_path}_monthindex")), + weekindex: MetricPattern7::new(client.clone(), format!("{base_path}_weekindex")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Indexes_Decadeindex { + pub first_yearindex: MetricPattern8, + pub identity: MetricPattern8, + pub yearindex_count: MetricPattern8, +} + +impl CatalogTree_Indexes_Decadeindex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + first_yearindex: MetricPattern8::new(client.clone(), format!("{base_path}_first_yearindex")), + identity: MetricPattern8::new(client.clone(), format!("{base_path}_identity")), + yearindex_count: MetricPattern8::new(client.clone(), format!("{base_path}_yearindex_count")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Indexes_Difficultyepoch { + pub first_height: MetricPattern9, + pub height_count: MetricPattern9, + pub identity: MetricPattern9, +} + +impl CatalogTree_Indexes_Difficultyepoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + first_height: MetricPattern9::new(client.clone(), format!("{base_path}_first_height")), + height_count: MetricPattern9::new(client.clone(), format!("{base_path}_height_count")), + identity: MetricPattern9::new(client.clone(), format!("{base_path}_identity")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Indexes_Halvingepoch { pub first_height: MetricPattern11, - pub halvingepoch: MetricPattern13, - pub height: MetricPattern23, - pub height_count: MetricPattern21, - pub txindex_count: MetricPattern23, + pub identity: MetricPattern11, } -impl CatalogTree_Indexes_Block { +impl CatalogTree_Indexes_Halvingepoch { pub fn new(client: Arc, base_path: String) -> Self { Self { - dateindex: MetricPattern23::new(client.clone(), format!("{base_path}_dateindex")), - difficultyepoch: MetricPattern12::new(client.clone(), format!("{base_path}_difficultyepoch")), first_height: MetricPattern11::new(client.clone(), format!("{base_path}_first_height")), - halvingepoch: MetricPattern13::new(client.clone(), format!("{base_path}_halvingepoch")), - height: MetricPattern23::new(client.clone(), format!("{base_path}_height")), - height_count: MetricPattern21::new(client.clone(), format!("{base_path}_height_count")), - txindex_count: MetricPattern23::new(client.clone(), format!("{base_path}_txindex_count")), + identity: MetricPattern11::new(client.clone(), format!("{base_path}_identity")), } } } /// Catalog tree node. -pub struct CatalogTree_Indexes_Time { - pub date: MetricPattern19, - pub dateindex: MetricPattern19, - pub dateindex_count: MetricPattern17, - pub decadeindex: MetricPattern10, - pub first_dateindex: MetricPattern17, - pub first_height: MetricPattern19, - pub first_monthindex: MetricPattern6, - pub first_yearindex: MetricPattern20, - pub height_count: MetricPattern19, - pub monthindex: MetricPattern8, - pub monthindex_count: MetricPattern6, - pub quarterindex: MetricPattern15, - pub semesterindex: MetricPattern16, - pub weekindex: MetricPattern9, - pub yearindex: MetricPattern18, - pub yearindex_count: MetricPattern20, +pub struct CatalogTree_Indexes_Height { + pub dateindex: MetricPattern12, + pub difficultyepoch: MetricPattern12, + pub halvingepoch: MetricPattern12, + pub identity: MetricPattern12, + pub txindex_count: MetricPattern12, } -impl CatalogTree_Indexes_Time { +impl CatalogTree_Indexes_Height { pub fn new(client: Arc, base_path: String) -> Self { Self { - date: MetricPattern19::new(client.clone(), format!("{base_path}_date")), - dateindex: MetricPattern19::new(client.clone(), format!("{base_path}_dateindex")), - dateindex_count: MetricPattern17::new(client.clone(), format!("{base_path}_dateindex_count")), - decadeindex: MetricPattern10::new(client.clone(), format!("{base_path}_decadeindex")), - first_dateindex: MetricPattern17::new(client.clone(), format!("{base_path}_first_dateindex")), - first_height: MetricPattern19::new(client.clone(), format!("{base_path}_first_height")), - first_monthindex: MetricPattern6::new(client.clone(), format!("{base_path}_first_monthindex")), - first_yearindex: MetricPattern20::new(client.clone(), format!("{base_path}_first_yearindex")), - height_count: MetricPattern19::new(client.clone(), format!("{base_path}_height_count")), - monthindex: MetricPattern8::new(client.clone(), format!("{base_path}_monthindex")), - monthindex_count: MetricPattern6::new(client.clone(), format!("{base_path}_monthindex_count")), - quarterindex: MetricPattern15::new(client.clone(), format!("{base_path}_quarterindex")), - semesterindex: MetricPattern16::new(client.clone(), format!("{base_path}_semesterindex")), - weekindex: MetricPattern9::new(client.clone(), format!("{base_path}_weekindex")), - yearindex: MetricPattern18::new(client.clone(), format!("{base_path}_yearindex")), - yearindex_count: MetricPattern20::new(client.clone(), format!("{base_path}_yearindex_count")), + dateindex: MetricPattern12::new(client.clone(), format!("{base_path}_dateindex")), + difficultyepoch: MetricPattern12::new(client.clone(), format!("{base_path}_difficultyepoch")), + halvingepoch: MetricPattern12::new(client.clone(), format!("{base_path}_halvingepoch")), + identity: MetricPattern12::new(client.clone(), format!("{base_path}_identity")), + txindex_count: MetricPattern12::new(client.clone(), format!("{base_path}_txindex_count")), } } } /// Catalog tree node. -pub struct CatalogTree_Indexes_Transaction { - pub input_count: MetricPattern36, - pub output_count: MetricPattern36, - pub txindex: MetricPattern36, - pub txinindex: MetricPattern24, - pub txoutindex: MetricPattern26, +pub struct CatalogTree_Indexes_Monthindex { + pub dateindex_count: MetricPattern14, + pub first_dateindex: MetricPattern14, + pub identity: MetricPattern14, + pub quarterindex: MetricPattern14, + pub semesterindex: MetricPattern14, + pub yearindex: MetricPattern14, } -impl CatalogTree_Indexes_Transaction { +impl CatalogTree_Indexes_Monthindex { pub fn new(client: Arc, base_path: String) -> Self { Self { - input_count: MetricPattern36::new(client.clone(), format!("{base_path}_input_count")), - output_count: MetricPattern36::new(client.clone(), format!("{base_path}_output_count")), - txindex: MetricPattern36::new(client.clone(), format!("{base_path}_txindex")), - txinindex: MetricPattern24::new(client.clone(), format!("{base_path}_txinindex")), - txoutindex: MetricPattern26::new(client.clone(), format!("{base_path}_txoutindex")), + dateindex_count: MetricPattern14::new(client.clone(), format!("{base_path}_dateindex_count")), + first_dateindex: MetricPattern14::new(client.clone(), format!("{base_path}_first_dateindex")), + identity: MetricPattern14::new(client.clone(), format!("{base_path}_identity")), + quarterindex: MetricPattern14::new(client.clone(), format!("{base_path}_quarterindex")), + semesterindex: MetricPattern14::new(client.clone(), format!("{base_path}_semesterindex")), + yearindex: MetricPattern14::new(client.clone(), format!("{base_path}_yearindex")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Indexes_Quarterindex { + pub first_monthindex: MetricPattern26, + pub identity: MetricPattern26, + pub monthindex_count: MetricPattern26, +} + +impl CatalogTree_Indexes_Quarterindex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + first_monthindex: MetricPattern26::new(client.clone(), format!("{base_path}_first_monthindex")), + identity: MetricPattern26::new(client.clone(), format!("{base_path}_identity")), + monthindex_count: MetricPattern26::new(client.clone(), format!("{base_path}_monthindex_count")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Indexes_Semesterindex { + pub first_monthindex: MetricPattern27, + pub identity: MetricPattern27, + pub monthindex_count: MetricPattern27, +} + +impl CatalogTree_Indexes_Semesterindex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + first_monthindex: MetricPattern27::new(client.clone(), format!("{base_path}_first_monthindex")), + identity: MetricPattern27::new(client.clone(), format!("{base_path}_identity")), + monthindex_count: MetricPattern27::new(client.clone(), format!("{base_path}_monthindex_count")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Indexes_Txindex { + pub identity: MetricPattern28, + pub input_count: MetricPattern28, + pub output_count: MetricPattern28, +} + +impl CatalogTree_Indexes_Txindex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + identity: MetricPattern28::new(client.clone(), format!("{base_path}_identity")), + input_count: MetricPattern28::new(client.clone(), format!("{base_path}_input_count")), + output_count: MetricPattern28::new(client.clone(), format!("{base_path}_output_count")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Indexes_Weekindex { + pub dateindex_count: MetricPattern30, + pub first_dateindex: MetricPattern30, + pub identity: MetricPattern30, +} + +impl CatalogTree_Indexes_Weekindex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + dateindex_count: MetricPattern30::new(client.clone(), format!("{base_path}_dateindex_count")), + first_dateindex: MetricPattern30::new(client.clone(), format!("{base_path}_first_dateindex")), + identity: MetricPattern30::new(client.clone(), format!("{base_path}_identity")), + } + } +} + +/// Catalog tree node. +pub struct CatalogTree_Indexes_Yearindex { + pub decadeindex: MetricPattern31, + pub first_monthindex: MetricPattern31, + pub identity: MetricPattern31, + pub monthindex_count: MetricPattern31, +} + +impl CatalogTree_Indexes_Yearindex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + decadeindex: MetricPattern31::new(client.clone(), format!("{base_path}_decadeindex")), + first_monthindex: MetricPattern31::new(client.clone(), format!("{base_path}_first_monthindex")), + identity: MetricPattern31::new(client.clone(), format!("{base_path}_identity")), + monthindex_count: MetricPattern31::new(client.clone(), format!("{base_path}_monthindex_count")), } } } /// Catalog tree node. pub struct CatalogTree_Inputs { - pub count: CatalogTree_Inputs_Count, - pub first_txinindex: MetricPattern23, - pub outpoint: MetricPattern24, - pub outputtype: MetricPattern24, + pub count: SizePattern, + pub first_txinindex: MetricPattern12, + pub outpoint: MetricPattern13, + pub outputtype: MetricPattern13, pub spent: CatalogTree_Inputs_Spent, - pub txindex: MetricPattern24, - pub typeindex: MetricPattern24, + pub txindex: MetricPattern13, + pub typeindex: MetricPattern13, + pub witness_size: MetricPattern13, } impl CatalogTree_Inputs { pub fn new(client: Arc, base_path: String) -> Self { Self { - count: CatalogTree_Inputs_Count::new(client.clone(), format!("{base_path}_count")), - first_txinindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_txinindex")), - outpoint: MetricPattern24::new(client.clone(), format!("{base_path}_outpoint")), - outputtype: MetricPattern24::new(client.clone(), format!("{base_path}_outputtype")), + count: SizePattern::new(client.clone(), "input_count".to_string()), + first_txinindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_txinindex")), + outpoint: MetricPattern13::new(client.clone(), format!("{base_path}_outpoint")), + outputtype: MetricPattern13::new(client.clone(), format!("{base_path}_outputtype")), spent: CatalogTree_Inputs_Spent::new(client.clone(), format!("{base_path}_spent")), - txindex: MetricPattern24::new(client.clone(), format!("{base_path}_txindex")), - typeindex: MetricPattern24::new(client.clone(), format!("{base_path}_typeindex")), - } - } -} - -/// Catalog tree node. -pub struct CatalogTree_Inputs_Count { - pub count: BlockSizePattern, -} - -impl CatalogTree_Inputs_Count { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - count: BlockSizePattern::new(client.clone(), "input_count".to_string()), + txindex: MetricPattern13::new(client.clone(), format!("{base_path}_txindex")), + typeindex: MetricPattern13::new(client.clone(), format!("{base_path}_typeindex")), + witness_size: MetricPattern13::new(client.clone(), format!("{base_path}_witness_size")), } } } /// Catalog tree node. pub struct CatalogTree_Inputs_Spent { - pub txoutindex: MetricPattern24, - pub value: MetricPattern24, + pub txoutindex: MetricPattern13, + pub value: MetricPattern13, } impl CatalogTree_Inputs_Spent { pub fn new(client: Arc, base_path: String) -> Self { Self { - txoutindex: MetricPattern24::new(client.clone(), format!("{base_path}_txoutindex")), - value: MetricPattern24::new(client.clone(), format!("{base_path}_value")), + txoutindex: MetricPattern13::new(client.clone(), format!("{base_path}_txoutindex")), + value: MetricPattern13::new(client.clone(), format!("{base_path}_value")), } } } @@ -5609,7 +5409,7 @@ pub struct CatalogTree_Market_Ath { pub days_since_price_ath: MetricPattern4, pub max_days_between_price_aths: MetricPattern4, pub max_years_between_price_aths: MetricPattern4, - pub price_ath: MetricPattern3, + pub price_ath: MetricPattern1, pub price_drawdown: MetricPattern3, pub years_since_price_ath: MetricPattern4, } @@ -5620,7 +5420,7 @@ impl CatalogTree_Market_Ath { days_since_price_ath: MetricPattern4::new(client.clone(), format!("{base_path}_days_since_price_ath")), max_days_between_price_aths: MetricPattern4::new(client.clone(), format!("{base_path}_max_days_between_price_aths")), max_years_between_price_aths: MetricPattern4::new(client.clone(), format!("{base_path}_max_years_between_price_aths")), - price_ath: MetricPattern3::new(client.clone(), format!("{base_path}_price_ath")), + price_ath: MetricPattern1::new(client.clone(), format!("{base_path}_price_ath")), price_drawdown: MetricPattern3::new(client.clone(), format!("{base_path}_price_drawdown")), years_since_price_ath: MetricPattern4::new(client.clone(), format!("{base_path}_years_since_price_ath")), } @@ -5656,82 +5456,82 @@ impl CatalogTree_Market_Dca { /// Catalog tree node. pub struct CatalogTree_Market_Dca_ClassStack { - pub _2015: ActiveSupplyPattern, - pub _2016: ActiveSupplyPattern, - pub _2017: ActiveSupplyPattern, - pub _2018: ActiveSupplyPattern, - pub _2019: ActiveSupplyPattern, - pub _2020: ActiveSupplyPattern, - pub _2021: ActiveSupplyPattern, - pub _2022: ActiveSupplyPattern, - pub _2023: ActiveSupplyPattern, - pub _2024: ActiveSupplyPattern, - pub _2025: ActiveSupplyPattern, + pub _2015: _24hCoinbaseSumPattern, + pub _2016: _24hCoinbaseSumPattern, + pub _2017: _24hCoinbaseSumPattern, + pub _2018: _24hCoinbaseSumPattern, + pub _2019: _24hCoinbaseSumPattern, + pub _2020: _24hCoinbaseSumPattern, + pub _2021: _24hCoinbaseSumPattern, + pub _2022: _24hCoinbaseSumPattern, + pub _2023: _24hCoinbaseSumPattern, + pub _2024: _24hCoinbaseSumPattern, + pub _2025: _24hCoinbaseSumPattern, } impl CatalogTree_Market_Dca_ClassStack { pub fn new(client: Arc, base_path: String) -> Self { Self { - _2015: ActiveSupplyPattern::new(client.clone(), "dca_class_2015_stack".to_string()), - _2016: ActiveSupplyPattern::new(client.clone(), "dca_class_2016_stack".to_string()), - _2017: ActiveSupplyPattern::new(client.clone(), "dca_class_2017_stack".to_string()), - _2018: ActiveSupplyPattern::new(client.clone(), "dca_class_2018_stack".to_string()), - _2019: ActiveSupplyPattern::new(client.clone(), "dca_class_2019_stack".to_string()), - _2020: ActiveSupplyPattern::new(client.clone(), "dca_class_2020_stack".to_string()), - _2021: ActiveSupplyPattern::new(client.clone(), "dca_class_2021_stack".to_string()), - _2022: ActiveSupplyPattern::new(client.clone(), "dca_class_2022_stack".to_string()), - _2023: ActiveSupplyPattern::new(client.clone(), "dca_class_2023_stack".to_string()), - _2024: ActiveSupplyPattern::new(client.clone(), "dca_class_2024_stack".to_string()), - _2025: ActiveSupplyPattern::new(client.clone(), "dca_class_2025_stack".to_string()), + _2015: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2015_stack".to_string()), + _2016: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2016_stack".to_string()), + _2017: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2017_stack".to_string()), + _2018: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2018_stack".to_string()), + _2019: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2019_stack".to_string()), + _2020: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2020_stack".to_string()), + _2021: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2021_stack".to_string()), + _2022: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2022_stack".to_string()), + _2023: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2023_stack".to_string()), + _2024: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2024_stack".to_string()), + _2025: _24hCoinbaseSumPattern::new(client.clone(), "dca_class_2025_stack".to_string()), } } } /// Catalog tree node. pub struct CatalogTree_Market_Indicators { - pub gini: MetricPattern19, - pub macd_histogram: MetricPattern19, - pub macd_line: MetricPattern19, - pub macd_signal: MetricPattern19, + pub gini: MetricPattern7, + pub macd_histogram: MetricPattern7, + pub macd_line: MetricPattern7, + pub macd_signal: MetricPattern7, pub nvt: MetricPattern4, - pub pi_cycle: MetricPattern19, + pub pi_cycle: MetricPattern7, pub puell_multiple: MetricPattern4, - pub rsi_14d: MetricPattern19, - pub rsi_14d_max: MetricPattern19, - pub rsi_14d_min: MetricPattern19, - pub rsi_average_gain_14d: MetricPattern19, - pub rsi_average_loss_14d: MetricPattern19, - pub rsi_gains: MetricPattern19, - pub rsi_losses: MetricPattern19, - pub stoch_d: MetricPattern19, - pub stoch_k: MetricPattern19, - pub stoch_rsi: MetricPattern19, - pub stoch_rsi_d: MetricPattern19, - pub stoch_rsi_k: MetricPattern19, + pub rsi_14d: MetricPattern7, + pub rsi_14d_max: MetricPattern7, + pub rsi_14d_min: MetricPattern7, + pub rsi_average_gain_14d: MetricPattern7, + pub rsi_average_loss_14d: MetricPattern7, + pub rsi_gains: MetricPattern7, + pub rsi_losses: MetricPattern7, + pub stoch_d: MetricPattern7, + pub stoch_k: MetricPattern7, + pub stoch_rsi: MetricPattern7, + pub stoch_rsi_d: MetricPattern7, + pub stoch_rsi_k: MetricPattern7, } impl CatalogTree_Market_Indicators { pub fn new(client: Arc, base_path: String) -> Self { Self { - gini: MetricPattern19::new(client.clone(), format!("{base_path}_gini")), - macd_histogram: MetricPattern19::new(client.clone(), format!("{base_path}_macd_histogram")), - macd_line: MetricPattern19::new(client.clone(), format!("{base_path}_macd_line")), - macd_signal: MetricPattern19::new(client.clone(), format!("{base_path}_macd_signal")), + gini: MetricPattern7::new(client.clone(), format!("{base_path}_gini")), + macd_histogram: MetricPattern7::new(client.clone(), format!("{base_path}_macd_histogram")), + macd_line: MetricPattern7::new(client.clone(), format!("{base_path}_macd_line")), + macd_signal: MetricPattern7::new(client.clone(), format!("{base_path}_macd_signal")), nvt: MetricPattern4::new(client.clone(), format!("{base_path}_nvt")), - pi_cycle: MetricPattern19::new(client.clone(), format!("{base_path}_pi_cycle")), + pi_cycle: MetricPattern7::new(client.clone(), format!("{base_path}_pi_cycle")), puell_multiple: MetricPattern4::new(client.clone(), format!("{base_path}_puell_multiple")), - rsi_14d: MetricPattern19::new(client.clone(), format!("{base_path}_rsi_14d")), - rsi_14d_max: MetricPattern19::new(client.clone(), format!("{base_path}_rsi_14d_max")), - rsi_14d_min: MetricPattern19::new(client.clone(), format!("{base_path}_rsi_14d_min")), - rsi_average_gain_14d: MetricPattern19::new(client.clone(), format!("{base_path}_rsi_average_gain_14d")), - rsi_average_loss_14d: MetricPattern19::new(client.clone(), format!("{base_path}_rsi_average_loss_14d")), - rsi_gains: MetricPattern19::new(client.clone(), format!("{base_path}_rsi_gains")), - rsi_losses: MetricPattern19::new(client.clone(), format!("{base_path}_rsi_losses")), - stoch_d: MetricPattern19::new(client.clone(), format!("{base_path}_stoch_d")), - stoch_k: MetricPattern19::new(client.clone(), format!("{base_path}_stoch_k")), - stoch_rsi: MetricPattern19::new(client.clone(), format!("{base_path}_stoch_rsi")), - stoch_rsi_d: MetricPattern19::new(client.clone(), format!("{base_path}_stoch_rsi_d")), - stoch_rsi_k: MetricPattern19::new(client.clone(), format!("{base_path}_stoch_rsi_k")), + rsi_14d: MetricPattern7::new(client.clone(), format!("{base_path}_rsi_14d")), + rsi_14d_max: MetricPattern7::new(client.clone(), format!("{base_path}_rsi_14d_max")), + rsi_14d_min: MetricPattern7::new(client.clone(), format!("{base_path}_rsi_14d_min")), + rsi_average_gain_14d: MetricPattern7::new(client.clone(), format!("{base_path}_rsi_average_gain_14d")), + rsi_average_loss_14d: MetricPattern7::new(client.clone(), format!("{base_path}_rsi_average_loss_14d")), + rsi_gains: MetricPattern7::new(client.clone(), format!("{base_path}_rsi_gains")), + rsi_losses: MetricPattern7::new(client.clone(), format!("{base_path}_rsi_losses")), + stoch_d: MetricPattern7::new(client.clone(), format!("{base_path}_stoch_d")), + stoch_k: MetricPattern7::new(client.clone(), format!("{base_path}_stoch_k")), + stoch_rsi: MetricPattern7::new(client.clone(), format!("{base_path}_stoch_rsi")), + stoch_rsi_d: MetricPattern7::new(client.clone(), format!("{base_path}_stoch_rsi_d")), + stoch_rsi_k: MetricPattern7::new(client.clone(), format!("{base_path}_stoch_rsi_k")), } } } @@ -5841,8 +5641,8 @@ pub struct CatalogTree_Market_Range { pub price_2w_choppiness_index: MetricPattern4, pub price_2w_max: MetricPattern4, pub price_2w_min: MetricPattern4, - pub price_true_range: MetricPattern19, - pub price_true_range_2w_sum: MetricPattern19, + pub price_true_range: MetricPattern7, + pub price_true_range_2w_sum: MetricPattern7, } impl CatalogTree_Market_Range { @@ -5857,8 +5657,8 @@ impl CatalogTree_Market_Range { price_2w_choppiness_index: MetricPattern4::new(client.clone(), format!("{base_path}_price_2w_choppiness_index")), price_2w_max: MetricPattern4::new(client.clone(), format!("{base_path}_price_2w_max")), price_2w_min: MetricPattern4::new(client.clone(), format!("{base_path}_price_2w_min")), - price_true_range: MetricPattern19::new(client.clone(), format!("{base_path}_price_true_range")), - price_true_range_2w_sum: MetricPattern19::new(client.clone(), format!("{base_path}_price_true_range_2w_sum")), + price_true_range: MetricPattern7::new(client.clone(), format!("{base_path}_price_true_range")), + price_true_range_2w_sum: MetricPattern7::new(client.clone(), format!("{base_path}_price_true_range_2w_sum")), } } } @@ -5872,7 +5672,7 @@ pub struct CatalogTree_Market_Returns { pub downside_1m_sd: _1dReturns1mSdPattern, pub downside_1w_sd: _1dReturns1mSdPattern, pub downside_1y_sd: _1dReturns1mSdPattern, - pub downside_returns: MetricPattern19, + pub downside_returns: MetricPattern7, pub price_returns: PriceAgoPattern, } @@ -5886,7 +5686,7 @@ impl CatalogTree_Market_Returns { downside_1m_sd: _1dReturns1mSdPattern::new(client.clone(), "downside_1m_sd".to_string()), downside_1w_sd: _1dReturns1mSdPattern::new(client.clone(), "downside_1w_sd".to_string()), downside_1y_sd: _1dReturns1mSdPattern::new(client.clone(), "downside_1y_sd".to_string()), - downside_returns: MetricPattern19::new(client.clone(), format!("{base_path}_downside_returns")), + downside_returns: MetricPattern7::new(client.clone(), format!("{base_path}_downside_returns")), price_returns: PriceAgoPattern::new(client.clone(), "price_returns".to_string()), } } @@ -5897,12 +5697,12 @@ pub struct CatalogTree_Market_Volatility { pub price_1m_volatility: MetricPattern4, pub price_1w_volatility: MetricPattern4, pub price_1y_volatility: MetricPattern4, - pub sharpe_1m: MetricPattern19, - pub sharpe_1w: MetricPattern19, - pub sharpe_1y: MetricPattern19, - pub sortino_1m: MetricPattern19, - pub sortino_1w: MetricPattern19, - pub sortino_1y: MetricPattern19, + pub sharpe_1m: MetricPattern7, + pub sharpe_1w: MetricPattern7, + pub sharpe_1y: MetricPattern7, + pub sortino_1m: MetricPattern7, + pub sortino_1w: MetricPattern7, + pub sortino_1y: MetricPattern7, } impl CatalogTree_Market_Volatility { @@ -5911,12 +5711,12 @@ impl CatalogTree_Market_Volatility { price_1m_volatility: MetricPattern4::new(client.clone(), format!("{base_path}_price_1m_volatility")), price_1w_volatility: MetricPattern4::new(client.clone(), format!("{base_path}_price_1w_volatility")), price_1y_volatility: MetricPattern4::new(client.clone(), format!("{base_path}_price_1y_volatility")), - sharpe_1m: MetricPattern19::new(client.clone(), format!("{base_path}_sharpe_1m")), - sharpe_1w: MetricPattern19::new(client.clone(), format!("{base_path}_sharpe_1w")), - sharpe_1y: MetricPattern19::new(client.clone(), format!("{base_path}_sharpe_1y")), - sortino_1m: MetricPattern19::new(client.clone(), format!("{base_path}_sortino_1m")), - sortino_1w: MetricPattern19::new(client.clone(), format!("{base_path}_sortino_1w")), - sortino_1y: MetricPattern19::new(client.clone(), format!("{base_path}_sortino_1y")), + sharpe_1m: MetricPattern7::new(client.clone(), format!("{base_path}_sharpe_1m")), + sharpe_1w: MetricPattern7::new(client.clone(), format!("{base_path}_sharpe_1w")), + sharpe_1y: MetricPattern7::new(client.clone(), format!("{base_path}_sharpe_1y")), + sortino_1m: MetricPattern7::new(client.clone(), format!("{base_path}_sortino_1m")), + sortino_1w: MetricPattern7::new(client.clone(), format!("{base_path}_sortino_1w")), + sortino_1y: MetricPattern7::new(client.clone(), format!("{base_path}_sortino_1y")), } } } @@ -5924,38 +5724,38 @@ impl CatalogTree_Market_Volatility { /// Catalog tree node. pub struct CatalogTree_Outputs { pub count: CatalogTree_Outputs_Count, - pub first_txoutindex: MetricPattern23, - pub outputtype: MetricPattern26, + pub first_txoutindex: MetricPattern12, + pub outputtype: MetricPattern16, pub spent: CatalogTree_Outputs_Spent, - pub txindex: MetricPattern26, - pub typeindex: MetricPattern26, - pub value: MetricPattern26, + pub txindex: MetricPattern16, + pub typeindex: MetricPattern16, + pub value: MetricPattern16, } impl CatalogTree_Outputs { pub fn new(client: Arc, base_path: String) -> Self { Self { count: CatalogTree_Outputs_Count::new(client.clone(), format!("{base_path}_count")), - first_txoutindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_txoutindex")), - outputtype: MetricPattern26::new(client.clone(), format!("{base_path}_outputtype")), + first_txoutindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_txoutindex")), + outputtype: MetricPattern16::new(client.clone(), format!("{base_path}_outputtype")), spent: CatalogTree_Outputs_Spent::new(client.clone(), format!("{base_path}_spent")), - txindex: MetricPattern26::new(client.clone(), format!("{base_path}_txindex")), - typeindex: MetricPattern26::new(client.clone(), format!("{base_path}_typeindex")), - value: MetricPattern26::new(client.clone(), format!("{base_path}_value")), + txindex: MetricPattern16::new(client.clone(), format!("{base_path}_txindex")), + typeindex: MetricPattern16::new(client.clone(), format!("{base_path}_typeindex")), + value: MetricPattern16::new(client.clone(), format!("{base_path}_value")), } } } /// Catalog tree node. pub struct CatalogTree_Outputs_Count { - pub count: BlockSizePattern, + pub total_count: SizePattern, pub utxo_count: BitcoinPattern, } impl CatalogTree_Outputs_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { - count: BlockSizePattern::new(client.clone(), "output_count".to_string()), + total_count: SizePattern::new(client.clone(), "output_count".to_string()), utxo_count: BitcoinPattern::new(client.clone(), "exact_utxo_count".to_string()), } } @@ -5963,27 +5763,27 @@ impl CatalogTree_Outputs_Count { /// Catalog tree node. pub struct CatalogTree_Outputs_Spent { - pub txinindex: MetricPattern26, + pub txinindex: MetricPattern16, } impl CatalogTree_Outputs_Spent { pub fn new(client: Arc, base_path: String) -> Self { Self { - txinindex: MetricPattern26::new(client.clone(), format!("{base_path}_txinindex")), + txinindex: MetricPattern16::new(client.clone(), format!("{base_path}_txinindex")), } } } /// Catalog tree node. pub struct CatalogTree_Pools { - pub pool: MetricPattern23, + pub pool: MetricPattern12, pub vecs: CatalogTree_Pools_Vecs, } impl CatalogTree_Pools { pub fn new(client: Arc, base_path: String) -> Self { Self { - pool: MetricPattern23::new(client.clone(), format!("{base_path}_pool")), + pool: MetricPattern12::new(client.clone(), format!("{base_path}_pool")), vecs: CatalogTree_Pools_Vecs::new(client.clone(), format!("{base_path}_vecs")), } } @@ -6318,13 +6118,15 @@ impl CatalogTree_Pools_Vecs { /// Catalog tree node. pub struct CatalogTree_Positions { - pub position: MetricPattern14, + pub block_position: MetricPattern12, + pub tx_position: MetricPattern28, } impl CatalogTree_Positions { pub fn new(client: Arc, base_path: String) -> Self { Self { - position: MetricPattern14::new(client.clone(), format!("{base_path}_position")), + block_position: MetricPattern12::new(client.clone(), format!("{base_path}_block_position")), + tx_position: MetricPattern28::new(client.clone(), format!("{base_path}_tx_position")), } } } @@ -6332,79 +6134,46 @@ impl CatalogTree_Positions { /// Catalog tree node. pub struct CatalogTree_Price { pub cents: CatalogTree_Price_Cents, - pub sats: CatalogTree_Price_Sats, - pub usd: CatalogTree_Price_Usd, + pub sats: SatsPattern, + pub usd: SatsPattern, } impl CatalogTree_Price { pub fn new(client: Arc, base_path: String) -> Self { Self { cents: CatalogTree_Price_Cents::new(client.clone(), format!("{base_path}_cents")), - sats: CatalogTree_Price_Sats::new(client.clone(), format!("{base_path}_sats")), - usd: CatalogTree_Price_Usd::new(client.clone(), format!("{base_path}_usd")), + sats: SatsPattern::new(client.clone(), "price".to_string()), + usd: SatsPattern::new(client.clone(), "price".to_string()), } } } /// Catalog tree node. pub struct CatalogTree_Price_Cents { - pub ohlc: MetricPattern7, + pub ohlc: MetricPattern6, + pub split: CatalogTree_Price_Cents_Split, } impl CatalogTree_Price_Cents { pub fn new(client: Arc, base_path: String) -> Self { Self { - ohlc: MetricPattern7::new(client.clone(), format!("{base_path}_ohlc")), + ohlc: MetricPattern6::new(client.clone(), format!("{base_path}_ohlc")), + split: CatalogTree_Price_Cents_Split::new(client.clone(), format!("{base_path}_split")), } } } /// Catalog tree node. -pub struct CatalogTree_Price_Sats { - pub price_close_sats: MetricPattern1, - pub price_high_sats: PriceHighSatsPattern, - pub price_low_sats: PriceHighSatsPattern, - pub price_ohlc_sats: MetricPattern1, - pub price_open_sats: MetricPattern1, +pub struct CatalogTree_Price_Cents_Split { + pub dateindex: DateindexPattern2, + pub height: DateindexPattern2, } -impl CatalogTree_Price_Sats { +impl CatalogTree_Price_Cents_Split { pub fn new(client: Arc, base_path: String) -> Self { Self { - price_close_sats: MetricPattern1::new(client.clone(), format!("{base_path}_price_close_sats")), - price_high_sats: PriceHighSatsPattern::new(client.clone(), "price_high_sats".to_string()), - price_low_sats: PriceHighSatsPattern::new(client.clone(), "price_low_sats".to_string()), - price_ohlc_sats: MetricPattern1::new(client.clone(), format!("{base_path}_price_ohlc_sats")), - price_open_sats: MetricPattern1::new(client.clone(), format!("{base_path}_price_open_sats")), - } - } -} - -/// Catalog tree node. -pub struct CatalogTree_Price_Usd { - pub price_close: MetricPattern1, - pub price_close_cents: MetricPattern7, - pub price_high: PriceHighSatsPattern, - pub price_high_cents: MetricPattern7, - pub price_low: PriceHighSatsPattern, - pub price_low_cents: MetricPattern7, - pub price_ohlc: MetricPattern1, - pub price_open: MetricPattern1, - pub price_open_cents: MetricPattern7, -} - -impl CatalogTree_Price_Usd { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - price_close: MetricPattern1::new(client.clone(), format!("{base_path}_price_close")), - price_close_cents: MetricPattern7::new(client.clone(), format!("{base_path}_price_close_cents")), - price_high: PriceHighSatsPattern::new(client.clone(), "price_high".to_string()), - price_high_cents: MetricPattern7::new(client.clone(), format!("{base_path}_price_high_cents")), - price_low: PriceHighSatsPattern::new(client.clone(), "price_low".to_string()), - price_low_cents: MetricPattern7::new(client.clone(), format!("{base_path}_price_low_cents")), - price_ohlc: MetricPattern1::new(client.clone(), format!("{base_path}_price_ohlc")), - price_open: MetricPattern1::new(client.clone(), format!("{base_path}_price_open")), - price_open_cents: MetricPattern7::new(client.clone(), format!("{base_path}_price_open_cents")), + dateindex: DateindexPattern2::new(client.clone(), "price".to_string()), + height: DateindexPattern2::new(client.clone(), "price".to_string()), } } } @@ -6412,14 +6181,14 @@ impl CatalogTree_Price_Usd { /// Catalog tree node. pub struct CatalogTree_Scripts { pub count: CatalogTree_Scripts_Count, - pub empty_to_txindex: MetricPattern22, - pub first_emptyoutputindex: MetricPattern23, - pub first_opreturnindex: MetricPattern23, - pub first_p2msoutputindex: MetricPattern23, - pub first_unknownoutputindex: MetricPattern23, - pub opreturn_to_txindex: MetricPattern25, - pub p2ms_to_txindex: MetricPattern28, - pub unknown_to_txindex: MetricPattern37, + pub empty_to_txindex: MetricPattern10, + pub first_emptyoutputindex: MetricPattern12, + pub first_opreturnindex: MetricPattern12, + pub first_p2msoutputindex: MetricPattern12, + pub first_unknownoutputindex: MetricPattern12, + pub opreturn_to_txindex: MetricPattern15, + pub p2ms_to_txindex: MetricPattern18, + pub unknown_to_txindex: MetricPattern29, pub value: CatalogTree_Scripts_Value, } @@ -6427,14 +6196,14 @@ impl CatalogTree_Scripts { pub fn new(client: Arc, base_path: String) -> Self { Self { count: CatalogTree_Scripts_Count::new(client.clone(), format!("{base_path}_count")), - empty_to_txindex: MetricPattern22::new(client.clone(), format!("{base_path}_empty_to_txindex")), - first_emptyoutputindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_emptyoutputindex")), - first_opreturnindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_opreturnindex")), - first_p2msoutputindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_p2msoutputindex")), - first_unknownoutputindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_unknownoutputindex")), - opreturn_to_txindex: MetricPattern25::new(client.clone(), format!("{base_path}_opreturn_to_txindex")), - p2ms_to_txindex: MetricPattern28::new(client.clone(), format!("{base_path}_p2ms_to_txindex")), - unknown_to_txindex: MetricPattern37::new(client.clone(), format!("{base_path}_unknown_to_txindex")), + empty_to_txindex: MetricPattern10::new(client.clone(), format!("{base_path}_empty_to_txindex")), + first_emptyoutputindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_emptyoutputindex")), + first_opreturnindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_opreturnindex")), + first_p2msoutputindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_p2msoutputindex")), + first_unknownoutputindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_unknownoutputindex")), + opreturn_to_txindex: MetricPattern15::new(client.clone(), format!("{base_path}_opreturn_to_txindex")), + p2ms_to_txindex: MetricPattern18::new(client.clone(), format!("{base_path}_p2ms_to_txindex")), + unknown_to_txindex: MetricPattern29::new(client.clone(), format!("{base_path}_unknown_to_txindex")), value: CatalogTree_Scripts_Value::new(client.clone(), format!("{base_path}_value")), } } @@ -6454,8 +6223,8 @@ pub struct CatalogTree_Scripts_Count { pub p2wpkh: BitcoinPattern, pub p2wsh: BitcoinPattern, pub segwit: BitcoinPattern, - pub segwit_adoption: SatsPattern, - pub taproot_adoption: SatsPattern, + pub segwit_adoption: SegwitAdoptionPattern, + pub taproot_adoption: SegwitAdoptionPattern, pub unknownoutput: BitcoinPattern, } @@ -6474,8 +6243,8 @@ impl CatalogTree_Scripts_Count { p2wpkh: BitcoinPattern::new(client.clone(), "p2wpkh_count".to_string()), p2wsh: BitcoinPattern::new(client.clone(), "p2wsh_count".to_string()), segwit: BitcoinPattern::new(client.clone(), "segwit_count".to_string()), - segwit_adoption: SatsPattern::new(client.clone(), "segwit_adoption".to_string()), - taproot_adoption: SatsPattern::new(client.clone(), "taproot_adoption".to_string()), + segwit_adoption: SegwitAdoptionPattern::new(client.clone(), "segwit_adoption".to_string()), + taproot_adoption: SegwitAdoptionPattern::new(client.clone(), "taproot_adoption".to_string()), unknownoutput: BitcoinPattern::new(client.clone(), "unknownoutput_count".to_string()), } } @@ -6497,9 +6266,9 @@ impl CatalogTree_Scripts_Value { /// Catalog tree node. pub struct CatalogTree_Supply { pub burned: CatalogTree_Supply_Burned, - pub circulating: ActiveSupplyPattern, + pub circulating: _24hCoinbaseSumPattern, pub inflation: MetricPattern4, - pub market_cap: MetricPattern3, + pub market_cap: MetricPattern1, pub velocity: CatalogTree_Supply_Velocity, } @@ -6507,9 +6276,9 @@ impl CatalogTree_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { burned: CatalogTree_Supply_Burned::new(client.clone(), format!("{base_path}_burned")), - circulating: ActiveSupplyPattern::new(client.clone(), "circulating".to_string()), + circulating: _24hCoinbaseSumPattern::new(client.clone(), "circulating_supply".to_string()), inflation: MetricPattern4::new(client.clone(), format!("{base_path}_inflation")), - market_cap: MetricPattern3::new(client.clone(), format!("{base_path}_market_cap")), + market_cap: MetricPattern1::new(client.clone(), format!("{base_path}_market_cap")), velocity: CatalogTree_Supply_Velocity::new(client.clone(), format!("{base_path}_velocity")), } } @@ -6547,19 +6316,19 @@ impl CatalogTree_Supply_Velocity { /// Catalog tree node. pub struct CatalogTree_Transactions { - pub base_size: MetricPattern36, + pub base_size: MetricPattern28, pub count: CatalogTree_Transactions_Count, pub fees: CatalogTree_Transactions_Fees, - pub first_txindex: MetricPattern23, - pub first_txinindex: MetricPattern36, - pub first_txoutindex: MetricPattern36, - pub height: MetricPattern36, - pub is_explicitly_rbf: MetricPattern36, - pub rawlocktime: MetricPattern36, + pub first_txindex: MetricPattern12, + pub first_txinindex: MetricPattern28, + pub first_txoutindex: MetricPattern28, + pub height: MetricPattern28, + pub is_explicitly_rbf: MetricPattern28, + pub rawlocktime: MetricPattern28, pub size: CatalogTree_Transactions_Size, - pub total_size: MetricPattern36, - pub txid: MetricPattern36, - pub txversion: MetricPattern36, + pub total_size: MetricPattern28, + pub txid: MetricPattern28, + pub txversion: MetricPattern28, pub versions: CatalogTree_Transactions_Versions, pub volume: CatalogTree_Transactions_Volume, } @@ -6567,19 +6336,19 @@ pub struct CatalogTree_Transactions { impl CatalogTree_Transactions { pub fn new(client: Arc, base_path: String) -> Self { Self { - base_size: MetricPattern36::new(client.clone(), format!("{base_path}_base_size")), + base_size: MetricPattern28::new(client.clone(), format!("{base_path}_base_size")), count: CatalogTree_Transactions_Count::new(client.clone(), format!("{base_path}_count")), fees: CatalogTree_Transactions_Fees::new(client.clone(), format!("{base_path}_fees")), - first_txindex: MetricPattern23::new(client.clone(), format!("{base_path}_first_txindex")), - first_txinindex: MetricPattern36::new(client.clone(), format!("{base_path}_first_txinindex")), - first_txoutindex: MetricPattern36::new(client.clone(), format!("{base_path}_first_txoutindex")), - height: MetricPattern36::new(client.clone(), format!("{base_path}_height")), - is_explicitly_rbf: MetricPattern36::new(client.clone(), format!("{base_path}_is_explicitly_rbf")), - rawlocktime: MetricPattern36::new(client.clone(), format!("{base_path}_rawlocktime")), + first_txindex: MetricPattern12::new(client.clone(), format!("{base_path}_first_txindex")), + first_txinindex: MetricPattern28::new(client.clone(), format!("{base_path}_first_txinindex")), + first_txoutindex: MetricPattern28::new(client.clone(), format!("{base_path}_first_txoutindex")), + height: MetricPattern28::new(client.clone(), format!("{base_path}_height")), + is_explicitly_rbf: MetricPattern28::new(client.clone(), format!("{base_path}_is_explicitly_rbf")), + rawlocktime: MetricPattern28::new(client.clone(), format!("{base_path}_rawlocktime")), size: CatalogTree_Transactions_Size::new(client.clone(), format!("{base_path}_size")), - total_size: MetricPattern36::new(client.clone(), format!("{base_path}_total_size")), - txid: MetricPattern36::new(client.clone(), format!("{base_path}_txid")), - txversion: MetricPattern36::new(client.clone(), format!("{base_path}_txversion")), + total_size: MetricPattern28::new(client.clone(), format!("{base_path}_total_size")), + txid: MetricPattern28::new(client.clone(), format!("{base_path}_txid")), + txversion: MetricPattern28::new(client.clone(), format!("{base_path}_txversion")), versions: CatalogTree_Transactions_Versions::new(client.clone(), format!("{base_path}_versions")), volume: CatalogTree_Transactions_Volume::new(client.clone(), format!("{base_path}_volume")), } @@ -6588,14 +6357,14 @@ impl CatalogTree_Transactions { /// Catalog tree node. pub struct CatalogTree_Transactions_Count { - pub is_coinbase: MetricPattern36, + pub is_coinbase: MetricPattern28, pub tx_count: BitcoinPattern, } impl CatalogTree_Transactions_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { - is_coinbase: MetricPattern36::new(client.clone(), format!("{base_path}_is_coinbase")), + is_coinbase: MetricPattern28::new(client.clone(), format!("{base_path}_is_coinbase")), tx_count: BitcoinPattern::new(client.clone(), "tx_count".to_string()), } } @@ -6604,95 +6373,89 @@ impl CatalogTree_Transactions_Count { /// Catalog tree node. pub struct CatalogTree_Transactions_Fees { pub fee: CatalogTree_Transactions_Fees_Fee, - pub fee_rate: IntervalPattern, - pub input_value: MetricPattern36, - pub output_value: MetricPattern36, + pub fee_rate: FeeRatePattern, + pub input_value: MetricPattern28, + pub output_value: MetricPattern28, } impl CatalogTree_Transactions_Fees { pub fn new(client: Arc, base_path: String) -> Self { Self { fee: CatalogTree_Transactions_Fees_Fee::new(client.clone(), format!("{base_path}_fee")), - fee_rate: IntervalPattern::new(client.clone(), "fee_rate".to_string()), - input_value: MetricPattern36::new(client.clone(), format!("{base_path}_input_value")), - output_value: MetricPattern36::new(client.clone(), format!("{base_path}_output_value")), + fee_rate: FeeRatePattern::new(client.clone(), "fee_rate".to_string()), + input_value: MetricPattern28::new(client.clone(), format!("{base_path}_input_value")), + output_value: MetricPattern28::new(client.clone(), format!("{base_path}_output_value")), } } } /// Catalog tree node. pub struct CatalogTree_Transactions_Fees_Fee { - pub bitcoin: BlockSizePattern, - pub dollars: BlockSizePattern, - pub sats: BitcoinPattern, + pub bitcoin: SizePattern, + pub dollars: SizePattern, + pub sats: SizePattern, + pub txindex: MetricPattern28, } impl CatalogTree_Transactions_Fees_Fee { pub fn new(client: Arc, base_path: String) -> Self { Self { - bitcoin: BlockSizePattern::new(client.clone(), "fee_btc".to_string()), - dollars: BlockSizePattern::new(client.clone(), "fee_usd".to_string()), - sats: BitcoinPattern::new(client.clone(), "fee".to_string()), + bitcoin: SizePattern::new(client.clone(), "fee_btc".to_string()), + dollars: SizePattern::new(client.clone(), "fee_usd".to_string()), + sats: SizePattern::new(client.clone(), "fee".to_string()), + txindex: MetricPattern28::new(client.clone(), format!("{base_path}_txindex")), } } } /// Catalog tree node. pub struct CatalogTree_Transactions_Size { - pub tx_vsize: TxVsizePattern, - pub tx_weight: TxVsizePattern, - pub vsize: MetricPattern36, - pub weight: MetricPattern36, + pub vsize: FeeRatePattern, + pub weight: FeeRatePattern, } impl CatalogTree_Transactions_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { - tx_vsize: TxVsizePattern::new(client.clone(), "tx_vsize".to_string()), - tx_weight: TxVsizePattern::new(client.clone(), "tx_weight".to_string()), - vsize: MetricPattern36::new(client.clone(), format!("{base_path}_vsize")), - weight: MetricPattern36::new(client.clone(), format!("{base_path}_weight")), + vsize: FeeRatePattern::new(client.clone(), "".to_string()), + weight: FeeRatePattern::new(client.clone(), "".to_string()), } } } /// Catalog tree node. pub struct CatalogTree_Transactions_Versions { - pub tx_v1: BlockCountPattern, - pub tx_v2: BlockCountPattern, - pub tx_v3: BlockCountPattern, + pub v1: BlockCountPattern, + pub v2: BlockCountPattern, + pub v3: BlockCountPattern, } impl CatalogTree_Transactions_Versions { pub fn new(client: Arc, base_path: String) -> Self { Self { - tx_v1: BlockCountPattern::new(client.clone(), "tx_v1".to_string()), - tx_v2: BlockCountPattern::new(client.clone(), "tx_v2".to_string()), - tx_v3: BlockCountPattern::new(client.clone(), "tx_v3".to_string()), + v1: BlockCountPattern::new(client.clone(), "tx_v1".to_string()), + v2: BlockCountPattern::new(client.clone(), "tx_v2".to_string()), + v3: BlockCountPattern::new(client.clone(), "tx_v3".to_string()), } } } /// Catalog tree node. pub struct CatalogTree_Transactions_Volume { - pub annualized_volume: MetricPattern4, - pub annualized_volume_btc: MetricPattern4, - pub annualized_volume_usd: MetricPattern4, + pub annualized_volume: _24hCoinbaseSumPattern, pub inputs_per_sec: MetricPattern4, pub outputs_per_sec: MetricPattern4, - pub sent_sum: ActiveSupplyPattern, + pub sent_sum: _24hCoinbaseSumPattern, pub tx_per_sec: MetricPattern4, } impl CatalogTree_Transactions_Volume { pub fn new(client: Arc, base_path: String) -> Self { Self { - annualized_volume: MetricPattern4::new(client.clone(), format!("{base_path}_annualized_volume")), - annualized_volume_btc: MetricPattern4::new(client.clone(), format!("{base_path}_annualized_volume_btc")), - annualized_volume_usd: MetricPattern4::new(client.clone(), format!("{base_path}_annualized_volume_usd")), + annualized_volume: _24hCoinbaseSumPattern::new(client.clone(), "annualized_volume".to_string()), inputs_per_sec: MetricPattern4::new(client.clone(), format!("{base_path}_inputs_per_sec")), outputs_per_sec: MetricPattern4::new(client.clone(), format!("{base_path}_outputs_per_sec")), - sent_sum: ActiveSupplyPattern::new(client.clone(), "sent_sum".to_string()), + sent_sum: _24hCoinbaseSumPattern::new(client.clone(), "sent_sum".to_string()), tx_per_sec: MetricPattern4::new(client.clone(), format!("{base_path}_tx_per_sec")), } } diff --git a/crates/brk_computer/src/blocks/difficulty/compute.rs b/crates/brk_computer/src/blocks/difficulty/compute.rs index 8af2963d4..cf49f3a22 100644 --- a/crates/brk_computer/src/blocks/difficulty/compute.rs +++ b/crates/brk_computer/src/blocks/difficulty/compute.rs @@ -13,25 +13,23 @@ impl Vecs { starting_indexes: &ComputeIndexes, exit: &Exit, ) -> Result<()> { - let mut height_to_difficultyepoch_iter = - indexes.height.difficultyepoch.into_iter(); - self.difficultyepoch - .compute_all(starting_indexes, exit, |vec| { - let mut height_count_iter = indexes.dateindex.height_count.into_iter(); - vec.compute_transform( - starting_indexes.dateindex, - &indexes.dateindex.first_height, - |(di, height, ..)| { - ( - di, - height_to_difficultyepoch_iter - .get_unwrap(height + (*height_count_iter.get_unwrap(di) - 1)), - ) - }, - exit, - )?; - Ok(()) - })?; + let mut height_to_difficultyepoch_iter = indexes.height.difficultyepoch.into_iter(); + self.epoch.compute_all(starting_indexes, exit, |vec| { + let mut height_count_iter = indexes.dateindex.height_count.into_iter(); + vec.compute_transform( + starting_indexes.dateindex, + &indexes.dateindex.first_height, + |(di, height, ..)| { + ( + di, + height_to_difficultyepoch_iter + .get_unwrap(height + (*height_count_iter.get_unwrap(di) - 1)), + ) + }, + exit, + )?; + Ok(()) + })?; self.blocks_before_next_difficulty_adjustment.compute_all( indexes, diff --git a/crates/brk_computer/src/blocks/difficulty/import.rs b/crates/brk_computer/src/blocks/difficulty/import.rs index 6f811c78c..35f6ddd00 100644 --- a/crates/brk_computer/src/blocks/difficulty/import.rs +++ b/crates/brk_computer/src/blocks/difficulty/import.rs @@ -13,12 +13,7 @@ impl Vecs { let v2 = Version::TWO; Ok(Self { - difficultyepoch: ComputedDateLast::forced_import( - db, - "difficultyepoch", - version, - indexes, - )?, + epoch: ComputedDateLast::forced_import(db, "difficultyepoch", version, indexes)?, blocks_before_next_difficulty_adjustment: ComputedBlockLast::forced_import( db, "blocks_before_next_difficulty_adjustment", diff --git a/crates/brk_computer/src/blocks/difficulty/vecs.rs b/crates/brk_computer/src/blocks/difficulty/vecs.rs index 8fd8bf63f..ea407c6dd 100644 --- a/crates/brk_computer/src/blocks/difficulty/vecs.rs +++ b/crates/brk_computer/src/blocks/difficulty/vecs.rs @@ -6,7 +6,7 @@ use crate::internal::{ComputedBlockLast, ComputedDateLast}; /// Difficulty epoch metrics and countdown #[derive(Clone, Traversable)] pub struct Vecs { - pub difficultyepoch: ComputedDateLast, + pub epoch: ComputedDateLast, pub blocks_before_next_difficulty_adjustment: ComputedBlockLast, pub days_before_next_difficulty_adjustment: ComputedBlockLast, } diff --git a/crates/brk_computer/src/blocks/halving/compute.rs b/crates/brk_computer/src/blocks/halving/compute.rs index a60738cf1..fa2c8f3f9 100644 --- a/crates/brk_computer/src/blocks/halving/compute.rs +++ b/crates/brk_computer/src/blocks/halving/compute.rs @@ -14,23 +14,22 @@ impl Vecs { exit: &Exit, ) -> Result<()> { let mut height_to_halvingepoch_iter = indexes.height.halvingepoch.into_iter(); - self.halvingepoch - .compute_all(starting_indexes, exit, |vec| { - let mut height_count_iter = indexes.dateindex.height_count.into_iter(); - vec.compute_transform( - starting_indexes.dateindex, - &indexes.dateindex.first_height, - |(di, height, ..)| { - ( - di, - height_to_halvingepoch_iter - .get_unwrap(height + (*height_count_iter.get_unwrap(di) - 1)), - ) - }, - exit, - )?; - Ok(()) - })?; + self.epoch.compute_all(starting_indexes, exit, |vec| { + let mut height_count_iter = indexes.dateindex.height_count.into_iter(); + vec.compute_transform( + starting_indexes.dateindex, + &indexes.dateindex.first_height, + |(di, height, ..)| { + ( + di, + height_to_halvingepoch_iter + .get_unwrap(height + (*height_count_iter.get_unwrap(di) - 1)), + ) + }, + exit, + )?; + Ok(()) + })?; self.blocks_before_next_halving .compute_all(indexes, starting_indexes, exit, |v| { diff --git a/crates/brk_computer/src/blocks/halving/import.rs b/crates/brk_computer/src/blocks/halving/import.rs index aaf37061e..5db47715d 100644 --- a/crates/brk_computer/src/blocks/halving/import.rs +++ b/crates/brk_computer/src/blocks/halving/import.rs @@ -13,7 +13,7 @@ impl Vecs { let v2 = Version::TWO; Ok(Self { - halvingepoch: ComputedDateLast::forced_import(db, "halvingepoch", version, indexes)?, + epoch: ComputedDateLast::forced_import(db, "halvingepoch", version, indexes)?, blocks_before_next_halving: ComputedBlockLast::forced_import( db, "blocks_before_next_halving", diff --git a/crates/brk_computer/src/blocks/halving/vecs.rs b/crates/brk_computer/src/blocks/halving/vecs.rs index 40555af5b..a1b0c3f36 100644 --- a/crates/brk_computer/src/blocks/halving/vecs.rs +++ b/crates/brk_computer/src/blocks/halving/vecs.rs @@ -6,7 +6,7 @@ use crate::internal::{ComputedBlockLast, ComputedDateLast}; /// Halving epoch metrics and countdown #[derive(Clone, Traversable)] pub struct Vecs { - pub halvingepoch: ComputedDateLast, + pub epoch: ComputedDateLast, pub blocks_before_next_halving: ComputedBlockLast, pub days_before_next_halving: ComputedBlockLast, } diff --git a/crates/brk_computer/src/cointime/activity/compute.rs b/crates/brk_computer/src/cointime/activity/compute.rs index 1f83f2259..26e15fad9 100644 --- a/crates/brk_computer/src/cointime/activity/compute.rs +++ b/crates/brk_computer/src/cointime/activity/compute.rs @@ -18,7 +18,7 @@ impl Vecs { .all .metrics .supply - .supply + .total .sats .height; diff --git a/crates/brk_computer/src/cointime/cap/compute.rs b/crates/brk_computer/src/cointime/cap/compute.rs index 86b71eb27..bc584a20a 100644 --- a/crates/brk_computer/src/cointime/cap/compute.rs +++ b/crates/brk_computer/src/cointime/cap/compute.rs @@ -32,7 +32,7 @@ impl Vecs { .all .metrics .supply - .supply + .total .bitcoin .height; diff --git a/crates/brk_computer/src/cointime/pricing/compute.rs b/crates/brk_computer/src/cointime/pricing/compute.rs index 375f6c923..765507982 100644 --- a/crates/brk_computer/src/cointime/pricing/compute.rs +++ b/crates/brk_computer/src/cointime/pricing/compute.rs @@ -23,7 +23,7 @@ impl Vecs { .all .metrics .supply - .supply + .total .bitcoin .height; let realized_price = &distribution diff --git a/crates/brk_computer/src/cointime/supply/compute.rs b/crates/brk_computer/src/cointime/supply/compute.rs index 53ec97d2e..ae5b05584 100644 --- a/crates/brk_computer/src/cointime/supply/compute.rs +++ b/crates/brk_computer/src/cointime/supply/compute.rs @@ -20,7 +20,7 @@ impl Vecs { .all .metrics .supply - .supply + .total .sats .height; diff --git a/crates/brk_computer/src/distribution/address/address_count.rs b/crates/brk_computer/src/distribution/address/address_count.rs index 61dc0ccf8..25cc1740e 100644 --- a/crates/brk_computer/src/distribution/address/address_count.rs +++ b/crates/brk_computer/src/distribution/address/address_count.rs @@ -225,6 +225,7 @@ impl AddressTypeToAddrCountVecs { #[derive(Clone, Traversable)] pub struct AddrCountVecs { pub all: ComputedBlockLast, + #[traversable(flatten)] pub by_addresstype: AddressTypeToAddrCountVecs, } diff --git a/crates/brk_computer/src/distribution/cohorts/address/vecs.rs b/crates/brk_computer/src/distribution/cohorts/address/vecs.rs index db633f541..813a2435d 100644 --- a/crates/brk_computer/src/distribution/cohorts/address/vecs.rs +++ b/crates/brk_computer/src/distribution/cohorts/address/vecs.rs @@ -8,10 +8,7 @@ use rayon::prelude::*; use vecdb::{AnyStoredVec, AnyVec, Database, Exit, GenericStoredVec, IterableVec}; use crate::{ - ComputeIndexes, - distribution::state::AddressCohortState, - indexes, - internal::ComputedBlockLast, + ComputeIndexes, distribution::state::AddressCohortState, indexes, internal::ComputedBlockLast, price, }; @@ -155,7 +152,7 @@ impl DynCohortVecs for AddressCohortVecs { state.inner.supply.value = self .metrics .supply - .supply + .total .sats .height .read_once(prev_height)?; diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs b/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs index eaa2bc8c5..ee84c6777 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs +++ b/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs @@ -7,7 +7,7 @@ use brk_types::{DateIndex, Dollars, Height, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, Database, Exit, IterableVec}; -use crate::{ComputeIndexes, indexes, price, distribution::state::UTXOCohortState}; +use crate::{ComputeIndexes, distribution::state::UTXOCohortState, indexes, price}; use crate::distribution::metrics::{CohortMetrics, ImportConfig, RealizedMetrics, SupplyMetrics}; @@ -149,7 +149,7 @@ impl DynCohortVecs for UTXOCohortVecs { state.supply.value = self .metrics .supply - .supply + .total .sats .height .read_once(prev_height)?; diff --git a/crates/brk_computer/src/distribution/metrics/mod.rs b/crates/brk_computer/src/distribution/metrics/mod.rs index fc06610fd..c0c03f61f 100644 --- a/crates/brk_computer/src/distribution/metrics/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/mod.rs @@ -92,7 +92,11 @@ impl CohortMetrics { /// Get minimum length across height-indexed vectors written in block loop. pub fn min_stateful_height_len(&self) -> usize { - let mut min = self.supply.min_len().min(self.outputs.min_len()).min(self.activity.min_len()); + let mut min = self + .supply + .min_len() + .min(self.outputs.min_len()) + .min(self.activity.min_len()); if let Some(realized) = &self.realized { min = min.min(realized.min_stateful_height_len()); @@ -124,7 +128,8 @@ impl CohortMetrics { /// Push state values to height-indexed vectors. pub fn truncate_push(&mut self, height: Height, state: &CohortState) -> Result<()> { self.supply.truncate_push(height, state.supply.value)?; - self.outputs.truncate_push(height, state.supply.utxo_count)?; + self.outputs + .truncate_push(height, state.supply.utxo_count)?; self.activity.truncate_push( height, state.sent, @@ -309,8 +314,7 @@ impl CohortMetrics { ) -> Result<()> { self.supply .compute_rest_part1(indexes, price, starting_indexes, exit)?; - self.outputs - .compute_rest(indexes, starting_indexes, exit)?; + self.outputs.compute_rest(indexes, starting_indexes, exit)?; self.activity .compute_rest_part1(indexes, starting_indexes, exit)?; @@ -345,7 +349,7 @@ impl CohortMetrics { indexes, price, starting_indexes, - &self.supply.supply.bitcoin.height, + &self.supply.total.bitcoin.height, height_to_market_cap, dateindex_to_market_cap, exit, diff --git a/crates/brk_computer/src/distribution/metrics/relative.rs b/crates/brk_computer/src/distribution/metrics/relative.rs index 15c7b6cae..ecce33bf5 100644 --- a/crates/brk_computer/src/distribution/metrics/relative.rs +++ b/crates/brk_computer/src/distribution/metrics/relative.rs @@ -77,14 +77,14 @@ impl RelativeMetrics { let compute_rel_to_all = cfg.compute_rel_to_all(); // Global sources from "all" cohort - let global_supply_sats_height = all_supply.map(|s| &s.supply.sats.height); - let global_supply_sats_difficultyepoch = all_supply.map(|s| &s.supply.sats.difficultyepoch); - let global_supply_sats_dates = all_supply.map(|s| &s.supply.sats.rest.dates); - let global_supply_sats_dateindex = all_supply.map(|s| &s.supply.sats.rest.dateindex); - let global_market_cap = all_supply.and_then(|s| s.supply.dollars.as_ref()); + let global_supply_sats_height = all_supply.map(|s| &s.total.sats.height); + let global_supply_sats_difficultyepoch = all_supply.map(|s| &s.total.sats.difficultyepoch); + let global_supply_sats_dates = all_supply.map(|s| &s.total.sats.rest.dates); + let global_supply_sats_dateindex = all_supply.map(|s| &s.total.sats.rest.dateindex); + let global_market_cap = all_supply.and_then(|s| s.total.dollars.as_ref()); // Own market cap source - let own_market_cap = supply.supply.dollars.as_ref(); + let own_market_cap = supply.total.dollars.as_ref(); Ok(Self { // === Supply Relative to Circulating Supply (lazy from global supply) === @@ -94,8 +94,8 @@ impl RelativeMetrics { LazyBinaryDateLast::from_both_derived_last::( &cfg.name("supply_rel_to_circulating_supply"), cfg.version + v1, - supply.supply.sats.rest.dateindex.boxed_clone(), - &supply.supply.sats.rest.dates, + supply.total.sats.rest.dateindex.boxed_clone(), + &supply.total.sats.rest.dates, global_supply_sats_dateindex.unwrap().boxed_clone(), global_supply_sats_dates.unwrap(), ) @@ -107,34 +107,34 @@ impl RelativeMetrics { &cfg.name("supply_in_profit_rel_to_own_supply"), cfg.version + v1, unrealized.supply_in_profit.height.boxed_clone(), - supply.supply.sats.height.boxed_clone(), - unrealized.supply_in_profit.difficultyepoch.boxed_clone(), - supply.supply.sats.difficultyepoch.boxed_clone(), + supply.total.sats.height.boxed_clone(), + unrealized.supply_in_profit.difficultyepoch.sats.boxed_clone(), + supply.total.sats.difficultyepoch.boxed_clone(), unrealized .supply_in_profit .indexes .sats_dateindex .boxed_clone(), &unrealized.supply_in_profit.indexes.sats, - supply.supply.sats.rest.dateindex.boxed_clone(), - &supply.supply.sats.rest.dates, + supply.total.sats.rest.dateindex.boxed_clone(), + &supply.total.sats.rest.dates, ), supply_in_loss_rel_to_own_supply: LazyBinaryBlockLast::from_height_difficultyepoch_dates::( &cfg.name("supply_in_loss_rel_to_own_supply"), cfg.version + v1, unrealized.supply_in_loss.height.boxed_clone(), - supply.supply.sats.height.boxed_clone(), - unrealized.supply_in_loss.difficultyepoch.boxed_clone(), - supply.supply.sats.difficultyepoch.boxed_clone(), + supply.total.sats.height.boxed_clone(), + unrealized.supply_in_loss.difficultyepoch.sats.boxed_clone(), + supply.total.sats.difficultyepoch.boxed_clone(), unrealized .supply_in_loss .indexes .sats_dateindex .boxed_clone(), &unrealized.supply_in_loss.indexes.sats, - supply.supply.sats.rest.dateindex.boxed_clone(), - &supply.supply.sats.rest.dates, + supply.total.sats.rest.dateindex.boxed_clone(), + &supply.total.sats.rest.dates, ), // === Supply in Profit/Loss Relative to Circulating Supply (lazy from global supply) === @@ -146,7 +146,7 @@ impl RelativeMetrics { cfg.version + v1, unrealized.supply_in_profit.height.boxed_clone(), global_supply_sats_height.unwrap().boxed_clone(), - unrealized.supply_in_profit.difficultyepoch.boxed_clone(), + unrealized.supply_in_profit.difficultyepoch.sats.boxed_clone(), global_supply_sats_difficultyepoch.unwrap().boxed_clone(), unrealized .supply_in_profit @@ -166,7 +166,7 @@ impl RelativeMetrics { cfg.version + v1, unrealized.supply_in_loss.height.boxed_clone(), global_supply_sats_height.unwrap().boxed_clone(), - unrealized.supply_in_loss.difficultyepoch.boxed_clone(), + unrealized.supply_in_loss.difficultyepoch.sats.boxed_clone(), global_supply_sats_difficultyepoch.unwrap().boxed_clone(), unrealized .supply_in_loss diff --git a/crates/brk_computer/src/distribution/metrics/supply.rs b/crates/brk_computer/src/distribution/metrics/supply.rs index ccaba7231..1fc03c3fe 100644 --- a/crates/brk_computer/src/distribution/metrics/supply.rs +++ b/crates/brk_computer/src/distribution/metrics/supply.rs @@ -4,13 +4,13 @@ use brk_types::{Height, Sats, Version}; use crate::ComputeIndexes; use rayon::prelude::*; -use vecdb::{AnyStoredVec, AnyVec, Exit, GenericStoredVec, IterableCloneableVec}; +use vecdb::{AnyStoredVec, AnyVec, Exit, GenericStoredVec}; use crate::{ indexes, internal::{ - HalfClosePriceTimesSats, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyBlockValue, - LazyValueDateLast, ValueBlockLast, + HalfClosePriceTimesSats, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyBinaryLastBlockValue, + ValueBlockLast, }, price, }; @@ -20,9 +20,8 @@ use super::ImportConfig; /// Supply metrics for a cohort. #[derive(Clone, Traversable)] pub struct SupplyMetrics { - pub supply: ValueBlockLast, - pub supply_half_value: LazyBlockValue, - pub supply_half: LazyValueDateLast, + pub total: ValueBlockLast, + pub halved: LazyBinaryLastBlockValue, } impl SupplyMetrics { @@ -38,52 +37,39 @@ impl SupplyMetrics { compute_dollars, )?; - let price_source = cfg - .price - .map(|p| p.usd.split.close.height.boxed_clone()); - - // Create lazy supply_half from supply sources - let supply_half_value = - LazyBlockValue::from_sources::( - &cfg.name("supply_half"), - supply.sats.height.boxed_clone(), - price_source, - cfg.version, - ); - - let supply_half = LazyValueDateLast::from_block_source::< + let supply_half = LazyBinaryLastBlockValue::from_block_source::< HalveSats, HalveSatsToBitcoin, + HalfClosePriceTimesSats, HalveDollars, - >(&cfg.name("supply_half"), &supply, cfg.version); + >(&cfg.name("supply_half"), &supply, cfg.price, cfg.version); Ok(Self { - supply, - supply_half_value, - supply_half, + total: supply, + halved: supply_half, }) } /// Get minimum length across height-indexed vectors. pub fn min_len(&self) -> usize { - self.supply.sats.height.len() + self.total.sats.height.len() } /// Push supply state values to height-indexed vectors. pub fn truncate_push(&mut self, height: Height, supply: Sats) -> Result<()> { - self.supply.sats.height.truncate_push(height, supply)?; + self.total.sats.height.truncate_push(height, supply)?; Ok(()) } /// Write height-indexed vectors to disk. pub fn write(&mut self) -> Result<()> { - self.supply.sats.height.write()?; + self.total.sats.height.write()?; Ok(()) } /// Returns a parallel iterator over all vecs for parallel writing. pub fn par_iter_mut(&mut self) -> impl ParallelIterator { - vec![&mut self.supply.sats.height as &mut dyn AnyStoredVec].into_par_iter() + vec![&mut self.total.sats.height as &mut dyn AnyStoredVec].into_par_iter() } /// Validate computed versions against base version. @@ -99,11 +85,11 @@ impl SupplyMetrics { others: &[&Self], exit: &Exit, ) -> Result<()> { - self.supply.sats.height.compute_sum_of_others( + self.total.sats.height.compute_sum_of_others( starting_indexes.height, &others .iter() - .map(|v| &v.supply.sats.height) + .map(|v| &v.total.sats.height) .collect::>(), exit, )?; @@ -118,7 +104,7 @@ impl SupplyMetrics { starting_indexes: &ComputeIndexes, exit: &Exit, ) -> Result<()> { - self.supply + self.total .compute_rest(indexes, price, starting_indexes, exit) } } diff --git a/crates/brk_computer/src/distribution/vecs.rs b/crates/brk_computer/src/distribution/vecs.rs index ba75d7a1b..f7c93da3a 100644 --- a/crates/brk_computer/src/distribution/vecs.rs +++ b/crates/brk_computer/src/distribution/vecs.rs @@ -297,13 +297,13 @@ impl Vecs { let supply_metrics = &self.utxo_cohorts.all.metrics.supply; let height_to_market_cap = supply_metrics - .supply + .total .dollars .as_ref() .map(|d| d.height.clone()); let dateindex_to_market_cap = supply_metrics - .supply + .total .dollars .as_ref() .map(|d| d.dateindex.0.clone()); @@ -373,16 +373,10 @@ fn adjust_for_dateindex_gap( } // Get the dateindex at the height we want to resume at - let required_dateindex: usize = indexes - .height - .dateindex - .read_once(height_based_min)? - .into(); + let required_dateindex: usize = indexes.height.dateindex.read_once(height_based_min)?.into(); // If dateindex vecs are behind, restart from first height of the missing day - if dateindex_min < required_dateindex - && dateindex_min < indexes.dateindex.first_height.len() - { + if dateindex_min < required_dateindex && dateindex_min < indexes.dateindex.first_height.len() { Ok(indexes .dateindex .first_height diff --git a/crates/brk_computer/src/internal/computed/block/lazy_sum_cum.rs b/crates/brk_computer/src/internal/computed/block/lazy_sum_cum.rs index bb2a5468c..912393098 100644 --- a/crates/brk_computer/src/internal/computed/block/lazy_sum_cum.rs +++ b/crates/brk_computer/src/internal/computed/block/lazy_sum_cum.rs @@ -29,7 +29,7 @@ where S1T: ComputedVecValue, S2T: ComputedVecValue, { - #[traversable(wrap = "sum")] + #[traversable(rename = "sum")] pub height: LazyVecFrom2, #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/internal/computed/block/sum_cum.rs b/crates/brk_computer/src/internal/computed/block/sum_cum.rs index dc2a431c3..fe648d754 100644 --- a/crates/brk_computer/src/internal/computed/block/sum_cum.rs +++ b/crates/brk_computer/src/internal/computed/block/sum_cum.rs @@ -21,7 +21,7 @@ pub struct ComputedBlockSumCum where T: ComputedVecValue + PartialOrd + JsonSchema, { - #[traversable(wrap = "sum")] + #[traversable(rename = "sum")] pub height: EagerVec>, #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/internal/lazy/block/binary_sum.rs b/crates/brk_computer/src/internal/lazy/block/binary_sum.rs index 7c8af0aaf..f5058908f 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_sum.rs +++ b/crates/brk_computer/src/internal/lazy/block/binary_sum.rs @@ -20,7 +20,7 @@ where S1T: ComputedVecValue, S2T: ComputedVecValue, { - #[traversable(wrap = "sum")] + #[traversable(rename = "sum")] pub height: LazyVecFrom2, #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/internal/lazy/block/binary_sum_cum.rs b/crates/brk_computer/src/internal/lazy/block/binary_sum_cum.rs index e44da0247..ec5b2a0ff 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_sum_cum.rs +++ b/crates/brk_computer/src/internal/lazy/block/binary_sum_cum.rs @@ -21,7 +21,7 @@ where S1T: ComputedVecValue, S2T: ComputedVecValue, { - #[traversable(wrap = "sum")] + #[traversable(rename = "sum")] pub height: LazyVecFrom2, #[traversable(rename = "cumulative")] pub height_cumulative: LazyVecFrom2, diff --git a/crates/brk_computer/src/internal/lazy/block/sum_cum.rs b/crates/brk_computer/src/internal/lazy/block/sum_cum.rs index 35b1bbcc6..6360012b4 100644 --- a/crates/brk_computer/src/internal/lazy/block/sum_cum.rs +++ b/crates/brk_computer/src/internal/lazy/block/sum_cum.rs @@ -18,7 +18,7 @@ where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, { - #[traversable(wrap = "sum")] + #[traversable(rename = "sum")] pub height: LazyVecFrom1, #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/internal/lazy/transform/last.rs b/crates/brk_computer/src/internal/lazy/transform/last.rs index ae408781a..d222787a6 100644 --- a/crates/brk_computer/src/internal/lazy/transform/last.rs +++ b/crates/brk_computer/src/internal/lazy/transform/last.rs @@ -11,7 +11,7 @@ use vecdb::{ use crate::internal::{ComputedVecValue, LastVec, LazyLast}; #[derive(Clone, Deref, DerefMut, Traversable)] -#[traversable(wrap = "last")] +#[traversable(transparent)] pub struct LazyTransformLast(pub LazyVecFrom1) where I: VecIndex, diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_binary_last.rs b/crates/brk_computer/src/internal/specialized/value/block/lazy_binary_last.rs new file mode 100644 index 000000000..c8d7ea603 --- /dev/null +++ b/crates/brk_computer/src/internal/specialized/value/block/lazy_binary_last.rs @@ -0,0 +1,69 @@ +//! Lazy binary value wrapper combining height (with price) + difficultyepoch + date last transforms. + +use brk_traversable::Traversable; +use brk_types::{Bitcoin, Close, Dollars, Sats, Version}; +use derive_more::{Deref, DerefMut}; +use vecdb::{BinaryTransform, IterableCloneableVec, UnaryTransform}; + +use super::{LazyBlockValue, LazyTransformedValueDifficultyEpoch}; +use crate::internal::LazyValueDateLast; +use crate::{internal::ValueBlockLast, price}; + +const VERSION: Version = Version::ZERO; + +/// Lazy binary value wrapper with height (using price binary transform) + difficultyepoch + date last transforms. +/// +/// Use this when the height-level dollars need a binary transform (e.g., price × sats) +/// rather than a unary transform from existing dollars. +/// +/// No merge at this level - denominations (sats, bitcoin, dollars) stay as separate branches. +/// Each inner field has merge which combines indexes within each denomination. +#[derive(Clone, Deref, DerefMut, Traversable)] +pub struct LazyBinaryLastBlockValue { + #[traversable(flatten)] + pub height: LazyBlockValue, + #[traversable(flatten)] + pub difficultyepoch: LazyTransformedValueDifficultyEpoch, + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub dates: LazyValueDateLast, +} + +impl LazyBinaryLastBlockValue { + pub fn from_block_source( + name: &str, + source: &ValueBlockLast, + price: Option<&price::Vecs>, + version: Version, + ) -> Self + where + SatsTransform: UnaryTransform, + BitcoinTransform: UnaryTransform, + HeightDollarsTransform: BinaryTransform, Sats, Dollars>, + DateDollarsTransform: UnaryTransform, + { + let v = version + VERSION; + + let price_source = price.map(|p| p.usd.split.close.height.boxed_clone()); + + let height = LazyBlockValue::from_sources::( + name, + source.sats.height.boxed_clone(), + price_source, + v, + ); + + let difficultyepoch = LazyTransformedValueDifficultyEpoch::from_block_source::< + SatsTransform, + BitcoinTransform, + HeightDollarsTransform, + >(name, source, price, v); + + let dates = LazyValueDateLast::from_block_source::( + name, source, v, + ); + + Self { height, difficultyepoch, dates } + } +} diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_difficultyepoch.rs b/crates/brk_computer/src/internal/specialized/value/block/lazy_difficultyepoch.rs new file mode 100644 index 000000000..503a6c512 --- /dev/null +++ b/crates/brk_computer/src/internal/specialized/value/block/lazy_difficultyepoch.rs @@ -0,0 +1,112 @@ +//! Fully lazy value types for DifficultyEpoch indexing. +//! +//! Two variants exist for different source patterns: +//! - `LazyValueDifficultyEpochFromHeight`: For sources without dollars (computes from price × sats) +//! - `LazyTransformedValueDifficultyEpoch`: For transformed views (e.g., halved supply) + +use brk_traversable::Traversable; +use brk_types::{Bitcoin, Close, DifficultyEpoch, Dollars, Height, Sats, Version}; +use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom1, LazyVecFrom2, UnaryTransform}; + +use crate::internal::{ClosePriceTimesSats, LazyLast, SatsToBitcoin}; +use crate::price; + +const VERSION: Version = Version::ZERO; + +/// Lazy value type at difficultyepoch level - computed from height sats + price. +/// +/// Use this when the source only has height-indexed sats (e.g., ValueBlockDateLast). +/// Dollars are computed via price × sats binary transform. +#[derive(Clone, Traversable)] +pub struct LazyValueDifficultyEpochFromHeight { + pub sats: LazyLast, + pub bitcoin: LazyVecFrom1, + pub dollars: Option, DifficultyEpoch, Sats>>, +} + +impl LazyValueDifficultyEpochFromHeight { + /// Create from height sats source and difficultyepoch identity. + /// Bitcoin is derived from sats. Dollars are computed from price × sats. + pub fn from_height_source( + name: &str, + height_sats: IterableBoxedVec, + difficultyepoch_identity: IterableBoxedVec, + price: Option<&price::Vecs>, + version: Version, + ) -> Self { + let v = version + VERSION; + + let sats = LazyLast::from_source(name, v, height_sats, difficultyepoch_identity); + + let bitcoin = LazyVecFrom1::transformed::( + &format!("{name}_btc"), + v, + sats.boxed_clone(), + ); + + let dollars = price.map(|p| { + LazyVecFrom2::transformed::( + &format!("{name}_usd"), + v, + p.usd.split.close.difficultyepoch.boxed_clone(), + sats.boxed_clone(), + ) + }); + + Self { sats, bitcoin, dollars } + } +} + +/// Lazy value type at difficultyepoch level - transformed from existing difficultyepoch sources. +/// +/// Use this when creating transformed views (e.g., halved supply) from sources that +/// already have difficultyepoch aggregations. Applies transforms to the existing aggregations. +#[derive(Clone, Traversable)] +pub struct LazyTransformedValueDifficultyEpoch { + pub sats: LazyVecFrom1, + pub bitcoin: LazyVecFrom1, + pub dollars: Option, DifficultyEpoch, Sats>>, +} + +impl LazyTransformedValueDifficultyEpoch { + /// Create transformed difficultyepoch values from a ValueBlockLast source. + /// SatsTransform is applied to the source's difficultyepoch sats. + /// BitcoinTransform converts source sats to bitcoin (should combine sats transform + conversion). + /// Dollars are computed from price × transformed sats. + pub fn from_block_source( + name: &str, + source: &super::ValueBlockLast, + price: Option<&price::Vecs>, + version: Version, + ) -> Self + where + SatsTransform: UnaryTransform, + BitcoinTransform: UnaryTransform, + DollarsTransform: BinaryTransform, Sats, Dollars>, + { + let v = version + VERSION; + + let sats = LazyVecFrom1::transformed::( + name, + v, + source.sats.rest.difficultyepoch.boxed_clone(), + ); + + let bitcoin = LazyVecFrom1::transformed::( + &format!("{name}_btc"), + v, + source.sats.rest.difficultyepoch.boxed_clone(), + ); + + let dollars = price.map(|p| { + LazyVecFrom2::transformed::( + &format!("{name}_usd"), + v, + p.usd.split.close.difficultyepoch.boxed_clone(), + source.sats.rest.difficultyepoch.boxed_clone(), + ) + }); + + Self { sats, bitcoin, dollars } + } +} diff --git a/crates/brk_computer/src/internal/specialized/value/block/mod.rs b/crates/brk_computer/src/internal/specialized/value/block/mod.rs index dfc09018d..6049dd258 100644 --- a/crates/brk_computer/src/internal/specialized/value/block/mod.rs +++ b/crates/brk_computer/src/internal/specialized/value/block/mod.rs @@ -3,8 +3,10 @@ mod full; mod height; mod last; mod lazy; +mod lazy_binary_last; mod lazy_computed_sum_cum; mod lazy_derived; +mod lazy_difficultyepoch; mod lazy_height; mod lazy_last; mod lazy_sum_cum; @@ -16,8 +18,10 @@ pub use full::*; pub use height::*; pub use last::*; pub use lazy::*; +pub use lazy_binary_last::*; pub use lazy_computed_sum_cum::*; pub use lazy_derived::*; +pub use lazy_difficultyepoch::*; pub use lazy_height::*; pub use lazy_last::*; pub use lazy_sum_cum::*; diff --git a/crates/brk_computer/src/internal/specialized/value/date/block_date_last.rs b/crates/brk_computer/src/internal/specialized/value/date/block_date_last.rs index dfff0d365..2afb415bc 100644 --- a/crates/brk_computer/src/internal/specialized/value/date/block_date_last.rs +++ b/crates/brk_computer/src/internal/specialized/value/date/block_date_last.rs @@ -5,26 +5,26 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{DifficultyEpoch, Height, Sats, Version}; +use brk_types::{Height, Sats, Version}; use derive_more::{Deref, DerefMut}; use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVec}; use crate::{ComputeIndexes, indexes, price}; -use super::super::block::LazyDerivedBlockValue; +use super::super::block::{LazyDerivedBlockValue, LazyValueDifficultyEpochFromHeight}; use super::ValueDateLast; -use crate::internal::LazyLast; /// Value type where both height and dateindex are stored independently. /// Dateindex values cannot be derived from height (e.g., unrealized P&L). #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct ValueBlockDateLast { - #[traversable(wrap = "sats")] + #[traversable(rename = "sats")] pub height: EagerVec>, #[traversable(flatten)] pub height_value: LazyDerivedBlockValue, - pub difficultyepoch: LazyLast, + #[traversable(flatten)] + pub difficultyepoch: LazyValueDifficultyEpochFromHeight, #[deref] #[deref_mut] #[traversable(flatten)] @@ -51,11 +51,12 @@ impl ValueBlockDateLast { let height_value = LazyDerivedBlockValue::from_source(name, height.boxed_clone(), v, price_source); - let difficultyepoch = LazyLast::from_source( + let difficultyepoch = LazyValueDifficultyEpochFromHeight::from_height_source( name, - v, height.boxed_clone(), indexes.difficultyepoch.identity.boxed_clone(), + price, + v, ); let indexes = ValueDateLast::forced_import(db, name, v, compute_dollars, indexes)?; diff --git a/crates/brk_computer/src/internal/specialized/value/tx/full.rs b/crates/brk_computer/src/internal/specialized/value/tx/full.rs index 775fac96e..bfc6e25b2 100644 --- a/crates/brk_computer/src/internal/specialized/value/tx/full.rs +++ b/crates/brk_computer/src/internal/specialized/value/tx/full.rs @@ -14,9 +14,8 @@ use super::ValueDerivedTxFull; const VERSION: Version = Version::ZERO; #[derive(Clone, Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct ValueTxFull { - #[traversable(wrap = "sats")] + #[traversable(rename = "txindex")] pub base: EagerVec>, #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/market/indicators/compute.rs b/crates/brk_computer/src/market/indicators/compute.rs index 6427bc90d..d8e6318f9 100644 --- a/crates/brk_computer/src/market/indicators/compute.rs +++ b/crates/brk_computer/src/market/indicators/compute.rs @@ -153,7 +153,7 @@ impl Vecs { let supply_vecs: Vec<_> = amount_range .iter() - .map(|c| &c.metrics.supply.supply.sats.dateindex.0) + .map(|c| &c.metrics.supply.total.sats.dateindex.0) .collect(); let count_vecs: Vec<_> = amount_range .iter() diff --git a/crates/brk_computer/src/market/indicators/import.rs b/crates/brk_computer/src/market/indicators/import.rs index bce0769bc..7d507f60a 100644 --- a/crates/brk_computer/src/market/indicators/import.rs +++ b/crates/brk_computer/src/market/indicators/import.rs @@ -29,7 +29,7 @@ impl Vecs { .all .metrics .supply - .supply + .total .dollars .as_ref() .zip(transactions.volume.sent_sum.dollars.as_ref()) diff --git a/crates/brk_computer/src/supply/circulating/import.rs b/crates/brk_computer/src/supply/circulating/import.rs index 21c0d05d7..ed138d3df 100644 --- a/crates/brk_computer/src/supply/circulating/import.rs +++ b/crates/brk_computer/src/supply/circulating/import.rs @@ -13,6 +13,8 @@ impl Vecs { Self(LazyLastBlockValue::from_block_source::< SatsIdentity, DollarsIdentity, - >("circulating_supply", &supply_metrics.supply, version)) + >( + "circulating_supply", &supply_metrics.total, version) + ) } } diff --git a/crates/brk_computer/src/supply/inflation/compute.rs b/crates/brk_computer/src/supply/inflation/compute.rs index 21a569ae4..8796822fa 100644 --- a/crates/brk_computer/src/supply/inflation/compute.rs +++ b/crates/brk_computer/src/supply/inflation/compute.rs @@ -13,7 +13,7 @@ impl Vecs { exit: &Exit, ) -> Result<()> { // inflation = daily_subsidy / circulating_supply * 365 * 100 - let circulating_supply = &distribution.utxo_cohorts.all.metrics.supply.supply.sats; + let circulating_supply = &distribution.utxo_cohorts.all.metrics.supply.total.sats; self.compute_all(starting_indexes, exit, |v| { v.compute_transform2( diff --git a/crates/brk_computer/src/supply/market_cap/import.rs b/crates/brk_computer/src/supply/market_cap/import.rs index 605252e46..a7177a540 100644 --- a/crates/brk_computer/src/supply/market_cap/import.rs +++ b/crates/brk_computer/src/supply/market_cap/import.rs @@ -2,13 +2,16 @@ use brk_types::Version; use vecdb::IterableCloneableVec; use super::Vecs; -use crate::{distribution, internal::{DollarsIdentity, LazyBlockLast}}; +use crate::{ + distribution, + internal::{DollarsIdentity, LazyBlockLast}, +}; impl Vecs { pub fn import(version: Version, distribution: &distribution::Vecs) -> Option { let supply_metrics = &distribution.utxo_cohorts.all.metrics.supply; - supply_metrics.supply.dollars.as_ref().map(|d| { + supply_metrics.total.dollars.as_ref().map(|d| { Self(LazyBlockLast::from_computed::( "market_cap", version, diff --git a/crates/brk_computer/src/supply/velocity/compute.rs b/crates/brk_computer/src/supply/velocity/compute.rs index e878641e5..046c8475d 100644 --- a/crates/brk_computer/src/supply/velocity/compute.rs +++ b/crates/brk_computer/src/supply/velocity/compute.rs @@ -13,7 +13,7 @@ impl Vecs { exit: &Exit, ) -> Result<()> { // velocity = annualized_volume / circulating_supply - let circulating_supply = &distribution.utxo_cohorts.all.metrics.supply.supply; + let circulating_supply = &distribution.utxo_cohorts.all.metrics.supply.total; // BTC velocity self.btc.compute_all(starting_indexes, exit, |v| { diff --git a/crates/brk_logger/Cargo.toml b/crates/brk_logger/Cargo.toml index d86d9d604..2b4fc4805 100644 --- a/crates/brk_logger/Cargo.toml +++ b/crates/brk_logger/Cargo.toml @@ -14,4 +14,5 @@ logroller = "0.1" owo-colors = "4.2.3" tracing = { workspace = true } tracing-appender = "0.2" +tracing-log = "0.2" tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "env-filter", "std"] } diff --git a/crates/brk_logger/src/lib.rs b/crates/brk_logger/src/lib.rs index cb95a6f18..b219b67ad 100644 --- a/crates/brk_logger/src/lib.rs +++ b/crates/brk_logger/src/lib.rs @@ -86,33 +86,40 @@ impl FieldVisitor { impl tracing::field::Visit for FieldVisitor { fn record_u64(&mut self, field: &Field, value: u64) { - if field.name() == "status" { + let name = field.name(); + if name == "status" { self.status = Some(value); - } else { - let _ = write!(self.result, "{}={} ", field.name(), value); + } else if !name.starts_with("log.") { + let _ = write!(self.result, "{}={} ", name, value); } } fn record_i64(&mut self, field: &Field, value: i64) { - let _ = write!(self.result, "{}={} ", field.name(), value); + let name = field.name(); + if !name.starts_with("log.") { + let _ = write!(self.result, "{}={} ", name, value); + } } fn record_str(&mut self, field: &Field, value: &str) { - if field.name() == "uri" { + let name = field.name(); + if name == "uri" { self.uri = Some(value.to_string()); - } else if field.name() == "message" { + } else if name == "message" { let _ = write!(self.result, "{value}"); - } else { - let _ = write!(self.result, "{}={} ", field.name(), value); + } else if !name.starts_with("log.") { + let _ = write!(self.result, "{}={} ", name, value); } } fn record_debug(&mut self, field: &Field, value: &dyn std::fmt::Debug) { - match field.name() { + let name = field.name(); + match name { "uri" => self.uri = Some(format!("{value:?}")), "latency" => self.latency = Some(format!("{value:?}")), "message" => { let _ = write!(self.result, "{value:?}"); } - _ => { let _ = write!(self.result, "{}={:?} ", field.name(), value); } + _ if name.starts_with("log.") => {} + _ => { let _ = write!(self.result, "{}={:?} ", name, value); } } } } @@ -198,6 +205,9 @@ impl tracing::field::Visit for MessageVisitor<'_> { } pub fn init(path: Option<&Path>) -> io::Result<()> { + // Bridge log crate to tracing (for vecdb and other log-based crates) + tracing_log::LogTracer::init().ok(); + #[cfg(debug_assertions)] const DEFAULT_LEVEL: &str = "debug"; #[cfg(not(debug_assertions))] diff --git a/crates/brk_traversable_derive/src/lib.rs b/crates/brk_traversable_derive/src/lib.rs index 23ed8bd48..41dc98707 100644 --- a/crates/brk_traversable_derive/src/lib.rs +++ b/crates/brk_traversable_derive/src/lib.rs @@ -313,10 +313,16 @@ fn generate_field_traversals(infos: &[FieldInfo], merge: bool) -> proc_macro2::T quote! { if let Some(ref nested) = self.#field_name { match nested.to_tree_node() { - brk_traversable::TreeNode::Branch(map) => collected.extend(map), + brk_traversable::TreeNode::Branch(map) => { + for (key, node) in map { + brk_traversable::TreeNode::merge_node(&mut collected, key, node) + .expect("Conflicting values for same key during flatten"); + } + } leaf @ brk_traversable::TreeNode::Leaf(_) => { // Collapsed leaf from child - insert with field name as key - collected.insert(String::from(stringify!(#field_name)), leaf); + brk_traversable::TreeNode::merge_node(&mut collected, String::from(stringify!(#field_name)), leaf) + .expect("Conflicting values for same key during flatten"); } } } @@ -324,10 +330,16 @@ fn generate_field_traversals(infos: &[FieldInfo], merge: bool) -> proc_macro2::T } else { quote! { match self.#field_name.to_tree_node() { - brk_traversable::TreeNode::Branch(map) => collected.extend(map), + brk_traversable::TreeNode::Branch(map) => { + for (key, node) in map { + brk_traversable::TreeNode::merge_node(&mut collected, key, node) + .expect("Conflicting values for same key during flatten"); + } + } leaf @ brk_traversable::TreeNode::Leaf(_) => { // Collapsed leaf from child - insert with field name as key - collected.insert(String::from(stringify!(#field_name)), leaf); + brk_traversable::TreeNode::merge_node(&mut collected, String::from(stringify!(#field_name)), leaf) + .expect("Conflicting values for same key during flatten"); } } } diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 8d0a7ab2e..e29891e00 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -834,7 +834,7 @@ function createMetricPattern5(client, name) { /** * @template T - * @typedef {{ name: string, by: { quarterindex: MetricEndpoint, semesterindex: MetricEndpoint, yearindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern6 + * @typedef {{ name: string, by: { dateindex: MetricEndpoint, height: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern6 */ /** @@ -845,37 +845,6 @@ function createMetricPattern5(client, name) { * @returns {MetricPattern6} */ function createMetricPattern6(client, name) { - return { - name, - by: { - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } - }, - indexes() { - return ['quarterindex', 'semesterindex', 'yearindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { dateindex: MetricEndpoint, height: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern7 - */ - -/** - * Create a MetricPattern7 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern7} - */ -function createMetricPattern7(client, name) { return { name, by: { @@ -895,347 +864,17 @@ function createMetricPattern7(client, name) { /** * @template T - * @typedef {{ name: string, by: { dateindex: MetricEndpoint, monthindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern8 + * @typedef {{ name: string, by: { dateindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern7 */ /** - * Create a MetricPattern8 accessor + * Create a MetricPattern7 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern8} + * @returns {MetricPattern7} */ -function createMetricPattern8(client, name) { - return { - name, - by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); } - }, - indexes() { - return ['dateindex', 'monthindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { dateindex: MetricEndpoint, weekindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern9 - */ - -/** - * Create a MetricPattern9 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern9} - */ -function createMetricPattern9(client, name) { - return { - name, - by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); } - }, - indexes() { - return ['dateindex', 'weekindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { decadeindex: MetricEndpoint, yearindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern10 - */ - -/** - * Create a MetricPattern10 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern10} - */ -function createMetricPattern10(client, name) { - return { - name, - by: { - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } - }, - indexes() { - return ['decadeindex', 'yearindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { difficultyepoch: MetricEndpoint, halvingepoch: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern11 - */ - -/** - * Create a MetricPattern11 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern11} - */ -function createMetricPattern11(client, name) { - return { - name, - by: { - get difficultyepoch() { return _endpoint(client, name, 'difficultyepoch'); }, - get halvingepoch() { return _endpoint(client, name, 'halvingepoch'); } - }, - indexes() { - return ['difficultyepoch', 'halvingepoch']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { difficultyepoch: MetricEndpoint, height: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern12 - */ - -/** - * Create a MetricPattern12 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern12} - */ -function createMetricPattern12(client, name) { - return { - name, - by: { - get difficultyepoch() { return _endpoint(client, name, 'difficultyepoch'); }, - get height() { return _endpoint(client, name, 'height'); } - }, - indexes() { - return ['difficultyepoch', 'height']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { halvingepoch: MetricEndpoint, height: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern13 - */ - -/** - * Create a MetricPattern13 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern13} - */ -function createMetricPattern13(client, name) { - return { - name, - by: { - get halvingepoch() { return _endpoint(client, name, 'halvingepoch'); }, - get height() { return _endpoint(client, name, 'height'); } - }, - indexes() { - return ['halvingepoch', 'height']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { height: MetricEndpoint, txindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern14 - */ - -/** - * Create a MetricPattern14 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern14} - */ -function createMetricPattern14(client, name) { - return { - name, - by: { - get height() { return _endpoint(client, name, 'height'); }, - get txindex() { return _endpoint(client, name, 'txindex'); } - }, - indexes() { - return ['height', 'txindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { monthindex: MetricEndpoint, quarterindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern15 - */ - -/** - * Create a MetricPattern15 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern15} - */ -function createMetricPattern15(client, name) { - return { - name, - by: { - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); } - }, - indexes() { - return ['monthindex', 'quarterindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { monthindex: MetricEndpoint, semesterindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern16 - */ - -/** - * Create a MetricPattern16 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern16} - */ -function createMetricPattern16(client, name) { - return { - name, - by: { - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); } - }, - indexes() { - return ['monthindex', 'semesterindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { monthindex: MetricEndpoint, weekindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern17 - */ - -/** - * Create a MetricPattern17 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern17} - */ -function createMetricPattern17(client, name) { - return { - name, - by: { - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); } - }, - indexes() { - return ['monthindex', 'weekindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { monthindex: MetricEndpoint, yearindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern18 - */ - -/** - * Create a MetricPattern18 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern18} - */ -function createMetricPattern18(client, name) { - return { - name, - by: { - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } - }, - indexes() { - return ['monthindex', 'yearindex']; - }, - get(index) { - if (this.indexes().includes(index)) { - return _endpoint(client, name, index); - } - } - }; -} - -/** - * @template T - * @typedef {{ name: string, by: { dateindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern19 - */ - -/** - * Create a MetricPattern19 accessor - * @template T - * @param {BrkClientBase} client - * @param {string} name - The metric vec name - * @returns {MetricPattern19} - */ -function createMetricPattern19(client, name) { +function createMetricPattern7(client, name) { return { name, by: { @@ -1254,17 +893,17 @@ function createMetricPattern19(client, name) { /** * @template T - * @typedef {{ name: string, by: { decadeindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern20 + * @typedef {{ name: string, by: { decadeindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern8 */ /** - * Create a MetricPattern20 accessor + * Create a MetricPattern8 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern20} + * @returns {MetricPattern8} */ -function createMetricPattern20(client, name) { +function createMetricPattern8(client, name) { return { name, by: { @@ -1283,17 +922,17 @@ function createMetricPattern20(client, name) { /** * @template T - * @typedef {{ name: string, by: { difficultyepoch: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern21 + * @typedef {{ name: string, by: { difficultyepoch: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern9 */ /** - * Create a MetricPattern21 accessor + * Create a MetricPattern9 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern21} + * @returns {MetricPattern9} */ -function createMetricPattern21(client, name) { +function createMetricPattern9(client, name) { return { name, by: { @@ -1312,17 +951,17 @@ function createMetricPattern21(client, name) { /** * @template T - * @typedef {{ name: string, by: { emptyoutputindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern22 + * @typedef {{ name: string, by: { emptyoutputindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern10 */ /** - * Create a MetricPattern22 accessor + * Create a MetricPattern10 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern22} + * @returns {MetricPattern10} */ -function createMetricPattern22(client, name) { +function createMetricPattern10(client, name) { return { name, by: { @@ -1341,17 +980,46 @@ function createMetricPattern22(client, name) { /** * @template T - * @typedef {{ name: string, by: { height: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern23 + * @typedef {{ name: string, by: { halvingepoch: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern11 */ /** - * Create a MetricPattern23 accessor + * Create a MetricPattern11 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern23} + * @returns {MetricPattern11} */ -function createMetricPattern23(client, name) { +function createMetricPattern11(client, name) { + return { + name, + by: { + get halvingepoch() { return _endpoint(client, name, 'halvingepoch'); } + }, + indexes() { + return ['halvingepoch']; + }, + get(index) { + if (this.indexes().includes(index)) { + return _endpoint(client, name, index); + } + } + }; +} + +/** + * @template T + * @typedef {{ name: string, by: { height: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern12 + */ + +/** + * Create a MetricPattern12 accessor + * @template T + * @param {BrkClientBase} client + * @param {string} name - The metric vec name + * @returns {MetricPattern12} + */ +function createMetricPattern12(client, name) { return { name, by: { @@ -1370,17 +1038,17 @@ function createMetricPattern23(client, name) { /** * @template T - * @typedef {{ name: string, by: { txinindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern24 + * @typedef {{ name: string, by: { txinindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern13 */ /** - * Create a MetricPattern24 accessor + * Create a MetricPattern13 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern24} + * @returns {MetricPattern13} */ -function createMetricPattern24(client, name) { +function createMetricPattern13(client, name) { return { name, by: { @@ -1399,17 +1067,46 @@ function createMetricPattern24(client, name) { /** * @template T - * @typedef {{ name: string, by: { opreturnindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern25 + * @typedef {{ name: string, by: { monthindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern14 */ /** - * Create a MetricPattern25 accessor + * Create a MetricPattern14 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern25} + * @returns {MetricPattern14} */ -function createMetricPattern25(client, name) { +function createMetricPattern14(client, name) { + return { + name, + by: { + get monthindex() { return _endpoint(client, name, 'monthindex'); } + }, + indexes() { + return ['monthindex']; + }, + get(index) { + if (this.indexes().includes(index)) { + return _endpoint(client, name, index); + } + } + }; +} + +/** + * @template T + * @typedef {{ name: string, by: { opreturnindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern15 + */ + +/** + * Create a MetricPattern15 accessor + * @template T + * @param {BrkClientBase} client + * @param {string} name - The metric vec name + * @returns {MetricPattern15} + */ +function createMetricPattern15(client, name) { return { name, by: { @@ -1428,17 +1125,17 @@ function createMetricPattern25(client, name) { /** * @template T - * @typedef {{ name: string, by: { txoutindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern26 + * @typedef {{ name: string, by: { txoutindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern16 */ /** - * Create a MetricPattern26 accessor + * Create a MetricPattern16 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern26} + * @returns {MetricPattern16} */ -function createMetricPattern26(client, name) { +function createMetricPattern16(client, name) { return { name, by: { @@ -1457,17 +1154,17 @@ function createMetricPattern26(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2aaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern27 + * @typedef {{ name: string, by: { p2aaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern17 */ /** - * Create a MetricPattern27 accessor + * Create a MetricPattern17 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern27} + * @returns {MetricPattern17} */ -function createMetricPattern27(client, name) { +function createMetricPattern17(client, name) { return { name, by: { @@ -1486,17 +1183,17 @@ function createMetricPattern27(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2msoutputindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern28 + * @typedef {{ name: string, by: { p2msoutputindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern18 */ /** - * Create a MetricPattern28 accessor + * Create a MetricPattern18 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern28} + * @returns {MetricPattern18} */ -function createMetricPattern28(client, name) { +function createMetricPattern18(client, name) { return { name, by: { @@ -1515,17 +1212,17 @@ function createMetricPattern28(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2pk33addressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern29 + * @typedef {{ name: string, by: { p2pk33addressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern19 */ /** - * Create a MetricPattern29 accessor + * Create a MetricPattern19 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern29} + * @returns {MetricPattern19} */ -function createMetricPattern29(client, name) { +function createMetricPattern19(client, name) { return { name, by: { @@ -1544,17 +1241,17 @@ function createMetricPattern29(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2pk65addressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern30 + * @typedef {{ name: string, by: { p2pk65addressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern20 */ /** - * Create a MetricPattern30 accessor + * Create a MetricPattern20 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern30} + * @returns {MetricPattern20} */ -function createMetricPattern30(client, name) { +function createMetricPattern20(client, name) { return { name, by: { @@ -1573,17 +1270,17 @@ function createMetricPattern30(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2pkhaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern31 + * @typedef {{ name: string, by: { p2pkhaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern21 */ /** - * Create a MetricPattern31 accessor + * Create a MetricPattern21 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern31} + * @returns {MetricPattern21} */ -function createMetricPattern31(client, name) { +function createMetricPattern21(client, name) { return { name, by: { @@ -1602,17 +1299,17 @@ function createMetricPattern31(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2shaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern32 + * @typedef {{ name: string, by: { p2shaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern22 */ /** - * Create a MetricPattern32 accessor + * Create a MetricPattern22 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern32} + * @returns {MetricPattern22} */ -function createMetricPattern32(client, name) { +function createMetricPattern22(client, name) { return { name, by: { @@ -1631,17 +1328,17 @@ function createMetricPattern32(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2traddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern33 + * @typedef {{ name: string, by: { p2traddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern23 */ /** - * Create a MetricPattern33 accessor + * Create a MetricPattern23 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern33} + * @returns {MetricPattern23} */ -function createMetricPattern33(client, name) { +function createMetricPattern23(client, name) { return { name, by: { @@ -1660,17 +1357,17 @@ function createMetricPattern33(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2wpkhaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern34 + * @typedef {{ name: string, by: { p2wpkhaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern24 */ /** - * Create a MetricPattern34 accessor + * Create a MetricPattern24 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern34} + * @returns {MetricPattern24} */ -function createMetricPattern34(client, name) { +function createMetricPattern24(client, name) { return { name, by: { @@ -1689,17 +1386,17 @@ function createMetricPattern34(client, name) { /** * @template T - * @typedef {{ name: string, by: { p2wshaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern35 + * @typedef {{ name: string, by: { p2wshaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern25 */ /** - * Create a MetricPattern35 accessor + * Create a MetricPattern25 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern35} + * @returns {MetricPattern25} */ -function createMetricPattern35(client, name) { +function createMetricPattern25(client, name) { return { name, by: { @@ -1718,17 +1415,75 @@ function createMetricPattern35(client, name) { /** * @template T - * @typedef {{ name: string, by: { txindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern36 + * @typedef {{ name: string, by: { quarterindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern26 */ /** - * Create a MetricPattern36 accessor + * Create a MetricPattern26 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern36} + * @returns {MetricPattern26} */ -function createMetricPattern36(client, name) { +function createMetricPattern26(client, name) { + return { + name, + by: { + get quarterindex() { return _endpoint(client, name, 'quarterindex'); } + }, + indexes() { + return ['quarterindex']; + }, + get(index) { + if (this.indexes().includes(index)) { + return _endpoint(client, name, index); + } + } + }; +} + +/** + * @template T + * @typedef {{ name: string, by: { semesterindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern27 + */ + +/** + * Create a MetricPattern27 accessor + * @template T + * @param {BrkClientBase} client + * @param {string} name - The metric vec name + * @returns {MetricPattern27} + */ +function createMetricPattern27(client, name) { + return { + name, + by: { + get semesterindex() { return _endpoint(client, name, 'semesterindex'); } + }, + indexes() { + return ['semesterindex']; + }, + get(index) { + if (this.indexes().includes(index)) { + return _endpoint(client, name, index); + } + } + }; +} + +/** + * @template T + * @typedef {{ name: string, by: { txindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern28 + */ + +/** + * Create a MetricPattern28 accessor + * @template T + * @param {BrkClientBase} client + * @param {string} name - The metric vec name + * @returns {MetricPattern28} + */ +function createMetricPattern28(client, name) { return { name, by: { @@ -1747,17 +1502,17 @@ function createMetricPattern36(client, name) { /** * @template T - * @typedef {{ name: string, by: { unknownoutputindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern37 + * @typedef {{ name: string, by: { unknownoutputindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern29 */ /** - * Create a MetricPattern37 accessor + * Create a MetricPattern29 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern37} + * @returns {MetricPattern29} */ -function createMetricPattern37(client, name) { +function createMetricPattern29(client, name) { return { name, by: { @@ -1776,17 +1531,75 @@ function createMetricPattern37(client, name) { /** * @template T - * @typedef {{ name: string, by: { loadedaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern38 + * @typedef {{ name: string, by: { weekindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern30 */ /** - * Create a MetricPattern38 accessor + * Create a MetricPattern30 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern38} + * @returns {MetricPattern30} */ -function createMetricPattern38(client, name) { +function createMetricPattern30(client, name) { + return { + name, + by: { + get weekindex() { return _endpoint(client, name, 'weekindex'); } + }, + indexes() { + return ['weekindex']; + }, + get(index) { + if (this.indexes().includes(index)) { + return _endpoint(client, name, index); + } + } + }; +} + +/** + * @template T + * @typedef {{ name: string, by: { yearindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern31 + */ + +/** + * Create a MetricPattern31 accessor + * @template T + * @param {BrkClientBase} client + * @param {string} name - The metric vec name + * @returns {MetricPattern31} + */ +function createMetricPattern31(client, name) { + return { + name, + by: { + get yearindex() { return _endpoint(client, name, 'yearindex'); } + }, + indexes() { + return ['yearindex']; + }, + get(index) { + if (this.indexes().includes(index)) { + return _endpoint(client, name, index); + } + } + }; +} + +/** + * @template T + * @typedef {{ name: string, by: { loadedaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern32 + */ + +/** + * Create a MetricPattern32 accessor + * @template T + * @param {BrkClientBase} client + * @param {string} name - The metric vec name + * @returns {MetricPattern32} + */ +function createMetricPattern32(client, name) { return { name, by: { @@ -1805,17 +1618,17 @@ function createMetricPattern38(client, name) { /** * @template T - * @typedef {{ name: string, by: { emptyaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern39 + * @typedef {{ name: string, by: { emptyaddressindex: MetricEndpoint }, indexes: () => Index[], get: (index: Index) => MetricEndpoint|undefined }} MetricPattern33 */ /** - * Create a MetricPattern39 accessor + * Create a MetricPattern33 accessor * @template T * @param {BrkClientBase} client * @param {string} name - The metric vec name - * @returns {MetricPattern39} + * @returns {MetricPattern33} */ -function createMetricPattern39(client, name) { +function createMetricPattern33(client, name) { return { name, by: { @@ -1836,9 +1649,9 @@ function createMetricPattern39(client, name) { /** * @typedef {Object} RealizedPattern3 - * @property {MetricPattern19} adjustedSopr - * @property {MetricPattern19} adjustedSopr30dEma - * @property {MetricPattern19} adjustedSopr7dEma + * @property {MetricPattern7} adjustedSopr + * @property {MetricPattern7} adjustedSopr30dEma + * @property {MetricPattern7} adjustedSopr7dEma * @property {MetricPattern1} adjustedValueCreated * @property {MetricPattern1} adjustedValueDestroyed * @property {MetricPattern4} mvrv @@ -1857,14 +1670,14 @@ function createMetricPattern39(client, name) { * @property {ActivePriceRatioPattern} realizedPriceExtra * @property {BlockCountPattern} realizedProfit * @property {BlockCountPattern} realizedProfitRelToRealizedCap - * @property {MetricPattern19} realizedProfitToLossRatio + * @property {MetricPattern7} realizedProfitToLossRatio * @property {MetricPattern1} realizedValue - * @property {MetricPattern19} sellSideRiskRatio - * @property {MetricPattern19} sellSideRiskRatio30dEma - * @property {MetricPattern19} sellSideRiskRatio7dEma - * @property {MetricPattern19} sopr - * @property {MetricPattern19} sopr30dEma - * @property {MetricPattern19} sopr7dEma + * @property {MetricPattern7} sellSideRiskRatio + * @property {MetricPattern7} sellSideRiskRatio30dEma + * @property {MetricPattern7} sellSideRiskRatio7dEma + * @property {MetricPattern7} sopr + * @property {MetricPattern7} sopr30dEma + * @property {MetricPattern7} sopr7dEma * @property {MetricPattern1} totalRealizedPnl * @property {MetricPattern1} valueCreated * @property {MetricPattern1} valueDestroyed @@ -1878,9 +1691,9 @@ function createMetricPattern39(client, name) { */ function createRealizedPattern3(client, acc) { return { - adjustedSopr: createMetricPattern19(client, _m(acc, 'adjusted_sopr')), - adjustedSopr30dEma: createMetricPattern19(client, _m(acc, 'adjusted_sopr_30d_ema')), - adjustedSopr7dEma: createMetricPattern19(client, _m(acc, 'adjusted_sopr_7d_ema')), + adjustedSopr: createMetricPattern7(client, _m(acc, 'adjusted_sopr')), + adjustedSopr30dEma: createMetricPattern7(client, _m(acc, 'adjusted_sopr_30d_ema')), + adjustedSopr7dEma: createMetricPattern7(client, _m(acc, 'adjusted_sopr_7d_ema')), adjustedValueCreated: createMetricPattern1(client, _m(acc, 'adjusted_value_created')), adjustedValueDestroyed: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed')), mvrv: createMetricPattern4(client, _m(acc, 'mvrv')), @@ -1899,14 +1712,14 @@ function createRealizedPattern3(client, acc) { realizedPriceExtra: createActivePriceRatioPattern(client, _m(acc, 'realized_price_ratio')), realizedProfit: createBlockCountPattern(client, _m(acc, 'realized_profit')), realizedProfitRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), - realizedProfitToLossRatio: createMetricPattern19(client, _m(acc, 'realized_profit_to_loss_ratio')), + realizedProfitToLossRatio: createMetricPattern7(client, _m(acc, 'realized_profit_to_loss_ratio')), realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - sellSideRiskRatio: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio30dEma: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7dEma: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), - sopr: createMetricPattern19(client, _m(acc, 'sopr')), - sopr30dEma: createMetricPattern19(client, _m(acc, 'sopr_30d_ema')), - sopr7dEma: createMetricPattern19(client, _m(acc, 'sopr_7d_ema')), + sellSideRiskRatio: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio')), + sellSideRiskRatio30dEma: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), + sellSideRiskRatio7dEma: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), + sopr: createMetricPattern7(client, _m(acc, 'sopr')), + sopr30dEma: createMetricPattern7(client, _m(acc, 'sopr_30d_ema')), + sopr7dEma: createMetricPattern7(client, _m(acc, 'sopr_7d_ema')), totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), @@ -1915,9 +1728,9 @@ function createRealizedPattern3(client, acc) { /** * @typedef {Object} RealizedPattern4 - * @property {MetricPattern19} adjustedSopr - * @property {MetricPattern19} adjustedSopr30dEma - * @property {MetricPattern19} adjustedSopr7dEma + * @property {MetricPattern7} adjustedSopr + * @property {MetricPattern7} adjustedSopr30dEma + * @property {MetricPattern7} adjustedSopr7dEma * @property {MetricPattern1} adjustedValueCreated * @property {MetricPattern1} adjustedValueDestroyed * @property {MetricPattern4} mvrv @@ -1936,12 +1749,12 @@ function createRealizedPattern3(client, acc) { * @property {BlockCountPattern} realizedProfit * @property {BlockCountPattern} realizedProfitRelToRealizedCap * @property {MetricPattern1} realizedValue - * @property {MetricPattern19} sellSideRiskRatio - * @property {MetricPattern19} sellSideRiskRatio30dEma - * @property {MetricPattern19} sellSideRiskRatio7dEma - * @property {MetricPattern19} sopr - * @property {MetricPattern19} sopr30dEma - * @property {MetricPattern19} sopr7dEma + * @property {MetricPattern7} sellSideRiskRatio + * @property {MetricPattern7} sellSideRiskRatio30dEma + * @property {MetricPattern7} sellSideRiskRatio7dEma + * @property {MetricPattern7} sopr + * @property {MetricPattern7} sopr30dEma + * @property {MetricPattern7} sopr7dEma * @property {MetricPattern1} totalRealizedPnl * @property {MetricPattern1} valueCreated * @property {MetricPattern1} valueDestroyed @@ -1955,9 +1768,9 @@ function createRealizedPattern3(client, acc) { */ function createRealizedPattern4(client, acc) { return { - adjustedSopr: createMetricPattern19(client, _m(acc, 'adjusted_sopr')), - adjustedSopr30dEma: createMetricPattern19(client, _m(acc, 'adjusted_sopr_30d_ema')), - adjustedSopr7dEma: createMetricPattern19(client, _m(acc, 'adjusted_sopr_7d_ema')), + adjustedSopr: createMetricPattern7(client, _m(acc, 'adjusted_sopr')), + adjustedSopr30dEma: createMetricPattern7(client, _m(acc, 'adjusted_sopr_30d_ema')), + adjustedSopr7dEma: createMetricPattern7(client, _m(acc, 'adjusted_sopr_7d_ema')), adjustedValueCreated: createMetricPattern1(client, _m(acc, 'adjusted_value_created')), adjustedValueDestroyed: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed')), mvrv: createMetricPattern4(client, _m(acc, 'mvrv')), @@ -1976,12 +1789,12 @@ function createRealizedPattern4(client, acc) { realizedProfit: createBlockCountPattern(client, _m(acc, 'realized_profit')), realizedProfitRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - sellSideRiskRatio: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio30dEma: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7dEma: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), - sopr: createMetricPattern19(client, _m(acc, 'sopr')), - sopr30dEma: createMetricPattern19(client, _m(acc, 'sopr_30d_ema')), - sopr7dEma: createMetricPattern19(client, _m(acc, 'sopr_7d_ema')), + sellSideRiskRatio: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio')), + sellSideRiskRatio30dEma: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), + sellSideRiskRatio7dEma: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), + sopr: createMetricPattern7(client, _m(acc, 'sopr')), + sopr30dEma: createMetricPattern7(client, _m(acc, 'sopr_30d_ema')), + sopr7dEma: createMetricPattern7(client, _m(acc, 'sopr_7d_ema')), totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), @@ -2077,14 +1890,14 @@ function createRatio1ySdPattern(client, acc) { * @property {ActivePriceRatioPattern} realizedPriceExtra * @property {BlockCountPattern} realizedProfit * @property {BlockCountPattern} realizedProfitRelToRealizedCap - * @property {MetricPattern19} realizedProfitToLossRatio + * @property {MetricPattern7} realizedProfitToLossRatio * @property {MetricPattern1} realizedValue - * @property {MetricPattern19} sellSideRiskRatio - * @property {MetricPattern19} sellSideRiskRatio30dEma - * @property {MetricPattern19} sellSideRiskRatio7dEma - * @property {MetricPattern19} sopr - * @property {MetricPattern19} sopr30dEma - * @property {MetricPattern19} sopr7dEma + * @property {MetricPattern7} sellSideRiskRatio + * @property {MetricPattern7} sellSideRiskRatio30dEma + * @property {MetricPattern7} sellSideRiskRatio7dEma + * @property {MetricPattern7} sopr + * @property {MetricPattern7} sopr30dEma + * @property {MetricPattern7} sopr7dEma * @property {MetricPattern1} totalRealizedPnl * @property {MetricPattern1} valueCreated * @property {MetricPattern1} valueDestroyed @@ -2114,14 +1927,14 @@ function createRealizedPattern2(client, acc) { realizedPriceExtra: createActivePriceRatioPattern(client, _m(acc, 'realized_price_ratio')), realizedProfit: createBlockCountPattern(client, _m(acc, 'realized_profit')), realizedProfitRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), - realizedProfitToLossRatio: createMetricPattern19(client, _m(acc, 'realized_profit_to_loss_ratio')), + realizedProfitToLossRatio: createMetricPattern7(client, _m(acc, 'realized_profit_to_loss_ratio')), realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - sellSideRiskRatio: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio30dEma: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7dEma: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), - sopr: createMetricPattern19(client, _m(acc, 'sopr')), - sopr30dEma: createMetricPattern19(client, _m(acc, 'sopr_30d_ema')), - sopr7dEma: createMetricPattern19(client, _m(acc, 'sopr_7d_ema')), + sellSideRiskRatio: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio')), + sellSideRiskRatio30dEma: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), + sellSideRiskRatio7dEma: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), + sopr: createMetricPattern7(client, _m(acc, 'sopr')), + sopr30dEma: createMetricPattern7(client, _m(acc, 'sopr_30d_ema')), + sopr7dEma: createMetricPattern7(client, _m(acc, 'sopr_7d_ema')), totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), @@ -2146,12 +1959,12 @@ function createRealizedPattern2(client, acc) { * @property {BlockCountPattern} realizedProfit * @property {BlockCountPattern} realizedProfitRelToRealizedCap * @property {MetricPattern1} realizedValue - * @property {MetricPattern19} sellSideRiskRatio - * @property {MetricPattern19} sellSideRiskRatio30dEma - * @property {MetricPattern19} sellSideRiskRatio7dEma - * @property {MetricPattern19} sopr - * @property {MetricPattern19} sopr30dEma - * @property {MetricPattern19} sopr7dEma + * @property {MetricPattern7} sellSideRiskRatio + * @property {MetricPattern7} sellSideRiskRatio30dEma + * @property {MetricPattern7} sellSideRiskRatio7dEma + * @property {MetricPattern7} sopr + * @property {MetricPattern7} sopr30dEma + * @property {MetricPattern7} sopr7dEma * @property {MetricPattern1} totalRealizedPnl * @property {MetricPattern1} valueCreated * @property {MetricPattern1} valueDestroyed @@ -2181,12 +1994,12 @@ function createRealizedPattern(client, acc) { realizedProfit: createBlockCountPattern(client, _m(acc, 'realized_profit')), realizedProfitRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - sellSideRiskRatio: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio30dEma: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7dEma: createMetricPattern19(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), - sopr: createMetricPattern19(client, _m(acc, 'sopr')), - sopr30dEma: createMetricPattern19(client, _m(acc, 'sopr_30d_ema')), - sopr7dEma: createMetricPattern19(client, _m(acc, 'sopr_7d_ema')), + sellSideRiskRatio: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio')), + sellSideRiskRatio30dEma: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), + sellSideRiskRatio7dEma: createMetricPattern7(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), + sopr: createMetricPattern7(client, _m(acc, 'sopr')), + sopr30dEma: createMetricPattern7(client, _m(acc, 'sopr_30d_ema')), + sopr7dEma: createMetricPattern7(client, _m(acc, 'sopr_7d_ema')), totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), @@ -2356,24 +2169,24 @@ function createPercentilesPattern2(client, acc) { /** * @typedef {Object} RelativePattern5 - * @property {MetricPattern3} negUnrealizedLossRelToMarketCap - * @property {MetricPattern3} negUnrealizedLossRelToOwnMarketCap - * @property {MetricPattern3} negUnrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern3} netUnrealizedPnlRelToMarketCap - * @property {MetricPattern3} netUnrealizedPnlRelToOwnMarketCap - * @property {MetricPattern3} netUnrealizedPnlRelToOwnTotalUnrealizedPnl - * @property {MetricPattern4} nupl - * @property {MetricPattern3} supplyInLossRelToCirculatingSupply - * @property {MetricPattern3} supplyInLossRelToOwnSupply - * @property {MetricPattern3} supplyInProfitRelToCirculatingSupply - * @property {MetricPattern3} supplyInProfitRelToOwnSupply + * @property {MetricPattern1} negUnrealizedLossRelToMarketCap + * @property {MetricPattern1} negUnrealizedLossRelToOwnMarketCap + * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} netUnrealizedPnlRelToMarketCap + * @property {MetricPattern1} netUnrealizedPnlRelToOwnMarketCap + * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} nupl + * @property {MetricPattern1} supplyInLossRelToCirculatingSupply + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToCirculatingSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply * @property {MetricPattern4} supplyRelToCirculatingSupply - * @property {MetricPattern3} unrealizedLossRelToMarketCap - * @property {MetricPattern3} unrealizedLossRelToOwnMarketCap - * @property {MetricPattern3} unrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern3} unrealizedProfitRelToMarketCap - * @property {MetricPattern3} unrealizedProfitRelToOwnMarketCap - * @property {MetricPattern3} unrealizedProfitRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} unrealizedLossRelToMarketCap + * @property {MetricPattern1} unrealizedLossRelToOwnMarketCap + * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} unrealizedProfitRelToMarketCap + * @property {MetricPattern1} unrealizedProfitRelToOwnMarketCap + * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl */ /** @@ -2384,24 +2197,24 @@ function createPercentilesPattern2(client, acc) { */ function createRelativePattern5(client, acc) { return { - negUnrealizedLossRelToMarketCap: createMetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), - negUnrealizedLossRelToOwnMarketCap: createMetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), - negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')), - netUnrealizedPnlRelToMarketCap: createMetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), - netUnrealizedPnlRelToOwnMarketCap: createMetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), - netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')), - nupl: createMetricPattern4(client, _m(acc, 'nupl')), - supplyInLossRelToCirculatingSupply: createMetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), - supplyInLossRelToOwnSupply: createMetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToCirculatingSupply: createMetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), + negUnrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), + negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), + negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')), + netUnrealizedPnlRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), + netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), + netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')), + nupl: createMetricPattern1(client, _m(acc, 'nupl')), + supplyInLossRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), + supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), + supplyInProfitRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), + supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), supplyRelToCirculatingSupply: createMetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')), - unrealizedLossRelToMarketCap: createMetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), - unrealizedLossRelToOwnMarketCap: createMetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), - unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')), - unrealizedProfitRelToMarketCap: createMetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), - unrealizedProfitRelToOwnMarketCap: createMetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), - unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')), + unrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), + unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), + unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')), + unrealizedProfitRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), + unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), + unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')), }; } @@ -2493,18 +2306,18 @@ function createPriceAgoPattern(client, acc) { /** * @typedef {Object} PeriodLumpSumStackPattern - * @property {ActiveSupplyPattern} _10y - * @property {ActiveSupplyPattern} _1m - * @property {ActiveSupplyPattern} _1w - * @property {ActiveSupplyPattern} _1y - * @property {ActiveSupplyPattern} _2y - * @property {ActiveSupplyPattern} _3m - * @property {ActiveSupplyPattern} _3y - * @property {ActiveSupplyPattern} _4y - * @property {ActiveSupplyPattern} _5y - * @property {ActiveSupplyPattern} _6m - * @property {ActiveSupplyPattern} _6y - * @property {ActiveSupplyPattern} _8y + * @property {_24hCoinbaseSumPattern} _10y + * @property {_24hCoinbaseSumPattern} _1m + * @property {_24hCoinbaseSumPattern} _1w + * @property {_24hCoinbaseSumPattern} _1y + * @property {_24hCoinbaseSumPattern} _2y + * @property {_24hCoinbaseSumPattern} _3m + * @property {_24hCoinbaseSumPattern} _3y + * @property {_24hCoinbaseSumPattern} _4y + * @property {_24hCoinbaseSumPattern} _5y + * @property {_24hCoinbaseSumPattern} _6m + * @property {_24hCoinbaseSumPattern} _6y + * @property {_24hCoinbaseSumPattern} _8y */ /** @@ -2515,18 +2328,18 @@ function createPriceAgoPattern(client, acc) { */ function createPeriodLumpSumStackPattern(client, acc) { return { - _10y: createActiveSupplyPattern(client, (acc ? `10y_${acc}` : '10y')), - _1m: createActiveSupplyPattern(client, (acc ? `1m_${acc}` : '1m')), - _1w: createActiveSupplyPattern(client, (acc ? `1w_${acc}` : '1w')), - _1y: createActiveSupplyPattern(client, (acc ? `1y_${acc}` : '1y')), - _2y: createActiveSupplyPattern(client, (acc ? `2y_${acc}` : '2y')), - _3m: createActiveSupplyPattern(client, (acc ? `3m_${acc}` : '3m')), - _3y: createActiveSupplyPattern(client, (acc ? `3y_${acc}` : '3y')), - _4y: createActiveSupplyPattern(client, (acc ? `4y_${acc}` : '4y')), - _5y: createActiveSupplyPattern(client, (acc ? `5y_${acc}` : '5y')), - _6m: createActiveSupplyPattern(client, (acc ? `6m_${acc}` : '6m')), - _6y: createActiveSupplyPattern(client, (acc ? `6y_${acc}` : '6y')), - _8y: createActiveSupplyPattern(client, (acc ? `8y_${acc}` : '8y')), + _10y: create_24hCoinbaseSumPattern(client, (acc ? `10y_${acc}` : '10y')), + _1m: create_24hCoinbaseSumPattern(client, (acc ? `1m_${acc}` : '1m')), + _1w: create_24hCoinbaseSumPattern(client, (acc ? `1w_${acc}` : '1w')), + _1y: create_24hCoinbaseSumPattern(client, (acc ? `1y_${acc}` : '1y')), + _2y: create_24hCoinbaseSumPattern(client, (acc ? `2y_${acc}` : '2y')), + _3m: create_24hCoinbaseSumPattern(client, (acc ? `3m_${acc}` : '3m')), + _3y: create_24hCoinbaseSumPattern(client, (acc ? `3y_${acc}` : '3y')), + _4y: create_24hCoinbaseSumPattern(client, (acc ? `4y_${acc}` : '4y')), + _5y: create_24hCoinbaseSumPattern(client, (acc ? `5y_${acc}` : '5y')), + _6m: create_24hCoinbaseSumPattern(client, (acc ? `6m_${acc}` : '6m')), + _6y: create_24hCoinbaseSumPattern(client, (acc ? `6y_${acc}` : '6y')), + _8y: create_24hCoinbaseSumPattern(client, (acc ? `8y_${acc}` : '8y')), }; } @@ -2610,53 +2423,18 @@ function createClassAveragePricePattern(client, acc) { }; } -/** - * @typedef {Object} RelativePattern2 - * @property {MetricPattern3} negUnrealizedLossRelToOwnMarketCap - * @property {MetricPattern3} negUnrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern3} netUnrealizedPnlRelToOwnMarketCap - * @property {MetricPattern3} netUnrealizedPnlRelToOwnTotalUnrealizedPnl - * @property {MetricPattern3} supplyInLossRelToOwnSupply - * @property {MetricPattern3} supplyInProfitRelToOwnSupply - * @property {MetricPattern3} unrealizedLossRelToOwnMarketCap - * @property {MetricPattern3} unrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern3} unrealizedProfitRelToOwnMarketCap - * @property {MetricPattern3} unrealizedProfitRelToOwnTotalUnrealizedPnl - */ - -/** - * Create a RelativePattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {RelativePattern2} - */ -function createRelativePattern2(client, acc) { - return { - negUnrealizedLossRelToOwnMarketCap: createMetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), - negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')), - netUnrealizedPnlRelToOwnMarketCap: createMetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), - netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')), - supplyInLossRelToOwnSupply: createMetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), - unrealizedLossRelToOwnMarketCap: createMetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), - unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')), - unrealizedProfitRelToOwnMarketCap: createMetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), - unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')), - }; -} - /** * @typedef {Object} RelativePattern - * @property {MetricPattern3} negUnrealizedLossRelToMarketCap - * @property {MetricPattern3} netUnrealizedPnlRelToMarketCap - * @property {MetricPattern4} nupl - * @property {MetricPattern3} supplyInLossRelToCirculatingSupply - * @property {MetricPattern3} supplyInLossRelToOwnSupply - * @property {MetricPattern3} supplyInProfitRelToCirculatingSupply - * @property {MetricPattern3} supplyInProfitRelToOwnSupply + * @property {MetricPattern1} negUnrealizedLossRelToMarketCap + * @property {MetricPattern1} netUnrealizedPnlRelToMarketCap + * @property {MetricPattern1} nupl + * @property {MetricPattern1} supplyInLossRelToCirculatingSupply + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToCirculatingSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply * @property {MetricPattern4} supplyRelToCirculatingSupply - * @property {MetricPattern3} unrealizedLossRelToMarketCap - * @property {MetricPattern3} unrealizedProfitRelToMarketCap + * @property {MetricPattern1} unrealizedLossRelToMarketCap + * @property {MetricPattern1} unrealizedProfitRelToMarketCap */ /** @@ -2667,16 +2445,51 @@ function createRelativePattern2(client, acc) { */ function createRelativePattern(client, acc) { return { - negUnrealizedLossRelToMarketCap: createMetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), - netUnrealizedPnlRelToMarketCap: createMetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), - nupl: createMetricPattern4(client, _m(acc, 'nupl')), - supplyInLossRelToCirculatingSupply: createMetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), - supplyInLossRelToOwnSupply: createMetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToCirculatingSupply: createMetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), + negUnrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), + netUnrealizedPnlRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), + nupl: createMetricPattern1(client, _m(acc, 'nupl')), + supplyInLossRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), + supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), + supplyInProfitRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), + supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), supplyRelToCirculatingSupply: createMetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')), - unrealizedLossRelToMarketCap: createMetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), - unrealizedProfitRelToMarketCap: createMetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), + unrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), + unrealizedProfitRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), + }; +} + +/** + * @typedef {Object} RelativePattern2 + * @property {MetricPattern1} negUnrealizedLossRelToOwnMarketCap + * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} netUnrealizedPnlRelToOwnMarketCap + * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply + * @property {MetricPattern1} unrealizedLossRelToOwnMarketCap + * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} unrealizedProfitRelToOwnMarketCap + * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl + */ + +/** + * Create a RelativePattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RelativePattern2} + */ +function createRelativePattern2(client, acc) { + return { + negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), + negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')), + netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), + netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')), + supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), + supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), + unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), + unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')), + unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), + unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')), }; } @@ -2714,35 +2527,72 @@ function createAddrCountPattern(client, acc) { } /** - * @typedef {Object} UnrealizedPattern - * @property {MetricPattern3} negUnrealizedLoss - * @property {MetricPattern3} netUnrealizedPnl - * @property {SupplyInLossPattern} supplyInLoss - * @property {SupplyInLossValuePattern} supplyInLossValue - * @property {SupplyInLossPattern} supplyInProfit - * @property {SupplyInLossValuePattern} supplyInProfitValue - * @property {MetricPattern3} totalUnrealizedPnl - * @property {MetricPattern3} unrealizedLoss - * @property {MetricPattern3} unrealizedProfit + * @template T + * @typedef {Object} OhlcPattern + * @property {MetricPattern7} dateindex + * @property {MetricPattern8} decade + * @property {MetricPattern9} difficultyepoch + * @property {MetricPattern12} height + * @property {MetricPattern14} month + * @property {MetricPattern26} quarter + * @property {MetricPattern27} semester + * @property {MetricPattern30} week + * @property {MetricPattern31} year */ /** - * Create a UnrealizedPattern pattern node + * Create a OhlcPattern pattern node + * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {UnrealizedPattern} + * @returns {OhlcPattern} */ -function createUnrealizedPattern(client, acc) { +function createOhlcPattern(client, acc) { return { - negUnrealizedLoss: createMetricPattern3(client, _m(acc, 'neg_unrealized_loss')), - netUnrealizedPnl: createMetricPattern3(client, _m(acc, 'net_unrealized_pnl')), - supplyInLoss: createSupplyInLossPattern(client, _m(acc, 'supply_in_loss')), - supplyInLossValue: createSupplyInLossValuePattern(client, _m(acc, 'supply_in_loss')), - supplyInProfit: createSupplyInLossPattern(client, _m(acc, 'supply_in_profit')), - supplyInProfitValue: createSupplyInLossValuePattern(client, _m(acc, 'supply_in_profit')), - totalUnrealizedPnl: createMetricPattern3(client, _m(acc, 'total_unrealized_pnl')), - unrealizedLoss: createMetricPattern3(client, _m(acc, 'unrealized_loss')), - unrealizedProfit: createMetricPattern3(client, _m(acc, 'unrealized_profit')), + dateindex: createMetricPattern7(client, acc), + decade: createMetricPattern8(client, acc), + difficultyepoch: createMetricPattern9(client, acc), + height: createMetricPattern12(client, acc), + month: createMetricPattern14(client, acc), + quarter: createMetricPattern26(client, acc), + semester: createMetricPattern27(client, acc), + week: createMetricPattern30(client, acc), + year: createMetricPattern31(client, acc), + }; +} + +/** + * @template T + * @typedef {Object} FeeRatePattern + * @property {MetricPattern1} average + * @property {MetricPattern1} max + * @property {MetricPattern12} median + * @property {MetricPattern1} min + * @property {MetricPattern12} pct10 + * @property {MetricPattern12} pct25 + * @property {MetricPattern12} pct75 + * @property {MetricPattern12} pct90 + * @property {MetricPattern28} txindex + */ + +/** + * Create a FeeRatePattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {FeeRatePattern} + */ +function createFeeRatePattern(client, acc) { + return { + average: createMetricPattern1(client, _m(acc, 'average')), + max: createMetricPattern1(client, _m(acc, 'max')), + median: createMetricPattern12(client, _m(acc, 'median')), + min: createMetricPattern1(client, _m(acc, 'min')), + pct10: createMetricPattern12(client, _m(acc, 'pct10')), + pct25: createMetricPattern12(client, _m(acc, 'pct25')), + pct75: createMetricPattern12(client, _m(acc, 'pct75')), + pct90: createMetricPattern12(client, _m(acc, 'pct90')), + txindex: createMetricPattern28(client, acc), }; } @@ -2751,6 +2601,7 @@ function createUnrealizedPattern(client, acc) { * @property {ActivityPattern2} activity * @property {MetricPattern1} addrCount * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs * @property {RealizedPattern} realized * @property {RelativePattern} relative * @property {SupplyPattern2} supply @@ -2768,9 +2619,97 @@ function create_0satsPattern(client, acc) { activity: createActivityPattern2(client, acc), addrCount: createMetricPattern1(client, _m(acc, 'addr_count')), costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, acc), realized: createRealizedPattern(client, acc), relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, acc), + supply: createSupplyPattern2(client, _m(acc, 'supply')), + unrealized: createUnrealizedPattern(client, acc), + }; +} + +/** + * @typedef {Object} UnrealizedPattern + * @property {MetricPattern1} negUnrealizedLoss + * @property {MetricPattern1} netUnrealizedPnl + * @property {_24hCoinbaseSumPattern} supplyInLoss + * @property {_24hCoinbaseSumPattern} supplyInProfit + * @property {MetricPattern1} totalUnrealizedPnl + * @property {MetricPattern1} unrealizedLoss + * @property {MetricPattern1} unrealizedProfit + */ + +/** + * Create a UnrealizedPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {UnrealizedPattern} + */ +function createUnrealizedPattern(client, acc) { + return { + negUnrealizedLoss: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')), + netUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl')), + supplyInLoss: create_24hCoinbaseSumPattern(client, _m(acc, 'supply_in_loss')), + supplyInProfit: create_24hCoinbaseSumPattern(client, _m(acc, 'supply_in_profit')), + totalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'total_unrealized_pnl')), + unrealizedLoss: createMetricPattern1(client, _m(acc, 'unrealized_loss')), + unrealizedProfit: createMetricPattern1(client, _m(acc, 'unrealized_profit')), + }; +} + +/** + * @typedef {Object} _100btcPattern + * @property {ActivityPattern2} activity + * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern} realized + * @property {RelativePattern} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized + */ + +/** + * Create a _100btcPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_100btcPattern} + */ +function create_100btcPattern(client, acc) { + return { + activity: createActivityPattern2(client, acc), + costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, acc), + realized: createRealizedPattern(client, acc), + relative: createRelativePattern(client, acc), + supply: createSupplyPattern2(client, _m(acc, 'supply')), + unrealized: createUnrealizedPattern(client, acc), + }; +} + +/** + * @typedef {Object} _10yPattern + * @property {ActivityPattern2} activity + * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern4} realized + * @property {RelativePattern} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized + */ + +/** + * Create a _10yPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_10yPattern} + */ +function create_10yPattern(client, acc) { + return { + activity: createActivityPattern2(client, acc), + costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, acc), + realized: createRealizedPattern4(client, acc), + relative: createRelativePattern(client, acc), + supply: createSupplyPattern2(client, _m(acc, 'supply')), unrealized: createUnrealizedPattern(client, acc), }; } @@ -2804,41 +2743,11 @@ function createPeriodCagrPattern(client, acc) { }; } -/** - * @template T - * @typedef {Object} BitcoinPattern - * @property {MetricPattern2} average - * @property {MetricPattern23} base - * @property {MetricPattern1} cumulative - * @property {MetricPattern2} max - * @property {MetricPattern2} min - * @property {PercentilesPattern} percentiles - * @property {MetricPattern2} sum - */ - -/** - * Create a BitcoinPattern pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {BitcoinPattern} - */ -function createBitcoinPattern(client, acc) { - return { - average: createMetricPattern2(client, _m(acc, 'average')), - base: createMetricPattern23(client, acc), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - max: createMetricPattern2(client, _m(acc, 'max')), - min: createMetricPattern2(client, _m(acc, 'min')), - percentiles: createPercentilesPattern(client, acc), - sum: createMetricPattern2(client, _m(acc, 'sum')), - }; -} - /** * @typedef {Object} _0satsPattern2 * @property {ActivityPattern2} activity * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs * @property {RealizedPattern} realized * @property {RelativePattern4} relative * @property {SupplyPattern2} supply @@ -2855,9 +2764,10 @@ function create_0satsPattern2(client, acc) { return { activity: createActivityPattern2(client, acc), costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, acc), realized: createRealizedPattern(client, acc), relative: createRelativePattern4(client, _m(acc, 'supply_in')), - supply: createSupplyPattern2(client, acc), + supply: createSupplyPattern2(client, _m(acc, 'supply')), unrealized: createUnrealizedPattern(client, acc), }; } @@ -2866,6 +2776,7 @@ function create_0satsPattern2(client, acc) { * @typedef {Object} _10yTo12yPattern * @property {ActivityPattern2} activity * @property {CostBasisPattern2} costBasis + * @property {OutputsPattern} outputs * @property {RealizedPattern2} realized * @property {RelativePattern2} relative * @property {SupplyPattern2} supply @@ -2882,70 +2793,48 @@ function create_10yTo12yPattern(client, acc) { return { activity: createActivityPattern2(client, acc), costBasis: createCostBasisPattern2(client, acc), + outputs: createOutputsPattern(client, acc), realized: createRealizedPattern2(client, acc), relative: createRelativePattern2(client, acc), - supply: createSupplyPattern2(client, acc), - unrealized: createUnrealizedPattern(client, acc), - }; -} - -/** - * @typedef {Object} _10yPattern - * @property {ActivityPattern2} activity - * @property {CostBasisPattern} costBasis - * @property {RealizedPattern4} realized - * @property {RelativePattern} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _10yPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_10yPattern} - */ -function create_10yPattern(client, acc) { - return { - activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern(client, acc), - realized: createRealizedPattern4(client, acc), - relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, acc), - unrealized: createUnrealizedPattern(client, acc), - }; -} - -/** - * @typedef {Object} _100btcPattern - * @property {ActivityPattern2} activity - * @property {CostBasisPattern} costBasis - * @property {RealizedPattern} realized - * @property {RelativePattern} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _100btcPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_100btcPattern} - */ -function create_100btcPattern(client, acc) { - return { - activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern(client, acc), - realized: createRealizedPattern(client, acc), - relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, acc), + supply: createSupplyPattern2(client, _m(acc, 'supply')), unrealized: createUnrealizedPattern(client, acc), }; } /** * @template T - * @typedef {Object} BlockSizePattern + * @typedef {Object} BitcoinPattern + * @property {MetricPattern2} average + * @property {MetricPattern1} cumulative + * @property {MetricPattern12} height + * @property {MetricPattern2} max + * @property {MetricPattern2} min + * @property {PercentilesPattern} percentiles + * @property {MetricPattern2} sum + */ + +/** + * Create a BitcoinPattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BitcoinPattern} + */ +function createBitcoinPattern(client, acc) { + return { + average: createMetricPattern2(client, _m(acc, 'average')), + cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + height: createMetricPattern12(client, acc), + max: createMetricPattern2(client, _m(acc, 'max')), + min: createMetricPattern2(client, _m(acc, 'min')), + percentiles: createPercentilesPattern(client, acc), + sum: createMetricPattern2(client, _m(acc, 'sum')), + }; +} + +/** + * @template T + * @typedef {Object} SizePattern * @property {MetricPattern2} average * @property {MetricPattern1} cumulative * @property {MetricPattern2} max @@ -2955,13 +2844,13 @@ function create_100btcPattern(client, acc) { */ /** - * Create a BlockSizePattern pattern node + * Create a SizePattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {BlockSizePattern} + * @returns {SizePattern} */ -function createBlockSizePattern(client, acc) { +function createSizePattern(client, acc) { return { average: createMetricPattern2(client, _m(acc, 'average')), cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), @@ -2976,9 +2865,9 @@ function createBlockSizePattern(client, acc) { * @typedef {Object} ActivityPattern2 * @property {BlockCountPattern} coinblocksDestroyed * @property {BlockCountPattern} coindaysDestroyed - * @property {MetricPattern23} satblocksDestroyed - * @property {MetricPattern23} satdaysDestroyed - * @property {SentPattern} sent + * @property {MetricPattern12} satblocksDestroyed + * @property {MetricPattern12} satdaysDestroyed + * @property {UnclaimedRewardsPattern} sent */ /** @@ -2991,20 +2880,20 @@ function createActivityPattern2(client, acc) { return { coinblocksDestroyed: createBlockCountPattern(client, _m(acc, 'coinblocks_destroyed')), coindaysDestroyed: createBlockCountPattern(client, _m(acc, 'coindays_destroyed')), - satblocksDestroyed: createMetricPattern23(client, _m(acc, 'satblocks_destroyed')), - satdaysDestroyed: createMetricPattern23(client, _m(acc, 'satdays_destroyed')), - sent: createSentPattern(client, _m(acc, 'sent')), + satblocksDestroyed: createMetricPattern12(client, _m(acc, 'satblocks_destroyed')), + satdaysDestroyed: createMetricPattern12(client, _m(acc, 'satdays_destroyed')), + sent: createUnclaimedRewardsPattern(client, _m(acc, 'sent')), }; } /** * @template T * @typedef {Object} PercentilesPattern - * @property {MetricPattern19} median - * @property {MetricPattern19} pct10 - * @property {MetricPattern19} pct25 - * @property {MetricPattern19} pct75 - * @property {MetricPattern19} pct90 + * @property {MetricPattern7} median + * @property {MetricPattern7} pct10 + * @property {MetricPattern7} pct25 + * @property {MetricPattern7} pct75 + * @property {MetricPattern7} pct90 */ /** @@ -3016,132 +2905,126 @@ function createActivityPattern2(client, acc) { */ function createPercentilesPattern(client, acc) { return { - median: createMetricPattern19(client, _m(acc, 'median')), - pct10: createMetricPattern19(client, _m(acc, 'pct10')), - pct25: createMetricPattern19(client, _m(acc, 'pct25')), - pct75: createMetricPattern19(client, _m(acc, 'pct75')), - pct90: createMetricPattern19(client, _m(acc, 'pct90')), + median: createMetricPattern7(client, _m(acc, 'median')), + pct10: createMetricPattern7(client, _m(acc, 'pct10')), + pct25: createMetricPattern7(client, _m(acc, 'pct25')), + pct75: createMetricPattern7(client, _m(acc, 'pct75')), + pct90: createMetricPattern7(client, _m(acc, 'pct90')), + }; +} + +/** + * @typedef {Object} DateindexPattern2 + * @property {MetricPattern7} close + * @property {MetricPattern7} high + * @property {MetricPattern7} low + * @property {MetricPattern7} open + */ + +/** + * Create a DateindexPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {DateindexPattern2} + */ +function createDateindexPattern2(client, acc) { + return { + close: createMetricPattern7(client, _m(acc, 'close_cents')), + high: createMetricPattern7(client, _m(acc, 'high_cents')), + low: createMetricPattern7(client, _m(acc, 'low_cents')), + open: createMetricPattern7(client, _m(acc, 'open_cents')), }; } /** * @template T - * @typedef {Object} IntervalPattern - * @property {MetricPattern2} average - * @property {MetricPattern23} base - * @property {MetricPattern2} max - * @property {MetricPattern2} min - * @property {PercentilesPattern} percentiles + * @typedef {Object} SplitPattern2 + * @property {MetricPattern1} close + * @property {HighPattern} high + * @property {HighPattern} low + * @property {MetricPattern1} open */ /** - * Create a IntervalPattern pattern node + * Create a SplitPattern2 pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {IntervalPattern} + * @returns {SplitPattern2} */ -function createIntervalPattern(client, acc) { +function createSplitPattern2(client, acc) { return { - average: createMetricPattern2(client, _m(acc, 'average')), - base: createMetricPattern23(client, acc), - max: createMetricPattern2(client, _m(acc, 'max')), - min: createMetricPattern2(client, _m(acc, 'min')), - percentiles: createPercentilesPattern(client, acc), - }; -} - -/** - * @typedef {Object} SupplyInLossPattern - * @property {MetricPattern7} base - * @property {MetricPattern4} bitcoin - * @property {MetricPattern4} dollars - * @property {MetricPattern5} sats - */ - -/** - * Create a SupplyInLossPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {SupplyInLossPattern} - */ -function createSupplyInLossPattern(client, acc) { - return { - base: createMetricPattern7(client, acc), - bitcoin: createMetricPattern4(client, _m(acc, 'btc')), - dollars: createMetricPattern4(client, _m(acc, 'usd')), - sats: createMetricPattern5(client, acc), + close: createMetricPattern1(client, _m(acc, 'close')), + high: createHighPattern(client, _m(acc, 'high')), + low: createHighPattern(client, _m(acc, 'low')), + open: createMetricPattern1(client, _m(acc, 'open')), }; } /** * @template T - * @typedef {Object} PriceHighSatsPattern - * @property {MetricPattern19} dateindex - * @property {MetricPattern21} difficultyepoch - * @property {MetricPattern23} height + * @typedef {Object} HighPattern + * @property {MetricPattern7} dateindex + * @property {MetricPattern9} difficultyepoch + * @property {MetricPattern12} height * @property {MetricPattern5} rest */ /** - * Create a PriceHighSatsPattern pattern node + * Create a HighPattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {PriceHighSatsPattern} + * @returns {HighPattern} */ -function createPriceHighSatsPattern(client, acc) { +function createHighPattern(client, acc) { return { - dateindex: createMetricPattern19(client, acc), - difficultyepoch: createMetricPattern21(client, _m(acc, 'max')), - height: createMetricPattern23(client, acc), + dateindex: createMetricPattern7(client, acc), + difficultyepoch: createMetricPattern9(client, _m(acc, 'max')), + height: createMetricPattern12(client, acc), rest: createMetricPattern5(client, _m(acc, 'max')), }; } /** - * @template T - * @typedef {Object} TxVsizePattern - * @property {MetricPattern1} average - * @property {MetricPattern1} max - * @property {MetricPattern1} min - * @property {PercentilesPattern} percentiles + * @typedef {Object} _24hCoinbaseSumPattern + * @property {MetricPattern12} bitcoin + * @property {MetricPattern12} dollars + * @property {MetricPattern12} sats */ /** - * Create a TxVsizePattern pattern node - * @template T + * Create a _24hCoinbaseSumPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {TxVsizePattern} + * @returns {_24hCoinbaseSumPattern} */ -function createTxVsizePattern(client, acc) { +function create_24hCoinbaseSumPattern(client, acc) { return { - average: createMetricPattern1(client, _m(acc, 'average')), - max: createMetricPattern1(client, _m(acc, 'max')), - min: createMetricPattern1(client, _m(acc, 'min')), - percentiles: createPercentilesPattern(client, acc), + bitcoin: createMetricPattern12(client, _m(acc, 'btc')), + dollars: createMetricPattern12(client, _m(acc, 'usd')), + sats: createMetricPattern12(client, acc), }; } /** - * @typedef {Object} UnclaimedRewardsPattern - * @property {BlockCountPattern} bitcoin - * @property {BlockCountPattern} dollars - * @property {BlockCountPattern} sats + * @typedef {Object} SegwitAdoptionPattern + * @property {MetricPattern2} cumulative + * @property {MetricPattern12} height + * @property {MetricPattern2} sum */ /** - * Create a UnclaimedRewardsPattern pattern node + * Create a SegwitAdoptionPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {UnclaimedRewardsPattern} + * @returns {SegwitAdoptionPattern} */ -function createUnclaimedRewardsPattern(client, acc) { +function createSegwitAdoptionPattern(client, acc) { return { - bitcoin: createBlockCountPattern(client, _m(acc, 'btc')), - dollars: createBlockCountPattern(client, _m(acc, 'usd')), - sats: createBlockCountPattern(client, acc), + cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), + height: createMetricPattern12(client, acc), + sum: createMetricPattern2(client, _m(acc, 'sum')), }; } @@ -3167,44 +3050,23 @@ function createCostBasisPattern2(client, acc) { } /** - * @typedef {Object} ActiveSupplyPattern - * @property {MetricPattern1} bitcoin - * @property {MetricPattern1} dollars - * @property {MetricPattern1} sats - */ - -/** - * Create a ActiveSupplyPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ActiveSupplyPattern} - */ -function createActiveSupplyPattern(client, acc) { - return { - bitcoin: createMetricPattern1(client, _m(acc, 'btc')), - dollars: createMetricPattern1(client, _m(acc, 'usd')), - sats: createMetricPattern1(client, acc), - }; -} - -/** - * @typedef {Object} SentPattern + * @typedef {Object} UnclaimedRewardsPattern * @property {BlockCountPattern} bitcoin * @property {BlockCountPattern} dollars - * @property {SatsPattern} sats + * @property {BlockCountPattern} sats */ /** - * Create a SentPattern pattern node + * Create a UnclaimedRewardsPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {SentPattern} + * @returns {UnclaimedRewardsPattern} */ -function createSentPattern(client, acc) { +function createUnclaimedRewardsPattern(client, acc) { return { bitcoin: createBlockCountPattern(client, _m(acc, 'btc')), dollars: createBlockCountPattern(client, _m(acc, 'usd')), - sats: createSatsPattern(client, acc), + sats: createBlockCountPattern(client, acc), }; } @@ -3230,84 +3092,21 @@ function createCoinbasePattern(client, acc) { } /** - * @typedef {Object} SupplyPattern2 - * @property {ActiveSupplyPattern} supply - * @property {ActiveSupplyPattern} supplyHalf - * @property {MetricPattern1} utxoCount + * @typedef {Object} RelativePattern4 + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply */ /** - * Create a SupplyPattern2 pattern node + * Create a RelativePattern4 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {SupplyPattern2} + * @returns {RelativePattern4} */ -function createSupplyPattern2(client, acc) { +function createRelativePattern4(client, acc) { return { - supply: createActiveSupplyPattern(client, _m(acc, 'supply')), - supplyHalf: createActiveSupplyPattern(client, _m(acc, 'supply_half')), - utxoCount: createMetricPattern1(client, _m(acc, 'utxo_count')), - }; -} - -/** - * @template T - * @typedef {Object} SatsPattern - * @property {MetricPattern23} base - * @property {MetricPattern2} cumulative - * @property {MetricPattern2} sum - */ - -/** - * Create a SatsPattern pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {SatsPattern} - */ -function createSatsPattern(client, acc) { - return { - base: createMetricPattern23(client, acc), - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - sum: createMetricPattern2(client, _m(acc, 'sum')), - }; -} - -/** - * @typedef {Object} CostBasisPattern - * @property {MetricPattern1} max - * @property {MetricPattern1} min - */ - -/** - * Create a CostBasisPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {CostBasisPattern} - */ -function createCostBasisPattern(client, acc) { - return { - max: createMetricPattern1(client, _m(acc, 'max_cost_basis')), - min: createMetricPattern1(client, _m(acc, 'min_cost_basis')), - }; -} - -/** - * @typedef {Object} SupplyInLossValuePattern - * @property {MetricPattern23} bitcoin - * @property {MetricPattern23} dollars - */ - -/** - * Create a SupplyInLossValuePattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {SupplyInLossValuePattern} - */ -function createSupplyInLossValuePattern(client, acc) { - return { - bitcoin: createMetricPattern23(client, _m(acc, 'btc')), - dollars: createMetricPattern23(client, _m(acc, 'usd')), + supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'loss_rel_to_own_supply')), + supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'profit_rel_to_own_supply')), }; } @@ -3331,21 +3130,59 @@ function create_1dReturns1mSdPattern(client, acc) { } /** - * @typedef {Object} RelativePattern4 - * @property {MetricPattern3} supplyInLossRelToOwnSupply - * @property {MetricPattern3} supplyInProfitRelToOwnSupply + * @typedef {Object} CostBasisPattern + * @property {MetricPattern1} max + * @property {MetricPattern1} min */ /** - * Create a RelativePattern4 pattern node + * Create a CostBasisPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {RelativePattern4} + * @returns {CostBasisPattern} */ -function createRelativePattern4(client, acc) { +function createCostBasisPattern(client, acc) { return { - supplyInLossRelToOwnSupply: createMetricPattern3(client, _m(acc, 'loss_rel_to_own_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern3(client, _m(acc, 'profit_rel_to_own_supply')), + max: createMetricPattern1(client, _m(acc, 'max_cost_basis')), + min: createMetricPattern1(client, _m(acc, 'min_cost_basis')), + }; +} + +/** + * @typedef {Object} SupplyPattern2 + * @property {_24hCoinbaseSumPattern} halved + * @property {_24hCoinbaseSumPattern} total + */ + +/** + * Create a SupplyPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {SupplyPattern2} + */ +function createSupplyPattern2(client, acc) { + return { + halved: create_24hCoinbaseSumPattern(client, _m(acc, 'half')), + total: create_24hCoinbaseSumPattern(client, acc), + }; +} + +/** + * @typedef {Object} SatsPattern + * @property {OhlcPattern} ohlc + * @property {SplitPattern2} split + */ + +/** + * Create a SatsPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {SatsPattern} + */ +function createSatsPattern(client, acc) { + return { + ohlc: createOhlcPattern(client, _m(acc, 'ohlc_sats')), + split: createSplitPattern2(client, _m(acc, 'sats')), }; } @@ -3387,6 +3224,42 @@ function createRealizedPriceExtraPattern(client, acc) { }; } +/** + * @typedef {Object} OutputsPattern + * @property {MetricPattern1} utxoCount + */ + +/** + * Create a OutputsPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {OutputsPattern} + */ +function createOutputsPattern(client, acc) { + return { + utxoCount: createMetricPattern1(client, _m(acc, 'utxo_count')), + }; +} + +/** + * @template T + * @typedef {Object} EmptyPattern + * @property {MetricPattern18} identity + */ + +/** + * Create a EmptyPattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {EmptyPattern} + */ +function createEmptyPattern(client, acc) { + return { + identity: createMetricPattern18(client, acc), + }; +} + // Catalog tree typedefs /** @@ -3410,67 +3283,80 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Addresses - * @property {MetricPattern23} firstP2aaddressindex - * @property {MetricPattern23} firstP2pk33addressindex - * @property {MetricPattern23} firstP2pk65addressindex - * @property {MetricPattern23} firstP2pkhaddressindex - * @property {MetricPattern23} firstP2shaddressindex - * @property {MetricPattern23} firstP2traddressindex - * @property {MetricPattern23} firstP2wpkhaddressindex - * @property {MetricPattern23} firstP2wshaddressindex - * @property {MetricPattern27} p2abytes - * @property {MetricPattern29} p2pk33bytes - * @property {MetricPattern30} p2pk65bytes - * @property {MetricPattern31} p2pkhbytes - * @property {MetricPattern32} p2shbytes - * @property {MetricPattern33} p2trbytes - * @property {MetricPattern34} p2wpkhbytes - * @property {MetricPattern35} p2wshbytes + * @property {MetricPattern12} firstP2aaddressindex + * @property {MetricPattern12} firstP2pk33addressindex + * @property {MetricPattern12} firstP2pk65addressindex + * @property {MetricPattern12} firstP2pkhaddressindex + * @property {MetricPattern12} firstP2shaddressindex + * @property {MetricPattern12} firstP2traddressindex + * @property {MetricPattern12} firstP2wpkhaddressindex + * @property {MetricPattern12} firstP2wshaddressindex + * @property {MetricPattern17} p2abytes + * @property {MetricPattern19} p2pk33bytes + * @property {MetricPattern20} p2pk65bytes + * @property {MetricPattern21} p2pkhbytes + * @property {MetricPattern22} p2shbytes + * @property {MetricPattern23} p2trbytes + * @property {MetricPattern24} p2wpkhbytes + * @property {MetricPattern25} p2wshbytes */ /** * @typedef {Object} CatalogTree_Blocks - * @property {MetricPattern23} blockhash + * @property {MetricPattern12} blockhash * @property {CatalogTree_Blocks_Count} count * @property {CatalogTree_Blocks_Difficulty} difficulty * @property {CatalogTree_Blocks_Halving} halving - * @property {IntervalPattern} interval + * @property {CatalogTree_Blocks_Interval} interval * @property {CatalogTree_Blocks_Mining} mining * @property {CatalogTree_Blocks_Rewards} rewards * @property {CatalogTree_Blocks_Size} size * @property {CatalogTree_Blocks_Time} time - * @property {MetricPattern23} timestamp - * @property {MetricPattern23} totalSize + * @property {MetricPattern12} timestamp + * @property {MetricPattern12} totalSize * @property {CatalogTree_Blocks_Weight} weight */ /** * @typedef {Object} CatalogTree_Blocks_Count * @property {MetricPattern1} _1mBlockCount - * @property {MetricPattern23} _1mStart + * @property {MetricPattern12} _1mStart * @property {MetricPattern1} _1wBlockCount - * @property {MetricPattern23} _1wStart + * @property {MetricPattern12} _1wStart * @property {MetricPattern1} _1yBlockCount - * @property {MetricPattern23} _1yStart + * @property {MetricPattern12} _1yStart * @property {MetricPattern1} _24hBlockCount - * @property {MetricPattern23} _24hStart + * @property {MetricPattern12} _24hStart * @property {BlockCountPattern} blockCount * @property {MetricPattern4} blockCountTarget */ /** * @typedef {Object} CatalogTree_Blocks_Difficulty - * @property {MetricPattern23} base + * @property {MetricPattern12} base * @property {MetricPattern1} blocksBeforeNextDifficultyAdjustment * @property {MetricPattern1} daysBeforeNextDifficultyAdjustment - * @property {MetricPattern4} difficultyepoch + * @property {MetricPattern4} epoch */ /** * @typedef {Object} CatalogTree_Blocks_Halving * @property {MetricPattern1} blocksBeforeNextHalving * @property {MetricPattern1} daysBeforeNextHalving - * @property {MetricPattern4} halvingepoch + * @property {MetricPattern4} epoch + */ + +/** + * @typedef {Object} CatalogTree_Blocks_Interval + * @property {MetricPattern2} average + * @property {MetricPattern12} base + * @property {MetricPattern2} max + * @property {MetricPattern7} median + * @property {MetricPattern2} min + * @property {MetricPattern7} pct10 + * @property {MetricPattern7} pct25 + * @property {MetricPattern7} pct75 + * @property {MetricPattern7} pct90 */ /** @@ -3497,36 +3383,45 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Blocks_Rewards - * @property {MetricPattern23} _24hCoinbaseSum - * @property {MetricPattern23} _24hCoinbaseUsdSum + * @property {_24hCoinbaseSumPattern} _24hCoinbaseSum * @property {CoinbasePattern} coinbase - * @property {MetricPattern19} feeDominance + * @property {MetricPattern7} feeDominance * @property {CoinbasePattern} subsidy - * @property {MetricPattern19} subsidyDominance + * @property {MetricPattern7} subsidyDominance * @property {MetricPattern4} subsidyUsd1ySma * @property {UnclaimedRewardsPattern} unclaimedRewards */ /** * @typedef {Object} CatalogTree_Blocks_Size - * @property {BlockSizePattern} blockSize - * @property {BlockSizePattern} blockVbytes - * @property {MetricPattern23} vbytes + * @property {SizePattern} size + * @property {CatalogTree_Blocks_Size_Vbytes} vbytes + */ + +/** + * @typedef {Object} CatalogTree_Blocks_Size_Vbytes + * @property {MetricPattern2} average + * @property {MetricPattern12} base + * @property {MetricPattern1} cumulative + * @property {MetricPattern2} max + * @property {MetricPattern2} min + * @property {PercentilesPattern} percentiles + * @property {MetricPattern2} sum */ /** * @typedef {Object} CatalogTree_Blocks_Time - * @property {MetricPattern23} date - * @property {MetricPattern23} dateFixed + * @property {MetricPattern12} date + * @property {MetricPattern12} dateFixed * @property {MetricPattern2} timestamp - * @property {MetricPattern23} timestampFixed + * @property {MetricPattern12} timestampFixed */ /** * @typedef {Object} CatalogTree_Blocks_Weight - * @property {MetricPattern23} base - * @property {BitcoinPattern} blockFullness - * @property {BlockSizePattern} blockWeight + * @property {MetricPattern12} base + * @property {BitcoinPattern} fullness + * @property {SizePattern} weight */ /** @@ -3578,8 +3473,8 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Cointime_Supply - * @property {ActiveSupplyPattern} activeSupply - * @property {ActiveSupplyPattern} vaultedSupply + * @property {_24hCoinbaseSumPattern} activeSupply + * @property {_24hCoinbaseSumPattern} vaultedSupply */ /** @@ -3617,10 +3512,10 @@ function createRealizedPriceExtraPattern(client, acc) { * @property {CatalogTree_Distribution_AddressCohorts} addressCohorts * @property {CatalogTree_Distribution_AddressesData} addressesData * @property {CatalogTree_Distribution_AnyAddressIndexes} anyAddressIndexes - * @property {MetricPattern23} chainState + * @property {MetricPattern12} chainState * @property {AddrCountPattern} emptyAddrCount - * @property {MetricPattern39} emptyaddressindex - * @property {MetricPattern38} loadedaddressindex + * @property {MetricPattern33} emptyaddressindex + * @property {MetricPattern32} loadedaddressindex * @property {CatalogTree_Distribution_UtxoCohorts} utxoCohorts */ @@ -3686,20 +3581,20 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Distribution_AddressesData - * @property {MetricPattern39} empty - * @property {MetricPattern38} loaded + * @property {MetricPattern33} empty + * @property {MetricPattern32} loaded */ /** * @typedef {Object} CatalogTree_Distribution_AnyAddressIndexes - * @property {MetricPattern27} p2a - * @property {MetricPattern29} p2pk33 - * @property {MetricPattern30} p2pk65 - * @property {MetricPattern31} p2pkh - * @property {MetricPattern32} p2sh - * @property {MetricPattern33} p2tr - * @property {MetricPattern34} p2wpkh - * @property {MetricPattern35} p2wsh + * @property {MetricPattern17} p2a + * @property {MetricPattern19} p2pk33 + * @property {MetricPattern20} p2pk65 + * @property {MetricPattern21} p2pkh + * @property {MetricPattern22} p2sh + * @property {MetricPattern23} p2tr + * @property {MetricPattern24} p2wpkh + * @property {MetricPattern25} p2wsh */ /** @@ -3746,6 +3641,7 @@ function createRealizedPriceExtraPattern(client, acc) { * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_All * @property {ActivityPattern2} activity * @property {CostBasisPattern2} costBasis + * @property {OutputsPattern} outputs * @property {RealizedPattern3} realized * @property {CatalogTree_Distribution_UtxoCohorts_All_Relative} relative * @property {SupplyPattern2} supply @@ -3754,12 +3650,12 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_All_Relative - * @property {MetricPattern3} negUnrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern3} netUnrealizedPnlRelToOwnTotalUnrealizedPnl - * @property {MetricPattern3} supplyInLossRelToOwnSupply - * @property {MetricPattern3} supplyInProfitRelToOwnSupply - * @property {MetricPattern3} unrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern3} unrealizedProfitRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply + * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl */ /** @@ -3878,6 +3774,7 @@ function createRealizedPriceExtraPattern(client, acc) { * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Term_Long * @property {ActivityPattern2} activity * @property {CostBasisPattern2} costBasis + * @property {OutputsPattern} outputs * @property {RealizedPattern2} realized * @property {RelativePattern5} relative * @property {SupplyPattern2} supply @@ -3888,6 +3785,7 @@ function createRealizedPriceExtraPattern(client, acc) { * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Term_Short * @property {ActivityPattern2} activity * @property {CostBasisPattern2} costBasis + * @property {OutputsPattern} outputs * @property {RealizedPattern3} realized * @property {RelativePattern5} relative * @property {SupplyPattern2} supply @@ -3934,87 +3832,138 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Indexes * @property {CatalogTree_Indexes_Address} address - * @property {CatalogTree_Indexes_Block} block - * @property {CatalogTree_Indexes_Time} time - * @property {CatalogTree_Indexes_Transaction} transaction + * @property {CatalogTree_Indexes_Dateindex} dateindex + * @property {CatalogTree_Indexes_Decadeindex} decadeindex + * @property {CatalogTree_Indexes_Difficultyepoch} difficultyepoch + * @property {CatalogTree_Indexes_Halvingepoch} halvingepoch + * @property {CatalogTree_Indexes_Height} height + * @property {CatalogTree_Indexes_Monthindex} monthindex + * @property {CatalogTree_Indexes_Quarterindex} quarterindex + * @property {CatalogTree_Indexes_Semesterindex} semesterindex + * @property {CatalogTree_Indexes_Txindex} txindex + * @property {EmptyPattern} txinindex + * @property {EmptyPattern} txoutindex + * @property {CatalogTree_Indexes_Weekindex} weekindex + * @property {CatalogTree_Indexes_Yearindex} yearindex */ /** * @typedef {Object} CatalogTree_Indexes_Address - * @property {MetricPattern22} emptyoutputindex - * @property {MetricPattern25} opreturnindex - * @property {MetricPattern27} p2aaddressindex - * @property {MetricPattern28} p2msoutputindex - * @property {MetricPattern29} p2pk33addressindex - * @property {MetricPattern30} p2pk65addressindex - * @property {MetricPattern31} p2pkhaddressindex - * @property {MetricPattern32} p2shaddressindex - * @property {MetricPattern33} p2traddressindex - * @property {MetricPattern34} p2wpkhaddressindex - * @property {MetricPattern35} p2wshaddressindex - * @property {MetricPattern37} unknownoutputindex + * @property {EmptyPattern} empty + * @property {EmptyPattern} opreturn + * @property {EmptyPattern} p2a + * @property {EmptyPattern} p2ms + * @property {EmptyPattern} p2pk33 + * @property {EmptyPattern} p2pk65 + * @property {EmptyPattern} p2pkh + * @property {EmptyPattern} p2sh + * @property {EmptyPattern} p2tr + * @property {EmptyPattern} p2wpkh + * @property {EmptyPattern} p2wsh + * @property {EmptyPattern} unknown */ /** - * @typedef {Object} CatalogTree_Indexes_Block - * @property {MetricPattern23} dateindex - * @property {MetricPattern12} difficultyepoch + * @typedef {Object} CatalogTree_Indexes_Dateindex + * @property {MetricPattern7} date + * @property {MetricPattern7} firstHeight + * @property {MetricPattern7} heightCount + * @property {MetricPattern7} identity + * @property {MetricPattern7} monthindex + * @property {MetricPattern7} weekindex + */ + +/** + * @typedef {Object} CatalogTree_Indexes_Decadeindex + * @property {MetricPattern8} firstYearindex + * @property {MetricPattern8} identity + * @property {MetricPattern8} yearindexCount + */ + +/** + * @typedef {Object} CatalogTree_Indexes_Difficultyepoch + * @property {MetricPattern9} firstHeight + * @property {MetricPattern9} heightCount + * @property {MetricPattern9} identity + */ + +/** + * @typedef {Object} CatalogTree_Indexes_Halvingepoch * @property {MetricPattern11} firstHeight - * @property {MetricPattern13} halvingepoch - * @property {MetricPattern23} height - * @property {MetricPattern21} heightCount - * @property {MetricPattern23} txindexCount + * @property {MetricPattern11} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Time - * @property {MetricPattern19} date - * @property {MetricPattern19} dateindex - * @property {MetricPattern17} dateindexCount - * @property {MetricPattern10} decadeindex - * @property {MetricPattern17} firstDateindex - * @property {MetricPattern19} firstHeight - * @property {MetricPattern6} firstMonthindex - * @property {MetricPattern20} firstYearindex - * @property {MetricPattern19} heightCount - * @property {MetricPattern8} monthindex - * @property {MetricPattern6} monthindexCount - * @property {MetricPattern15} quarterindex - * @property {MetricPattern16} semesterindex - * @property {MetricPattern9} weekindex - * @property {MetricPattern18} yearindex - * @property {MetricPattern20} yearindexCount + * @typedef {Object} CatalogTree_Indexes_Height + * @property {MetricPattern12} dateindex + * @property {MetricPattern12} difficultyepoch + * @property {MetricPattern12} halvingepoch + * @property {MetricPattern12} identity + * @property {MetricPattern12} txindexCount */ /** - * @typedef {Object} CatalogTree_Indexes_Transaction - * @property {MetricPattern36} inputCount - * @property {MetricPattern36} outputCount - * @property {MetricPattern36} txindex - * @property {MetricPattern24} txinindex - * @property {MetricPattern26} txoutindex + * @typedef {Object} CatalogTree_Indexes_Monthindex + * @property {MetricPattern14} dateindexCount + * @property {MetricPattern14} firstDateindex + * @property {MetricPattern14} identity + * @property {MetricPattern14} quarterindex + * @property {MetricPattern14} semesterindex + * @property {MetricPattern14} yearindex + */ + +/** + * @typedef {Object} CatalogTree_Indexes_Quarterindex + * @property {MetricPattern26} firstMonthindex + * @property {MetricPattern26} identity + * @property {MetricPattern26} monthindexCount + */ + +/** + * @typedef {Object} CatalogTree_Indexes_Semesterindex + * @property {MetricPattern27} firstMonthindex + * @property {MetricPattern27} identity + * @property {MetricPattern27} monthindexCount + */ + +/** + * @typedef {Object} CatalogTree_Indexes_Txindex + * @property {MetricPattern28} identity + * @property {MetricPattern28} inputCount + * @property {MetricPattern28} outputCount + */ + +/** + * @typedef {Object} CatalogTree_Indexes_Weekindex + * @property {MetricPattern30} dateindexCount + * @property {MetricPattern30} firstDateindex + * @property {MetricPattern30} identity + */ + +/** + * @typedef {Object} CatalogTree_Indexes_Yearindex + * @property {MetricPattern31} decadeindex + * @property {MetricPattern31} firstMonthindex + * @property {MetricPattern31} identity + * @property {MetricPattern31} monthindexCount */ /** * @typedef {Object} CatalogTree_Inputs - * @property {CatalogTree_Inputs_Count} count - * @property {MetricPattern23} firstTxinindex - * @property {MetricPattern24} outpoint - * @property {MetricPattern24} outputtype + * @property {SizePattern} count + * @property {MetricPattern12} firstTxinindex + * @property {MetricPattern13} outpoint + * @property {MetricPattern13} outputtype * @property {CatalogTree_Inputs_Spent} spent - * @property {MetricPattern24} txindex - * @property {MetricPattern24} typeindex - */ - -/** - * @typedef {Object} CatalogTree_Inputs_Count - * @property {BlockSizePattern} count + * @property {MetricPattern13} txindex + * @property {MetricPattern13} typeindex + * @property {MetricPattern13} witnessSize */ /** * @typedef {Object} CatalogTree_Inputs_Spent - * @property {MetricPattern24} txoutindex - * @property {MetricPattern24} value + * @property {MetricPattern13} txoutindex + * @property {MetricPattern13} value */ /** @@ -4034,7 +3983,7 @@ function createRealizedPriceExtraPattern(client, acc) { * @property {MetricPattern4} daysSincePriceAth * @property {MetricPattern4} maxDaysBetweenPriceAths * @property {MetricPattern4} maxYearsBetweenPriceAths - * @property {MetricPattern3} priceAth + * @property {MetricPattern1} priceAth * @property {MetricPattern3} priceDrawdown * @property {MetricPattern4} yearsSincePriceAth */ @@ -4053,40 +4002,40 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Market_Dca_ClassStack - * @property {ActiveSupplyPattern} _2015 - * @property {ActiveSupplyPattern} _2016 - * @property {ActiveSupplyPattern} _2017 - * @property {ActiveSupplyPattern} _2018 - * @property {ActiveSupplyPattern} _2019 - * @property {ActiveSupplyPattern} _2020 - * @property {ActiveSupplyPattern} _2021 - * @property {ActiveSupplyPattern} _2022 - * @property {ActiveSupplyPattern} _2023 - * @property {ActiveSupplyPattern} _2024 - * @property {ActiveSupplyPattern} _2025 + * @property {_24hCoinbaseSumPattern} _2015 + * @property {_24hCoinbaseSumPattern} _2016 + * @property {_24hCoinbaseSumPattern} _2017 + * @property {_24hCoinbaseSumPattern} _2018 + * @property {_24hCoinbaseSumPattern} _2019 + * @property {_24hCoinbaseSumPattern} _2020 + * @property {_24hCoinbaseSumPattern} _2021 + * @property {_24hCoinbaseSumPattern} _2022 + * @property {_24hCoinbaseSumPattern} _2023 + * @property {_24hCoinbaseSumPattern} _2024 + * @property {_24hCoinbaseSumPattern} _2025 */ /** * @typedef {Object} CatalogTree_Market_Indicators - * @property {MetricPattern19} gini - * @property {MetricPattern19} macdHistogram - * @property {MetricPattern19} macdLine - * @property {MetricPattern19} macdSignal + * @property {MetricPattern7} gini + * @property {MetricPattern7} macdHistogram + * @property {MetricPattern7} macdLine + * @property {MetricPattern7} macdSignal * @property {MetricPattern4} nvt - * @property {MetricPattern19} piCycle + * @property {MetricPattern7} piCycle * @property {MetricPattern4} puellMultiple - * @property {MetricPattern19} rsi14d - * @property {MetricPattern19} rsi14dMax - * @property {MetricPattern19} rsi14dMin - * @property {MetricPattern19} rsiAverageGain14d - * @property {MetricPattern19} rsiAverageLoss14d - * @property {MetricPattern19} rsiGains - * @property {MetricPattern19} rsiLosses - * @property {MetricPattern19} stochD - * @property {MetricPattern19} stochK - * @property {MetricPattern19} stochRsi - * @property {MetricPattern19} stochRsiD - * @property {MetricPattern19} stochRsiK + * @property {MetricPattern7} rsi14d + * @property {MetricPattern7} rsi14dMax + * @property {MetricPattern7} rsi14dMin + * @property {MetricPattern7} rsiAverageGain14d + * @property {MetricPattern7} rsiAverageLoss14d + * @property {MetricPattern7} rsiGains + * @property {MetricPattern7} rsiLosses + * @property {MetricPattern7} stochD + * @property {MetricPattern7} stochK + * @property {MetricPattern7} stochRsi + * @property {MetricPattern7} stochRsiD + * @property {MetricPattern7} stochRsiK */ /** @@ -4144,8 +4093,8 @@ function createRealizedPriceExtraPattern(client, acc) { * @property {MetricPattern4} price2wChoppinessIndex * @property {MetricPattern4} price2wMax * @property {MetricPattern4} price2wMin - * @property {MetricPattern19} priceTrueRange - * @property {MetricPattern19} priceTrueRange2wSum + * @property {MetricPattern7} priceTrueRange + * @property {MetricPattern7} priceTrueRange2wSum */ /** @@ -4157,7 +4106,7 @@ function createRealizedPriceExtraPattern(client, acc) { * @property {_1dReturns1mSdPattern} downside1mSd * @property {_1dReturns1mSdPattern} downside1wSd * @property {_1dReturns1mSdPattern} downside1ySd - * @property {MetricPattern19} downsideReturns + * @property {MetricPattern7} downsideReturns * @property {PriceAgoPattern} priceReturns */ @@ -4166,39 +4115,39 @@ function createRealizedPriceExtraPattern(client, acc) { * @property {MetricPattern4} price1mVolatility * @property {MetricPattern4} price1wVolatility * @property {MetricPattern4} price1yVolatility - * @property {MetricPattern19} sharpe1m - * @property {MetricPattern19} sharpe1w - * @property {MetricPattern19} sharpe1y - * @property {MetricPattern19} sortino1m - * @property {MetricPattern19} sortino1w - * @property {MetricPattern19} sortino1y + * @property {MetricPattern7} sharpe1m + * @property {MetricPattern7} sharpe1w + * @property {MetricPattern7} sharpe1y + * @property {MetricPattern7} sortino1m + * @property {MetricPattern7} sortino1w + * @property {MetricPattern7} sortino1y */ /** * @typedef {Object} CatalogTree_Outputs * @property {CatalogTree_Outputs_Count} count - * @property {MetricPattern23} firstTxoutindex - * @property {MetricPattern26} outputtype + * @property {MetricPattern12} firstTxoutindex + * @property {MetricPattern16} outputtype * @property {CatalogTree_Outputs_Spent} spent - * @property {MetricPattern26} txindex - * @property {MetricPattern26} typeindex - * @property {MetricPattern26} value + * @property {MetricPattern16} txindex + * @property {MetricPattern16} typeindex + * @property {MetricPattern16} value */ /** * @typedef {Object} CatalogTree_Outputs_Count - * @property {BlockSizePattern} count + * @property {SizePattern} totalCount * @property {BitcoinPattern} utxoCount */ /** * @typedef {Object} CatalogTree_Outputs_Spent - * @property {MetricPattern26} txinindex + * @property {MetricPattern16} txinindex */ /** * @typedef {Object} CatalogTree_Pools - * @property {MetricPattern23} pool + * @property {MetricPattern12} pool * @property {CatalogTree_Pools_Vecs} vecs */ @@ -4366,54 +4315,40 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Positions - * @property {MetricPattern14} position + * @property {MetricPattern12} blockPosition + * @property {MetricPattern28} txPosition */ /** * @typedef {Object} CatalogTree_Price * @property {CatalogTree_Price_Cents} cents - * @property {CatalogTree_Price_Sats} sats - * @property {CatalogTree_Price_Usd} usd + * @property {SatsPattern} sats + * @property {SatsPattern} usd */ /** * @typedef {Object} CatalogTree_Price_Cents - * @property {MetricPattern7} ohlc + * @property {MetricPattern6} ohlc + * @property {CatalogTree_Price_Cents_Split} split */ /** - * @typedef {Object} CatalogTree_Price_Sats - * @property {MetricPattern1} priceCloseSats - * @property {PriceHighSatsPattern} priceHighSats - * @property {PriceHighSatsPattern} priceLowSats - * @property {MetricPattern1} priceOhlcSats - * @property {MetricPattern1} priceOpenSats - */ - -/** - * @typedef {Object} CatalogTree_Price_Usd - * @property {MetricPattern1} priceClose - * @property {MetricPattern7} priceCloseCents - * @property {PriceHighSatsPattern} priceHigh - * @property {MetricPattern7} priceHighCents - * @property {PriceHighSatsPattern} priceLow - * @property {MetricPattern7} priceLowCents - * @property {MetricPattern1} priceOhlc - * @property {MetricPattern1} priceOpen - * @property {MetricPattern7} priceOpenCents + * @typedef {Object} CatalogTree_Price_Cents_Split + * @property {DateindexPattern2} dateindex + * @property {DateindexPattern2} height */ /** * @typedef {Object} CatalogTree_Scripts * @property {CatalogTree_Scripts_Count} count - * @property {MetricPattern22} emptyToTxindex - * @property {MetricPattern23} firstEmptyoutputindex - * @property {MetricPattern23} firstOpreturnindex - * @property {MetricPattern23} firstP2msoutputindex - * @property {MetricPattern23} firstUnknownoutputindex - * @property {MetricPattern25} opreturnToTxindex - * @property {MetricPattern28} p2msToTxindex - * @property {MetricPattern37} unknownToTxindex + * @property {MetricPattern10} emptyToTxindex + * @property {MetricPattern12} firstEmptyoutputindex + * @property {MetricPattern12} firstOpreturnindex + * @property {MetricPattern12} firstP2msoutputindex + * @property {MetricPattern12} firstUnknownoutputindex + * @property {MetricPattern15} opreturnToTxindex + * @property {MetricPattern18} p2msToTxindex + * @property {MetricPattern29} unknownToTxindex * @property {CatalogTree_Scripts_Value} value */ @@ -4431,8 +4366,8 @@ function createRealizedPriceExtraPattern(client, acc) { * @property {BitcoinPattern} p2wpkh * @property {BitcoinPattern} p2wsh * @property {BitcoinPattern} segwit - * @property {SatsPattern} segwitAdoption - * @property {SatsPattern} taprootAdoption + * @property {SegwitAdoptionPattern} segwitAdoption + * @property {SegwitAdoptionPattern} taprootAdoption * @property {BitcoinPattern} unknownoutput */ @@ -4444,9 +4379,9 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Supply * @property {CatalogTree_Supply_Burned} burned - * @property {ActiveSupplyPattern} circulating + * @property {_24hCoinbaseSumPattern} circulating * @property {MetricPattern4} inflation - * @property {MetricPattern3} marketCap + * @property {MetricPattern1} marketCap * @property {CatalogTree_Supply_Velocity} velocity */ @@ -4464,67 +4399,64 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} CatalogTree_Transactions - * @property {MetricPattern36} baseSize + * @property {MetricPattern28} baseSize * @property {CatalogTree_Transactions_Count} count * @property {CatalogTree_Transactions_Fees} fees - * @property {MetricPattern23} firstTxindex - * @property {MetricPattern36} firstTxinindex - * @property {MetricPattern36} firstTxoutindex - * @property {MetricPattern36} height - * @property {MetricPattern36} isExplicitlyRbf - * @property {MetricPattern36} rawlocktime + * @property {MetricPattern12} firstTxindex + * @property {MetricPattern28} firstTxinindex + * @property {MetricPattern28} firstTxoutindex + * @property {MetricPattern28} height + * @property {MetricPattern28} isExplicitlyRbf + * @property {MetricPattern28} rawlocktime * @property {CatalogTree_Transactions_Size} size - * @property {MetricPattern36} totalSize - * @property {MetricPattern36} txid - * @property {MetricPattern36} txversion + * @property {MetricPattern28} totalSize + * @property {MetricPattern28} txid + * @property {MetricPattern28} txversion * @property {CatalogTree_Transactions_Versions} versions * @property {CatalogTree_Transactions_Volume} volume */ /** * @typedef {Object} CatalogTree_Transactions_Count - * @property {MetricPattern36} isCoinbase + * @property {MetricPattern28} isCoinbase * @property {BitcoinPattern} txCount */ /** * @typedef {Object} CatalogTree_Transactions_Fees * @property {CatalogTree_Transactions_Fees_Fee} fee - * @property {IntervalPattern} feeRate - * @property {MetricPattern36} inputValue - * @property {MetricPattern36} outputValue + * @property {FeeRatePattern} feeRate + * @property {MetricPattern28} inputValue + * @property {MetricPattern28} outputValue */ /** * @typedef {Object} CatalogTree_Transactions_Fees_Fee - * @property {BlockSizePattern} bitcoin - * @property {BlockSizePattern} dollars - * @property {BitcoinPattern} sats + * @property {SizePattern} bitcoin + * @property {SizePattern} dollars + * @property {SizePattern} sats + * @property {MetricPattern28} txindex */ /** * @typedef {Object} CatalogTree_Transactions_Size - * @property {TxVsizePattern} txVsize - * @property {TxVsizePattern} txWeight - * @property {MetricPattern36} vsize - * @property {MetricPattern36} weight + * @property {FeeRatePattern} vsize + * @property {FeeRatePattern} weight */ /** * @typedef {Object} CatalogTree_Transactions_Versions - * @property {BlockCountPattern} txV1 - * @property {BlockCountPattern} txV2 - * @property {BlockCountPattern} txV3 + * @property {BlockCountPattern} v1 + * @property {BlockCountPattern} v2 + * @property {BlockCountPattern} v3 */ /** * @typedef {Object} CatalogTree_Transactions_Volume - * @property {MetricPattern4} annualizedVolume - * @property {MetricPattern4} annualizedVolumeBtc - * @property {MetricPattern4} annualizedVolumeUsd + * @property {_24hCoinbaseSumPattern} annualizedVolume * @property {MetricPattern4} inputsPerSec * @property {MetricPattern4} outputsPerSec - * @property {ActiveSupplyPattern} sentSum + * @property {_24hCoinbaseSumPattern} sentSum * @property {MetricPattern4} txPerSec */ @@ -5443,49 +5375,59 @@ class BrkClient extends BrkClientBase { _buildTree(basePath) { return { addresses: { - firstP2aaddressindex: createMetricPattern23(this, 'first_p2aaddressindex'), - firstP2pk33addressindex: createMetricPattern23(this, 'first_p2pk33addressindex'), - firstP2pk65addressindex: createMetricPattern23(this, 'first_p2pk65addressindex'), - firstP2pkhaddressindex: createMetricPattern23(this, 'first_p2pkhaddressindex'), - firstP2shaddressindex: createMetricPattern23(this, 'first_p2shaddressindex'), - firstP2traddressindex: createMetricPattern23(this, 'first_p2traddressindex'), - firstP2wpkhaddressindex: createMetricPattern23(this, 'first_p2wpkhaddressindex'), - firstP2wshaddressindex: createMetricPattern23(this, 'first_p2wshaddressindex'), - p2abytes: createMetricPattern27(this, 'p2abytes'), - p2pk33bytes: createMetricPattern29(this, 'p2pk33bytes'), - p2pk65bytes: createMetricPattern30(this, 'p2pk65bytes'), - p2pkhbytes: createMetricPattern31(this, 'p2pkhbytes'), - p2shbytes: createMetricPattern32(this, 'p2shbytes'), - p2trbytes: createMetricPattern33(this, 'p2trbytes'), - p2wpkhbytes: createMetricPattern34(this, 'p2wpkhbytes'), - p2wshbytes: createMetricPattern35(this, 'p2wshbytes') + firstP2aaddressindex: createMetricPattern12(this, 'first_p2aaddressindex'), + firstP2pk33addressindex: createMetricPattern12(this, 'first_p2pk33addressindex'), + firstP2pk65addressindex: createMetricPattern12(this, 'first_p2pk65addressindex'), + firstP2pkhaddressindex: createMetricPattern12(this, 'first_p2pkhaddressindex'), + firstP2shaddressindex: createMetricPattern12(this, 'first_p2shaddressindex'), + firstP2traddressindex: createMetricPattern12(this, 'first_p2traddressindex'), + firstP2wpkhaddressindex: createMetricPattern12(this, 'first_p2wpkhaddressindex'), + firstP2wshaddressindex: createMetricPattern12(this, 'first_p2wshaddressindex'), + p2abytes: createMetricPattern17(this, 'p2abytes'), + p2pk33bytes: createMetricPattern19(this, 'p2pk33bytes'), + p2pk65bytes: createMetricPattern20(this, 'p2pk65bytes'), + p2pkhbytes: createMetricPattern21(this, 'p2pkhbytes'), + p2shbytes: createMetricPattern22(this, 'p2shbytes'), + p2trbytes: createMetricPattern23(this, 'p2trbytes'), + p2wpkhbytes: createMetricPattern24(this, 'p2wpkhbytes'), + p2wshbytes: createMetricPattern25(this, 'p2wshbytes') }, blocks: { - blockhash: createMetricPattern23(this, 'blockhash'), + blockhash: createMetricPattern12(this, 'blockhash'), count: { _1mBlockCount: createMetricPattern1(this, '1m_block_count'), - _1mStart: createMetricPattern23(this, '1m_start'), + _1mStart: createMetricPattern12(this, '1m_start'), _1wBlockCount: createMetricPattern1(this, '1w_block_count'), - _1wStart: createMetricPattern23(this, '1w_start'), + _1wStart: createMetricPattern12(this, '1w_start'), _1yBlockCount: createMetricPattern1(this, '1y_block_count'), - _1yStart: createMetricPattern23(this, '1y_start'), + _1yStart: createMetricPattern12(this, '1y_start'), _24hBlockCount: createMetricPattern1(this, '24h_block_count'), - _24hStart: createMetricPattern23(this, '24h_start'), + _24hStart: createMetricPattern12(this, '24h_start'), blockCount: createBlockCountPattern(this, 'block_count'), blockCountTarget: createMetricPattern4(this, 'block_count_target') }, difficulty: { - base: createMetricPattern23(this, 'difficulty'), + base: createMetricPattern12(this, 'difficulty'), blocksBeforeNextDifficultyAdjustment: createMetricPattern1(this, 'blocks_before_next_difficulty_adjustment'), daysBeforeNextDifficultyAdjustment: createMetricPattern1(this, 'days_before_next_difficulty_adjustment'), - difficultyepoch: createMetricPattern4(this, 'difficultyepoch') + epoch: createMetricPattern4(this, 'difficultyepoch') }, halving: { blocksBeforeNextHalving: createMetricPattern1(this, 'blocks_before_next_halving'), daysBeforeNextHalving: createMetricPattern1(this, 'days_before_next_halving'), - halvingepoch: createMetricPattern4(this, 'halvingepoch') + epoch: createMetricPattern4(this, 'halvingepoch') + }, + interval: { + average: createMetricPattern2(this, 'block_interval_average'), + base: createMetricPattern12(this, 'block_interval'), + max: createMetricPattern2(this, 'block_interval_max'), + median: createMetricPattern7(this, 'block_interval_median'), + min: createMetricPattern2(this, 'block_interval_min'), + pct10: createMetricPattern7(this, 'block_interval_pct10'), + pct25: createMetricPattern7(this, 'block_interval_pct25'), + pct75: createMetricPattern7(this, 'block_interval_pct75'), + pct90: createMetricPattern7(this, 'block_interval_pct90') }, - interval: createIntervalPattern(this, 'block_interval'), mining: { difficulty: createMetricPattern2(this, 'difficulty'), difficultyAdjustment: createMetricPattern1(this, 'difficulty_adjustment'), @@ -5507,32 +5449,38 @@ class BrkClient extends BrkClientBase { hashValueThsMin: createMetricPattern1(this, 'hash_value_ths_min') }, rewards: { - _24hCoinbaseSum: createMetricPattern23(this, '24h_coinbase_sum'), - _24hCoinbaseUsdSum: createMetricPattern23(this, '24h_coinbase_usd_sum'), + _24hCoinbaseSum: create_24hCoinbaseSumPattern(this, '24h_coinbase_sum'), coinbase: createCoinbasePattern(this, 'coinbase'), - feeDominance: createMetricPattern19(this, 'fee_dominance'), + feeDominance: createMetricPattern7(this, 'fee_dominance'), subsidy: createCoinbasePattern(this, 'subsidy'), - subsidyDominance: createMetricPattern19(this, 'subsidy_dominance'), + subsidyDominance: createMetricPattern7(this, 'subsidy_dominance'), subsidyUsd1ySma: createMetricPattern4(this, 'subsidy_usd_1y_sma'), unclaimedRewards: createUnclaimedRewardsPattern(this, 'unclaimed_rewards') }, size: { - blockSize: createBlockSizePattern(this, 'block_size'), - blockVbytes: createBlockSizePattern(this, 'block_vbytes'), - vbytes: createMetricPattern23(this, 'vbytes') + size: createSizePattern(this, 'block_size'), + vbytes: { + average: createMetricPattern2(this, 'block_vbytes_average'), + base: createMetricPattern12(this, 'block_vbytes'), + cumulative: createMetricPattern1(this, 'block_vbytes_cumulative'), + max: createMetricPattern2(this, 'block_vbytes_max'), + min: createMetricPattern2(this, 'block_vbytes_min'), + percentiles: createPercentilesPattern(this, 'block_vbytes'), + sum: createMetricPattern2(this, 'block_vbytes_sum') + } }, time: { - date: createMetricPattern23(this, 'date'), - dateFixed: createMetricPattern23(this, 'date_fixed'), + date: createMetricPattern12(this, 'date'), + dateFixed: createMetricPattern12(this, 'date_fixed'), timestamp: createMetricPattern2(this, 'timestamp'), - timestampFixed: createMetricPattern23(this, 'timestamp_fixed') + timestampFixed: createMetricPattern12(this, 'timestamp_fixed') }, - timestamp: createMetricPattern23(this, 'timestamp'), - totalSize: createMetricPattern23(this, 'total_size'), + timestamp: createMetricPattern12(this, 'timestamp'), + totalSize: createMetricPattern12(this, 'total_size'), weight: { - base: createMetricPattern23(this, 'weight'), - blockFullness: createBitcoinPattern(this, 'block_fullness'), - blockWeight: createBlockSizePattern(this, 'block_weight') + base: createMetricPattern12(this, 'weight'), + fullness: createBitcoinPattern(this, 'block_fullness'), + weight: createSizePattern(this, 'block_weight') } }, cointime: { @@ -5566,8 +5514,8 @@ class BrkClient extends BrkClientBase { vaultedPriceRatio: createActivePriceRatioPattern(this, 'vaulted_price_ratio') }, supply: { - activeSupply: createActiveSupplyPattern(this, 'active_supply'), - vaultedSupply: createActiveSupplyPattern(this, 'vaulted_supply') + activeSupply: create_24hCoinbaseSumPattern(this, 'active_supply'), + vaultedSupply: create_24hCoinbaseSumPattern(this, 'vaulted_supply') }, value: { cointimeValueCreated: createBlockCountPattern(this, 'cointime_value_created'), @@ -5647,23 +5595,23 @@ class BrkClient extends BrkClientBase { } }, addressesData: { - empty: createMetricPattern39(this, 'emptyaddressdata'), - loaded: createMetricPattern38(this, 'loadedaddressdata') + empty: createMetricPattern33(this, 'emptyaddressdata'), + loaded: createMetricPattern32(this, 'loadedaddressdata') }, anyAddressIndexes: { - p2a: createMetricPattern27(this, 'anyaddressindex'), - p2pk33: createMetricPattern29(this, 'anyaddressindex'), - p2pk65: createMetricPattern30(this, 'anyaddressindex'), - p2pkh: createMetricPattern31(this, 'anyaddressindex'), - p2sh: createMetricPattern32(this, 'anyaddressindex'), - p2tr: createMetricPattern33(this, 'anyaddressindex'), - p2wpkh: createMetricPattern34(this, 'anyaddressindex'), - p2wsh: createMetricPattern35(this, 'anyaddressindex') + p2a: createMetricPattern17(this, 'anyaddressindex'), + p2pk33: createMetricPattern19(this, 'anyaddressindex'), + p2pk65: createMetricPattern20(this, 'anyaddressindex'), + p2pkh: createMetricPattern21(this, 'anyaddressindex'), + p2sh: createMetricPattern22(this, 'anyaddressindex'), + p2tr: createMetricPattern23(this, 'anyaddressindex'), + p2wpkh: createMetricPattern24(this, 'anyaddressindex'), + p2wsh: createMetricPattern25(this, 'anyaddressindex') }, - chainState: createMetricPattern23(this, 'chain'), + chainState: createMetricPattern12(this, 'chain'), emptyAddrCount: createAddrCountPattern(this, 'empty_addr_count'), - emptyaddressindex: createMetricPattern39(this, 'emptyaddressindex'), - loadedaddressindex: createMetricPattern38(this, 'loadedaddressindex'), + emptyaddressindex: createMetricPattern33(this, 'emptyaddressindex'), + loadedaddressindex: createMetricPattern32(this, 'loadedaddressindex'), utxoCohorts: { ageRange: { _10yTo12y: create_10yTo12yPattern(this, 'utxos_at_least_10y_up_to_12y_old'), @@ -5691,16 +5639,17 @@ class BrkClient extends BrkClientBase { all: { activity: createActivityPattern2(this, ''), costBasis: createCostBasisPattern2(this, ''), + outputs: createOutputsPattern(this, 'utxo_count'), realized: createRealizedPattern3(this, ''), relative: { - negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern3(this, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl'), - netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern3(this, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl'), - supplyInLossRelToOwnSupply: createMetricPattern3(this, 'supply_in_loss_rel_to_own_supply'), - supplyInProfitRelToOwnSupply: createMetricPattern3(this, 'supply_in_profit_rel_to_own_supply'), - unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern3(this, 'unrealized_loss_rel_to_own_total_unrealized_pnl'), - unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern3(this, 'unrealized_profit_rel_to_own_total_unrealized_pnl') + negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl'), + netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl'), + supplyInLossRelToOwnSupply: createMetricPattern1(this, 'supply_in_loss_rel_to_own_supply'), + supplyInProfitRelToOwnSupply: createMetricPattern1(this, 'supply_in_profit_rel_to_own_supply'), + unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'unrealized_loss_rel_to_own_total_unrealized_pnl'), + unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'unrealized_profit_rel_to_own_total_unrealized_pnl') }, - supply: createSupplyPattern2(this, ''), + supply: createSupplyPattern2(this, 'supply'), unrealized: createUnrealizedPattern(this, '') }, amountRange: { @@ -5801,17 +5750,19 @@ class BrkClient extends BrkClientBase { long: { activity: createActivityPattern2(this, 'lth'), costBasis: createCostBasisPattern2(this, 'lth'), + outputs: createOutputsPattern(this, 'lth_utxo_count'), realized: createRealizedPattern2(this, 'lth'), relative: createRelativePattern5(this, 'lth'), - supply: createSupplyPattern2(this, 'lth'), + supply: createSupplyPattern2(this, 'lth_supply'), unrealized: createUnrealizedPattern(this, 'lth') }, short: { activity: createActivityPattern2(this, 'sth'), costBasis: createCostBasisPattern2(this, 'sth'), + outputs: createOutputsPattern(this, 'sth_utxo_count'), realized: createRealizedPattern3(this, 'sth'), relative: createRelativePattern5(this, 'sth'), - supply: createSupplyPattern2(this, 'sth'), + supply: createSupplyPattern2(this, 'sth_supply'), unrealized: createUnrealizedPattern(this, 'sth') } }, @@ -5852,74 +5803,104 @@ class BrkClient extends BrkClientBase { }, indexes: { address: { - emptyoutputindex: createMetricPattern22(this, 'emptyoutputindex'), - opreturnindex: createMetricPattern25(this, 'opreturnindex'), - p2aaddressindex: createMetricPattern27(this, 'p2aaddressindex'), - p2msoutputindex: createMetricPattern28(this, 'p2msoutputindex'), - p2pk33addressindex: createMetricPattern29(this, 'p2pk33addressindex'), - p2pk65addressindex: createMetricPattern30(this, 'p2pk65addressindex'), - p2pkhaddressindex: createMetricPattern31(this, 'p2pkhaddressindex'), - p2shaddressindex: createMetricPattern32(this, 'p2shaddressindex'), - p2traddressindex: createMetricPattern33(this, 'p2traddressindex'), - p2wpkhaddressindex: createMetricPattern34(this, 'p2wpkhaddressindex'), - p2wshaddressindex: createMetricPattern35(this, 'p2wshaddressindex'), - unknownoutputindex: createMetricPattern37(this, 'unknownoutputindex') + empty: createEmptyPattern(this, 'emptyoutputindex'), + opreturn: createEmptyPattern(this, 'opreturnindex'), + p2a: createEmptyPattern(this, 'p2aaddressindex'), + p2ms: createEmptyPattern(this, 'p2msoutputindex'), + p2pk33: createEmptyPattern(this, 'p2pk33addressindex'), + p2pk65: createEmptyPattern(this, 'p2pk65addressindex'), + p2pkh: createEmptyPattern(this, 'p2pkhaddressindex'), + p2sh: createEmptyPattern(this, 'p2shaddressindex'), + p2tr: createEmptyPattern(this, 'p2traddressindex'), + p2wpkh: createEmptyPattern(this, 'p2wpkhaddressindex'), + p2wsh: createEmptyPattern(this, 'p2wshaddressindex'), + unknown: createEmptyPattern(this, 'unknownoutputindex') }, - block: { - dateindex: createMetricPattern23(this, 'dateindex'), - difficultyepoch: createMetricPattern12(this, 'difficultyepoch'), - firstHeight: createMetricPattern11(this, 'first_height'), - halvingepoch: createMetricPattern13(this, 'halvingepoch'), - height: createMetricPattern23(this, 'height'), - heightCount: createMetricPattern21(this, 'height_count'), - txindexCount: createMetricPattern23(this, 'txindex_count') + dateindex: { + date: createMetricPattern7(this, 'dateindex_date'), + firstHeight: createMetricPattern7(this, 'dateindex_first_height'), + heightCount: createMetricPattern7(this, 'dateindex_height_count'), + identity: createMetricPattern7(this, 'dateindex'), + monthindex: createMetricPattern7(this, 'dateindex_monthindex'), + weekindex: createMetricPattern7(this, 'dateindex_weekindex') }, - time: { - date: createMetricPattern19(this, 'date'), - dateindex: createMetricPattern19(this, 'dateindex'), - dateindexCount: createMetricPattern17(this, 'dateindex_count'), - decadeindex: createMetricPattern10(this, 'decadeindex'), - firstDateindex: createMetricPattern17(this, 'first_dateindex'), - firstHeight: createMetricPattern19(this, 'first_height'), - firstMonthindex: createMetricPattern6(this, 'first_monthindex'), - firstYearindex: createMetricPattern20(this, 'first_yearindex'), - heightCount: createMetricPattern19(this, 'height_count'), - monthindex: createMetricPattern8(this, 'monthindex'), - monthindexCount: createMetricPattern6(this, 'monthindex_count'), - quarterindex: createMetricPattern15(this, 'quarterindex'), - semesterindex: createMetricPattern16(this, 'semesterindex'), - weekindex: createMetricPattern9(this, 'weekindex'), - yearindex: createMetricPattern18(this, 'yearindex'), - yearindexCount: createMetricPattern20(this, 'yearindex_count') + decadeindex: { + firstYearindex: createMetricPattern8(this, 'decadeindex_first_yearindex'), + identity: createMetricPattern8(this, 'decadeindex'), + yearindexCount: createMetricPattern8(this, 'decadeindex_yearindex_count') }, - transaction: { - inputCount: createMetricPattern36(this, 'input_count'), - outputCount: createMetricPattern36(this, 'output_count'), - txindex: createMetricPattern36(this, 'txindex'), - txinindex: createMetricPattern24(this, 'txinindex'), - txoutindex: createMetricPattern26(this, 'txoutindex') + difficultyepoch: { + firstHeight: createMetricPattern9(this, 'difficultyepoch_first_height'), + heightCount: createMetricPattern9(this, 'difficultyepoch_height_count'), + identity: createMetricPattern9(this, 'difficultyepoch') + }, + halvingepoch: { + firstHeight: createMetricPattern11(this, 'halvingepoch_first_height'), + identity: createMetricPattern11(this, 'halvingepoch') + }, + height: { + dateindex: createMetricPattern12(this, 'height_dateindex'), + difficultyepoch: createMetricPattern12(this, 'height_difficultyepoch'), + halvingepoch: createMetricPattern12(this, 'height_halvingepoch'), + identity: createMetricPattern12(this, 'height'), + txindexCount: createMetricPattern12(this, 'height_txindex_count') + }, + monthindex: { + dateindexCount: createMetricPattern14(this, 'monthindex_dateindex_count'), + firstDateindex: createMetricPattern14(this, 'monthindex_first_dateindex'), + identity: createMetricPattern14(this, 'monthindex'), + quarterindex: createMetricPattern14(this, 'monthindex_quarterindex'), + semesterindex: createMetricPattern14(this, 'monthindex_semesterindex'), + yearindex: createMetricPattern14(this, 'monthindex_yearindex') + }, + quarterindex: { + firstMonthindex: createMetricPattern26(this, 'quarterindex_first_monthindex'), + identity: createMetricPattern26(this, 'quarterindex'), + monthindexCount: createMetricPattern26(this, 'quarterindex_monthindex_count') + }, + semesterindex: { + firstMonthindex: createMetricPattern27(this, 'semesterindex_first_monthindex'), + identity: createMetricPattern27(this, 'semesterindex'), + monthindexCount: createMetricPattern27(this, 'semesterindex_monthindex_count') + }, + txindex: { + identity: createMetricPattern28(this, 'txindex'), + inputCount: createMetricPattern28(this, 'txindex_input_count'), + outputCount: createMetricPattern28(this, 'txindex_output_count') + }, + txinindex: createEmptyPattern(this, 'txinindex'), + txoutindex: createEmptyPattern(this, 'txoutindex'), + weekindex: { + dateindexCount: createMetricPattern30(this, 'weekindex_dateindex_count'), + firstDateindex: createMetricPattern30(this, 'weekindex_first_dateindex'), + identity: createMetricPattern30(this, 'weekindex') + }, + yearindex: { + decadeindex: createMetricPattern31(this, 'yearindex_decadeindex'), + firstMonthindex: createMetricPattern31(this, 'yearindex_first_monthindex'), + identity: createMetricPattern31(this, 'yearindex'), + monthindexCount: createMetricPattern31(this, 'yearindex_monthindex_count') } }, inputs: { - count: { - count: createBlockSizePattern(this, 'input_count') - }, - firstTxinindex: createMetricPattern23(this, 'first_txinindex'), - outpoint: createMetricPattern24(this, 'outpoint'), - outputtype: createMetricPattern24(this, 'outputtype'), + count: createSizePattern(this, 'input_count'), + firstTxinindex: createMetricPattern12(this, 'first_txinindex'), + outpoint: createMetricPattern13(this, 'outpoint'), + outputtype: createMetricPattern13(this, 'outputtype'), spent: { - txoutindex: createMetricPattern24(this, 'txoutindex'), - value: createMetricPattern24(this, 'value') + txoutindex: createMetricPattern13(this, 'txoutindex'), + value: createMetricPattern13(this, 'value') }, - txindex: createMetricPattern24(this, 'txindex'), - typeindex: createMetricPattern24(this, 'typeindex') + txindex: createMetricPattern13(this, 'txindex'), + typeindex: createMetricPattern13(this, 'typeindex'), + witnessSize: createMetricPattern13(this, 'witness_size') }, market: { ath: { daysSincePriceAth: createMetricPattern4(this, 'days_since_price_ath'), maxDaysBetweenPriceAths: createMetricPattern4(this, 'max_days_between_price_aths'), maxYearsBetweenPriceAths: createMetricPattern4(this, 'max_years_between_price_aths'), - priceAth: createMetricPattern3(this, 'price_ath'), + priceAth: createMetricPattern1(this, 'price_ath'), priceDrawdown: createMetricPattern3(this, 'price_drawdown'), yearsSincePriceAth: createMetricPattern4(this, 'years_since_price_ath') }, @@ -5927,17 +5908,17 @@ class BrkClient extends BrkClientBase { classAveragePrice: createClassAveragePricePattern(this, 'dca_class'), classReturns: createClassAveragePricePattern(this, 'dca_class'), classStack: { - _2015: createActiveSupplyPattern(this, 'dca_class_2015_stack'), - _2016: createActiveSupplyPattern(this, 'dca_class_2016_stack'), - _2017: createActiveSupplyPattern(this, 'dca_class_2017_stack'), - _2018: createActiveSupplyPattern(this, 'dca_class_2018_stack'), - _2019: createActiveSupplyPattern(this, 'dca_class_2019_stack'), - _2020: createActiveSupplyPattern(this, 'dca_class_2020_stack'), - _2021: createActiveSupplyPattern(this, 'dca_class_2021_stack'), - _2022: createActiveSupplyPattern(this, 'dca_class_2022_stack'), - _2023: createActiveSupplyPattern(this, 'dca_class_2023_stack'), - _2024: createActiveSupplyPattern(this, 'dca_class_2024_stack'), - _2025: createActiveSupplyPattern(this, 'dca_class_2025_stack') + _2015: create_24hCoinbaseSumPattern(this, 'dca_class_2015_stack'), + _2016: create_24hCoinbaseSumPattern(this, 'dca_class_2016_stack'), + _2017: create_24hCoinbaseSumPattern(this, 'dca_class_2017_stack'), + _2018: create_24hCoinbaseSumPattern(this, 'dca_class_2018_stack'), + _2019: create_24hCoinbaseSumPattern(this, 'dca_class_2019_stack'), + _2020: create_24hCoinbaseSumPattern(this, 'dca_class_2020_stack'), + _2021: create_24hCoinbaseSumPattern(this, 'dca_class_2021_stack'), + _2022: create_24hCoinbaseSumPattern(this, 'dca_class_2022_stack'), + _2023: create_24hCoinbaseSumPattern(this, 'dca_class_2023_stack'), + _2024: create_24hCoinbaseSumPattern(this, 'dca_class_2024_stack'), + _2025: create_24hCoinbaseSumPattern(this, 'dca_class_2025_stack') }, periodAveragePrice: createPeriodAveragePricePattern(this, 'dca_average_price'), periodCagr: createPeriodCagrPattern(this, 'dca_cagr'), @@ -5946,25 +5927,25 @@ class BrkClient extends BrkClientBase { periodStack: createPeriodLumpSumStackPattern(this, '') }, indicators: { - gini: createMetricPattern19(this, 'gini'), - macdHistogram: createMetricPattern19(this, 'macd_histogram'), - macdLine: createMetricPattern19(this, 'macd_line'), - macdSignal: createMetricPattern19(this, 'macd_signal'), + gini: createMetricPattern7(this, 'gini'), + macdHistogram: createMetricPattern7(this, 'macd_histogram'), + macdLine: createMetricPattern7(this, 'macd_line'), + macdSignal: createMetricPattern7(this, 'macd_signal'), nvt: createMetricPattern4(this, 'nvt'), - piCycle: createMetricPattern19(this, 'pi_cycle'), + piCycle: createMetricPattern7(this, 'pi_cycle'), puellMultiple: createMetricPattern4(this, 'puell_multiple'), - rsi14d: createMetricPattern19(this, 'rsi_14d'), - rsi14dMax: createMetricPattern19(this, 'rsi_14d_max'), - rsi14dMin: createMetricPattern19(this, 'rsi_14d_min'), - rsiAverageGain14d: createMetricPattern19(this, 'rsi_average_gain_14d'), - rsiAverageLoss14d: createMetricPattern19(this, 'rsi_average_loss_14d'), - rsiGains: createMetricPattern19(this, 'rsi_gains'), - rsiLosses: createMetricPattern19(this, 'rsi_losses'), - stochD: createMetricPattern19(this, 'stoch_d'), - stochK: createMetricPattern19(this, 'stoch_k'), - stochRsi: createMetricPattern19(this, 'stoch_rsi'), - stochRsiD: createMetricPattern19(this, 'stoch_rsi_d'), - stochRsiK: createMetricPattern19(this, 'stoch_rsi_k') + rsi14d: createMetricPattern7(this, 'rsi_14d'), + rsi14dMax: createMetricPattern7(this, 'rsi_14d_max'), + rsi14dMin: createMetricPattern7(this, 'rsi_14d_min'), + rsiAverageGain14d: createMetricPattern7(this, 'rsi_average_gain_14d'), + rsiAverageLoss14d: createMetricPattern7(this, 'rsi_average_loss_14d'), + rsiGains: createMetricPattern7(this, 'rsi_gains'), + rsiLosses: createMetricPattern7(this, 'rsi_losses'), + stochD: createMetricPattern7(this, 'stoch_d'), + stochK: createMetricPattern7(this, 'stoch_k'), + stochRsi: createMetricPattern7(this, 'stoch_rsi'), + stochRsiD: createMetricPattern7(this, 'stoch_rsi_d'), + stochRsiK: createMetricPattern7(this, 'stoch_rsi_k') }, lookback: { priceAgo: createPriceAgoPattern(this, 'price') @@ -6016,8 +5997,8 @@ class BrkClient extends BrkClientBase { price2wChoppinessIndex: createMetricPattern4(this, 'price_2w_choppiness_index'), price2wMax: createMetricPattern4(this, 'price_2w_max'), price2wMin: createMetricPattern4(this, 'price_2w_min'), - priceTrueRange: createMetricPattern19(this, 'price_true_range'), - priceTrueRange2wSum: createMetricPattern19(this, 'price_true_range_2w_sum') + priceTrueRange: createMetricPattern7(this, 'price_true_range'), + priceTrueRange2wSum: createMetricPattern7(this, 'price_true_range_2w_sum') }, returns: { _1dReturns1mSd: create_1dReturns1mSdPattern(this, '1d_returns_1m_sd'), @@ -6027,37 +6008,37 @@ class BrkClient extends BrkClientBase { downside1mSd: create_1dReturns1mSdPattern(this, 'downside_1m_sd'), downside1wSd: create_1dReturns1mSdPattern(this, 'downside_1w_sd'), downside1ySd: create_1dReturns1mSdPattern(this, 'downside_1y_sd'), - downsideReturns: createMetricPattern19(this, 'downside_returns'), + downsideReturns: createMetricPattern7(this, 'downside_returns'), priceReturns: createPriceAgoPattern(this, 'price_returns') }, volatility: { price1mVolatility: createMetricPattern4(this, 'price_1m_volatility'), price1wVolatility: createMetricPattern4(this, 'price_1w_volatility'), price1yVolatility: createMetricPattern4(this, 'price_1y_volatility'), - sharpe1m: createMetricPattern19(this, 'sharpe_1m'), - sharpe1w: createMetricPattern19(this, 'sharpe_1w'), - sharpe1y: createMetricPattern19(this, 'sharpe_1y'), - sortino1m: createMetricPattern19(this, 'sortino_1m'), - sortino1w: createMetricPattern19(this, 'sortino_1w'), - sortino1y: createMetricPattern19(this, 'sortino_1y') + sharpe1m: createMetricPattern7(this, 'sharpe_1m'), + sharpe1w: createMetricPattern7(this, 'sharpe_1w'), + sharpe1y: createMetricPattern7(this, 'sharpe_1y'), + sortino1m: createMetricPattern7(this, 'sortino_1m'), + sortino1w: createMetricPattern7(this, 'sortino_1w'), + sortino1y: createMetricPattern7(this, 'sortino_1y') } }, outputs: { count: { - count: createBlockSizePattern(this, 'output_count'), + totalCount: createSizePattern(this, 'output_count'), utxoCount: createBitcoinPattern(this, 'exact_utxo_count') }, - firstTxoutindex: createMetricPattern23(this, 'first_txoutindex'), - outputtype: createMetricPattern26(this, 'outputtype'), + firstTxoutindex: createMetricPattern12(this, 'first_txoutindex'), + outputtype: createMetricPattern16(this, 'outputtype'), spent: { - txinindex: createMetricPattern26(this, 'txinindex') + txinindex: createMetricPattern16(this, 'txinindex') }, - txindex: createMetricPattern26(this, 'txindex'), - typeindex: createMetricPattern26(this, 'typeindex'), - value: createMetricPattern26(this, 'value') + txindex: createMetricPattern16(this, 'txindex'), + typeindex: createMetricPattern16(this, 'typeindex'), + value: createMetricPattern16(this, 'value') }, pools: { - pool: createMetricPattern23(this, 'pool'), + pool: createMetricPattern12(this, 'pool'), vecs: { aaopool: createAaopoolPattern(this, 'aaopool'), antpool: createAaopoolPattern(this, 'antpool'), @@ -6220,30 +6201,19 @@ class BrkClient extends BrkClientBase { } }, positions: { - position: createMetricPattern14(this, 'position') + blockPosition: createMetricPattern12(this, 'position'), + txPosition: createMetricPattern28(this, 'position') }, price: { cents: { - ohlc: createMetricPattern7(this, 'ohlc_cents') + ohlc: createMetricPattern6(this, 'ohlc_cents'), + split: { + dateindex: createDateindexPattern2(this, 'price'), + height: createDateindexPattern2(this, 'price') + } }, - sats: { - priceCloseSats: createMetricPattern1(this, 'price_close_sats'), - priceHighSats: createPriceHighSatsPattern(this, 'price_high_sats'), - priceLowSats: createPriceHighSatsPattern(this, 'price_low_sats'), - priceOhlcSats: createMetricPattern1(this, 'price_ohlc_sats'), - priceOpenSats: createMetricPattern1(this, 'price_open_sats') - }, - usd: { - priceClose: createMetricPattern1(this, 'price_close'), - priceCloseCents: createMetricPattern7(this, 'price_close_cents'), - priceHigh: createPriceHighSatsPattern(this, 'price_high'), - priceHighCents: createMetricPattern7(this, 'price_high_cents'), - priceLow: createPriceHighSatsPattern(this, 'price_low'), - priceLowCents: createMetricPattern7(this, 'price_low_cents'), - priceOhlc: createMetricPattern1(this, 'price_ohlc'), - priceOpen: createMetricPattern1(this, 'price_open'), - priceOpenCents: createMetricPattern7(this, 'price_open_cents') - } + sats: createSatsPattern(this, 'price'), + usd: createSatsPattern(this, 'price') }, scripts: { count: { @@ -6259,18 +6229,18 @@ class BrkClient extends BrkClientBase { p2wpkh: createBitcoinPattern(this, 'p2wpkh_count'), p2wsh: createBitcoinPattern(this, 'p2wsh_count'), segwit: createBitcoinPattern(this, 'segwit_count'), - segwitAdoption: createSatsPattern(this, 'segwit_adoption'), - taprootAdoption: createSatsPattern(this, 'taproot_adoption'), + segwitAdoption: createSegwitAdoptionPattern(this, 'segwit_adoption'), + taprootAdoption: createSegwitAdoptionPattern(this, 'taproot_adoption'), unknownoutput: createBitcoinPattern(this, 'unknownoutput_count') }, - emptyToTxindex: createMetricPattern22(this, 'txindex'), - firstEmptyoutputindex: createMetricPattern23(this, 'first_emptyoutputindex'), - firstOpreturnindex: createMetricPattern23(this, 'first_opreturnindex'), - firstP2msoutputindex: createMetricPattern23(this, 'first_p2msoutputindex'), - firstUnknownoutputindex: createMetricPattern23(this, 'first_unknownoutputindex'), - opreturnToTxindex: createMetricPattern25(this, 'txindex'), - p2msToTxindex: createMetricPattern28(this, 'txindex'), - unknownToTxindex: createMetricPattern37(this, 'txindex'), + emptyToTxindex: createMetricPattern10(this, 'txindex'), + firstEmptyoutputindex: createMetricPattern12(this, 'first_emptyoutputindex'), + firstOpreturnindex: createMetricPattern12(this, 'first_opreturnindex'), + firstP2msoutputindex: createMetricPattern12(this, 'first_p2msoutputindex'), + firstUnknownoutputindex: createMetricPattern12(this, 'first_unknownoutputindex'), + opreturnToTxindex: createMetricPattern15(this, 'txindex'), + p2msToTxindex: createMetricPattern18(this, 'txindex'), + unknownToTxindex: createMetricPattern29(this, 'txindex'), value: { opreturn: createCoinbasePattern(this, 'opreturn_value') } @@ -6280,57 +6250,54 @@ class BrkClient extends BrkClientBase { opreturn: createUnclaimedRewardsPattern(this, 'opreturn_supply'), unspendable: createUnclaimedRewardsPattern(this, 'unspendable_supply') }, - circulating: createActiveSupplyPattern(this, 'circulating'), + circulating: create_24hCoinbaseSumPattern(this, 'circulating_supply'), inflation: createMetricPattern4(this, 'inflation_rate'), - marketCap: createMetricPattern3(this, 'market_cap'), + marketCap: createMetricPattern1(this, 'market_cap'), velocity: { btc: createMetricPattern4(this, 'btc_velocity'), usd: createMetricPattern4(this, 'usd_velocity') } }, transactions: { - baseSize: createMetricPattern36(this, 'base_size'), + baseSize: createMetricPattern28(this, 'base_size'), count: { - isCoinbase: createMetricPattern36(this, 'is_coinbase'), + isCoinbase: createMetricPattern28(this, 'is_coinbase'), txCount: createBitcoinPattern(this, 'tx_count') }, fees: { fee: { - bitcoin: createBlockSizePattern(this, 'fee_btc'), - dollars: createBlockSizePattern(this, 'fee_usd'), - sats: createBitcoinPattern(this, 'fee') + bitcoin: createSizePattern(this, 'fee_btc'), + dollars: createSizePattern(this, 'fee_usd'), + sats: createSizePattern(this, 'fee'), + txindex: createMetricPattern28(this, 'fee') }, - feeRate: createIntervalPattern(this, 'fee_rate'), - inputValue: createMetricPattern36(this, 'input_value'), - outputValue: createMetricPattern36(this, 'output_value') + feeRate: createFeeRatePattern(this, 'fee_rate'), + inputValue: createMetricPattern28(this, 'input_value'), + outputValue: createMetricPattern28(this, 'output_value') }, - firstTxindex: createMetricPattern23(this, 'first_txindex'), - firstTxinindex: createMetricPattern36(this, 'first_txinindex'), - firstTxoutindex: createMetricPattern36(this, 'first_txoutindex'), - height: createMetricPattern36(this, 'height'), - isExplicitlyRbf: createMetricPattern36(this, 'is_explicitly_rbf'), - rawlocktime: createMetricPattern36(this, 'rawlocktime'), + firstTxindex: createMetricPattern12(this, 'first_txindex'), + firstTxinindex: createMetricPattern28(this, 'first_txinindex'), + firstTxoutindex: createMetricPattern28(this, 'first_txoutindex'), + height: createMetricPattern28(this, 'height'), + isExplicitlyRbf: createMetricPattern28(this, 'is_explicitly_rbf'), + rawlocktime: createMetricPattern28(this, 'rawlocktime'), size: { - txVsize: createTxVsizePattern(this, 'tx_vsize'), - txWeight: createTxVsizePattern(this, 'tx_weight'), - vsize: createMetricPattern36(this, 'vsize'), - weight: createMetricPattern36(this, 'weight') + vsize: createFeeRatePattern(this, ''), + weight: createFeeRatePattern(this, '') }, - totalSize: createMetricPattern36(this, 'total_size'), - txid: createMetricPattern36(this, 'txid'), - txversion: createMetricPattern36(this, 'txversion'), + totalSize: createMetricPattern28(this, 'total_size'), + txid: createMetricPattern28(this, 'txid'), + txversion: createMetricPattern28(this, 'txversion'), versions: { - txV1: createBlockCountPattern(this, 'tx_v1'), - txV2: createBlockCountPattern(this, 'tx_v2'), - txV3: createBlockCountPattern(this, 'tx_v3') + v1: createBlockCountPattern(this, 'tx_v1'), + v2: createBlockCountPattern(this, 'tx_v2'), + v3: createBlockCountPattern(this, 'tx_v3') }, volume: { - annualizedVolume: createMetricPattern4(this, 'annualized_volume'), - annualizedVolumeBtc: createMetricPattern4(this, 'annualized_volume_btc'), - annualizedVolumeUsd: createMetricPattern4(this, 'annualized_volume_usd'), + annualizedVolume: create_24hCoinbaseSumPattern(this, 'annualized_volume'), inputsPerSec: createMetricPattern4(this, 'inputs_per_sec'), outputsPerSec: createMetricPattern4(this, 'outputs_per_sec'), - sentSum: createActiveSupplyPattern(this, 'sent_sum'), + sentSum: create_24hCoinbaseSumPattern(this, 'sent_sum'), txPerSec: createMetricPattern4(this, 'tx_per_sec') } } diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index bd31cc685..f778e31ca 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -561,7 +561,7 @@ class MetricPattern(Protocol[T]): class _MetricPattern1By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -595,7 +595,7 @@ class _MetricPattern1By(Generic[T]): class MetricPattern1(Generic[T]): """Index accessor for metrics with 9 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -625,7 +625,7 @@ class MetricPattern1(Generic[T]): class _MetricPattern2By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -656,7 +656,7 @@ class _MetricPattern2By(Generic[T]): class MetricPattern2(Generic[T]): """Index accessor for metrics with 8 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -685,7 +685,7 @@ class MetricPattern2(Generic[T]): class _MetricPattern3By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -716,7 +716,7 @@ class _MetricPattern3By(Generic[T]): class MetricPattern3(Generic[T]): """Index accessor for metrics with 8 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -745,7 +745,7 @@ class MetricPattern3(Generic[T]): class _MetricPattern4By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -773,7 +773,7 @@ class _MetricPattern4By(Generic[T]): class MetricPattern4(Generic[T]): """Index accessor for metrics with 7 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -801,7 +801,7 @@ class MetricPattern4(Generic[T]): class _MetricPattern5By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -826,7 +826,7 @@ class _MetricPattern5By(Generic[T]): class MetricPattern5(Generic[T]): """Index accessor for metrics with 6 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -853,47 +853,7 @@ class MetricPattern5(Generic[T]): class _MetricPattern6By(Generic[T]): """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_quarterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'quarterindex') - - def by_semesterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'semesterindex') - - def by_yearindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'yearindex') - -class MetricPattern6(Generic[T]): - """Index accessor for metrics with 3 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern6By[T] = _MetricPattern6By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['quarterindex', 'semesterindex', 'yearindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'quarterindex': return self.by.by_quarterindex() - elif index == 'semesterindex': return self.by.by_semesterindex() - elif index == 'yearindex': return self.by.by_yearindex() - return None - -class _MetricPattern7By(Generic[T]): - """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -904,13 +864,13 @@ class _MetricPattern7By(Generic[T]): def by_height(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'height') -class MetricPattern7(Generic[T]): +class MetricPattern6(Generic[T]): """Index accessor for metrics with 2 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern7By[T] = _MetricPattern7By(client, name) + self.by: _MetricPattern6By[T] = _MetricPattern6By(client, name) @property def name(self) -> str: @@ -927,9 +887,9 @@ class MetricPattern7(Generic[T]): elif index == 'height': return self.by.by_height() return None -class _MetricPattern8By(Generic[T]): +class _MetricPattern7By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -937,409 +897,13 @@ class _MetricPattern8By(Generic[T]): def by_dateindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'dateindex') - def by_monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'monthindex') - -class MetricPattern8(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern8By[T] = _MetricPattern8By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['dateindex', 'monthindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'dateindex': return self.by.by_dateindex() - elif index == 'monthindex': return self.by.by_monthindex() - return None - -class _MetricPattern9By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_dateindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'dateindex') - - def by_weekindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'weekindex') - -class MetricPattern9(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern9By[T] = _MetricPattern9By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['dateindex', 'weekindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'dateindex': return self.by.by_dateindex() - elif index == 'weekindex': return self.by.by_weekindex() - return None - -class _MetricPattern10By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_decadeindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'decadeindex') - - def by_yearindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'yearindex') - -class MetricPattern10(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern10By[T] = _MetricPattern10By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['decadeindex', 'yearindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'decadeindex': return self.by.by_decadeindex() - elif index == 'yearindex': return self.by.by_yearindex() - return None - -class _MetricPattern11By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_difficultyepoch(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'difficultyepoch') - - def by_halvingepoch(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'halvingepoch') - -class MetricPattern11(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern11By[T] = _MetricPattern11By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['difficultyepoch', 'halvingepoch'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'difficultyepoch': return self.by.by_difficultyepoch() - elif index == 'halvingepoch': return self.by.by_halvingepoch() - return None - -class _MetricPattern12By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_difficultyepoch(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'difficultyepoch') - - def by_height(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'height') - -class MetricPattern12(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern12By[T] = _MetricPattern12By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['difficultyepoch', 'height'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'difficultyepoch': return self.by.by_difficultyepoch() - elif index == 'height': return self.by.by_height() - return None - -class _MetricPattern13By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_halvingepoch(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'halvingepoch') - - def by_height(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'height') - -class MetricPattern13(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern13By[T] = _MetricPattern13By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['halvingepoch', 'height'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'halvingepoch': return self.by.by_halvingepoch() - elif index == 'height': return self.by.by_height() - return None - -class _MetricPattern14By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_height(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'height') - - def by_txindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'txindex') - -class MetricPattern14(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern14By[T] = _MetricPattern14By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['height', 'txindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'height': return self.by.by_height() - elif index == 'txindex': return self.by.by_txindex() - return None - -class _MetricPattern15By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'monthindex') - - def by_quarterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'quarterindex') - -class MetricPattern15(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern15By[T] = _MetricPattern15By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['monthindex', 'quarterindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'monthindex': return self.by.by_monthindex() - elif index == 'quarterindex': return self.by.by_quarterindex() - return None - -class _MetricPattern16By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'monthindex') - - def by_semesterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'semesterindex') - -class MetricPattern16(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern16By[T] = _MetricPattern16By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['monthindex', 'semesterindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'monthindex': return self.by.by_monthindex() - elif index == 'semesterindex': return self.by.by_semesterindex() - return None - -class _MetricPattern17By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'monthindex') - - def by_weekindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'weekindex') - -class MetricPattern17(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern17By[T] = _MetricPattern17By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['monthindex', 'weekindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'monthindex': return self.by.by_monthindex() - elif index == 'weekindex': return self.by.by_weekindex() - return None - -class _MetricPattern18By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'monthindex') - - def by_yearindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'yearindex') - -class MetricPattern18(Generic[T]): - """Index accessor for metrics with 2 indexes.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - self.by: _MetricPattern18By[T] = _MetricPattern18By(client, name) - - @property - def name(self) -> str: - """Get the metric name.""" - return self._name - - def indexes(self) -> List[str]: - """Get the list of available indexes.""" - return ['monthindex', 'yearindex'] - - def get(self, index: str) -> Optional[MetricEndpoint[T]]: - """Get an endpoint for a specific index, if supported.""" - if index == 'monthindex': return self.by.by_monthindex() - elif index == 'yearindex': return self.by.by_yearindex() - return None - -class _MetricPattern19By(Generic[T]): - """Index endpoint methods container.""" - - def __init__(self, client: BrkClientBase, name: str): - self._client = client - self._name = name - - def by_dateindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, 'dateindex') - -class MetricPattern19(Generic[T]): +class MetricPattern7(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern19By[T] = _MetricPattern19By(client, name) + self.by: _MetricPattern7By[T] = _MetricPattern7By(client, name) @property def name(self) -> str: @@ -1355,9 +919,9 @@ class MetricPattern19(Generic[T]): if index == 'dateindex': return self.by.by_dateindex() return None -class _MetricPattern20By(Generic[T]): +class _MetricPattern8By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1365,13 +929,13 @@ class _MetricPattern20By(Generic[T]): def by_decadeindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'decadeindex') -class MetricPattern20(Generic[T]): +class MetricPattern8(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern20By[T] = _MetricPattern20By(client, name) + self.by: _MetricPattern8By[T] = _MetricPattern8By(client, name) @property def name(self) -> str: @@ -1387,9 +951,9 @@ class MetricPattern20(Generic[T]): if index == 'decadeindex': return self.by.by_decadeindex() return None -class _MetricPattern21By(Generic[T]): +class _MetricPattern9By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1397,13 +961,13 @@ class _MetricPattern21By(Generic[T]): def by_difficultyepoch(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'difficultyepoch') -class MetricPattern21(Generic[T]): +class MetricPattern9(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern21By[T] = _MetricPattern21By(client, name) + self.by: _MetricPattern9By[T] = _MetricPattern9By(client, name) @property def name(self) -> str: @@ -1419,9 +983,9 @@ class MetricPattern21(Generic[T]): if index == 'difficultyepoch': return self.by.by_difficultyepoch() return None -class _MetricPattern22By(Generic[T]): +class _MetricPattern10By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1429,13 +993,13 @@ class _MetricPattern22By(Generic[T]): def by_emptyoutputindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'emptyoutputindex') -class MetricPattern22(Generic[T]): +class MetricPattern10(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern22By[T] = _MetricPattern22By(client, name) + self.by: _MetricPattern10By[T] = _MetricPattern10By(client, name) @property def name(self) -> str: @@ -1451,9 +1015,41 @@ class MetricPattern22(Generic[T]): if index == 'emptyoutputindex': return self.by.by_emptyoutputindex() return None -class _MetricPattern23By(Generic[T]): +class _MetricPattern11By(Generic[T]): """Index endpoint methods container.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + def by_halvingepoch(self) -> MetricEndpoint[T]: + return MetricEndpoint(self._client, self._name, 'halvingepoch') + +class MetricPattern11(Generic[T]): + """Index accessor for metrics with 1 indexes.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + self.by: _MetricPattern11By[T] = _MetricPattern11By(client, name) + + @property + def name(self) -> str: + """Get the metric name.""" + return self._name + + def indexes(self) -> List[str]: + """Get the list of available indexes.""" + return ['halvingepoch'] + + def get(self, index: str) -> Optional[MetricEndpoint[T]]: + """Get an endpoint for a specific index, if supported.""" + if index == 'halvingepoch': return self.by.by_halvingepoch() + return None + +class _MetricPattern12By(Generic[T]): + """Index endpoint methods container.""" + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1461,13 +1057,13 @@ class _MetricPattern23By(Generic[T]): def by_height(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'height') -class MetricPattern23(Generic[T]): +class MetricPattern12(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern23By[T] = _MetricPattern23By(client, name) + self.by: _MetricPattern12By[T] = _MetricPattern12By(client, name) @property def name(self) -> str: @@ -1483,9 +1079,9 @@ class MetricPattern23(Generic[T]): if index == 'height': return self.by.by_height() return None -class _MetricPattern24By(Generic[T]): +class _MetricPattern13By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1493,13 +1089,13 @@ class _MetricPattern24By(Generic[T]): def by_txinindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'txinindex') -class MetricPattern24(Generic[T]): +class MetricPattern13(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern24By[T] = _MetricPattern24By(client, name) + self.by: _MetricPattern13By[T] = _MetricPattern13By(client, name) @property def name(self) -> str: @@ -1515,9 +1111,41 @@ class MetricPattern24(Generic[T]): if index == 'txinindex': return self.by.by_txinindex() return None -class _MetricPattern25By(Generic[T]): +class _MetricPattern14By(Generic[T]): """Index endpoint methods container.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + def by_monthindex(self) -> MetricEndpoint[T]: + return MetricEndpoint(self._client, self._name, 'monthindex') + +class MetricPattern14(Generic[T]): + """Index accessor for metrics with 1 indexes.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + self.by: _MetricPattern14By[T] = _MetricPattern14By(client, name) + + @property + def name(self) -> str: + """Get the metric name.""" + return self._name + + def indexes(self) -> List[str]: + """Get the list of available indexes.""" + return ['monthindex'] + + def get(self, index: str) -> Optional[MetricEndpoint[T]]: + """Get an endpoint for a specific index, if supported.""" + if index == 'monthindex': return self.by.by_monthindex() + return None + +class _MetricPattern15By(Generic[T]): + """Index endpoint methods container.""" + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1525,13 +1153,13 @@ class _MetricPattern25By(Generic[T]): def by_opreturnindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'opreturnindex') -class MetricPattern25(Generic[T]): +class MetricPattern15(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern25By[T] = _MetricPattern25By(client, name) + self.by: _MetricPattern15By[T] = _MetricPattern15By(client, name) @property def name(self) -> str: @@ -1547,9 +1175,9 @@ class MetricPattern25(Generic[T]): if index == 'opreturnindex': return self.by.by_opreturnindex() return None -class _MetricPattern26By(Generic[T]): +class _MetricPattern16By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1557,13 +1185,13 @@ class _MetricPattern26By(Generic[T]): def by_txoutindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'txoutindex') -class MetricPattern26(Generic[T]): +class MetricPattern16(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern26By[T] = _MetricPattern26By(client, name) + self.by: _MetricPattern16By[T] = _MetricPattern16By(client, name) @property def name(self) -> str: @@ -1579,9 +1207,9 @@ class MetricPattern26(Generic[T]): if index == 'txoutindex': return self.by.by_txoutindex() return None -class _MetricPattern27By(Generic[T]): +class _MetricPattern17By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1589,13 +1217,13 @@ class _MetricPattern27By(Generic[T]): def by_p2aaddressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2aaddressindex') -class MetricPattern27(Generic[T]): +class MetricPattern17(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern27By[T] = _MetricPattern27By(client, name) + self.by: _MetricPattern17By[T] = _MetricPattern17By(client, name) @property def name(self) -> str: @@ -1611,9 +1239,9 @@ class MetricPattern27(Generic[T]): if index == 'p2aaddressindex': return self.by.by_p2aaddressindex() return None -class _MetricPattern28By(Generic[T]): +class _MetricPattern18By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1621,13 +1249,13 @@ class _MetricPattern28By(Generic[T]): def by_p2msoutputindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2msoutputindex') -class MetricPattern28(Generic[T]): +class MetricPattern18(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern28By[T] = _MetricPattern28By(client, name) + self.by: _MetricPattern18By[T] = _MetricPattern18By(client, name) @property def name(self) -> str: @@ -1643,9 +1271,9 @@ class MetricPattern28(Generic[T]): if index == 'p2msoutputindex': return self.by.by_p2msoutputindex() return None -class _MetricPattern29By(Generic[T]): +class _MetricPattern19By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1653,13 +1281,13 @@ class _MetricPattern29By(Generic[T]): def by_p2pk33addressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2pk33addressindex') -class MetricPattern29(Generic[T]): +class MetricPattern19(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern29By[T] = _MetricPattern29By(client, name) + self.by: _MetricPattern19By[T] = _MetricPattern19By(client, name) @property def name(self) -> str: @@ -1675,9 +1303,9 @@ class MetricPattern29(Generic[T]): if index == 'p2pk33addressindex': return self.by.by_p2pk33addressindex() return None -class _MetricPattern30By(Generic[T]): +class _MetricPattern20By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1685,13 +1313,13 @@ class _MetricPattern30By(Generic[T]): def by_p2pk65addressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2pk65addressindex') -class MetricPattern30(Generic[T]): +class MetricPattern20(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern30By[T] = _MetricPattern30By(client, name) + self.by: _MetricPattern20By[T] = _MetricPattern20By(client, name) @property def name(self) -> str: @@ -1707,9 +1335,9 @@ class MetricPattern30(Generic[T]): if index == 'p2pk65addressindex': return self.by.by_p2pk65addressindex() return None -class _MetricPattern31By(Generic[T]): +class _MetricPattern21By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1717,13 +1345,13 @@ class _MetricPattern31By(Generic[T]): def by_p2pkhaddressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2pkhaddressindex') -class MetricPattern31(Generic[T]): +class MetricPattern21(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern31By[T] = _MetricPattern31By(client, name) + self.by: _MetricPattern21By[T] = _MetricPattern21By(client, name) @property def name(self) -> str: @@ -1739,9 +1367,9 @@ class MetricPattern31(Generic[T]): if index == 'p2pkhaddressindex': return self.by.by_p2pkhaddressindex() return None -class _MetricPattern32By(Generic[T]): +class _MetricPattern22By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1749,13 +1377,13 @@ class _MetricPattern32By(Generic[T]): def by_p2shaddressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2shaddressindex') -class MetricPattern32(Generic[T]): +class MetricPattern22(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern32By[T] = _MetricPattern32By(client, name) + self.by: _MetricPattern22By[T] = _MetricPattern22By(client, name) @property def name(self) -> str: @@ -1771,9 +1399,9 @@ class MetricPattern32(Generic[T]): if index == 'p2shaddressindex': return self.by.by_p2shaddressindex() return None -class _MetricPattern33By(Generic[T]): +class _MetricPattern23By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1781,13 +1409,13 @@ class _MetricPattern33By(Generic[T]): def by_p2traddressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2traddressindex') -class MetricPattern33(Generic[T]): +class MetricPattern23(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern33By[T] = _MetricPattern33By(client, name) + self.by: _MetricPattern23By[T] = _MetricPattern23By(client, name) @property def name(self) -> str: @@ -1803,9 +1431,9 @@ class MetricPattern33(Generic[T]): if index == 'p2traddressindex': return self.by.by_p2traddressindex() return None -class _MetricPattern34By(Generic[T]): +class _MetricPattern24By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1813,13 +1441,13 @@ class _MetricPattern34By(Generic[T]): def by_p2wpkhaddressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2wpkhaddressindex') -class MetricPattern34(Generic[T]): +class MetricPattern24(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern34By[T] = _MetricPattern34By(client, name) + self.by: _MetricPattern24By[T] = _MetricPattern24By(client, name) @property def name(self) -> str: @@ -1835,9 +1463,9 @@ class MetricPattern34(Generic[T]): if index == 'p2wpkhaddressindex': return self.by.by_p2wpkhaddressindex() return None -class _MetricPattern35By(Generic[T]): +class _MetricPattern25By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1845,13 +1473,13 @@ class _MetricPattern35By(Generic[T]): def by_p2wshaddressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'p2wshaddressindex') -class MetricPattern35(Generic[T]): +class MetricPattern25(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern35By[T] = _MetricPattern35By(client, name) + self.by: _MetricPattern25By[T] = _MetricPattern25By(client, name) @property def name(self) -> str: @@ -1867,9 +1495,73 @@ class MetricPattern35(Generic[T]): if index == 'p2wshaddressindex': return self.by.by_p2wshaddressindex() return None -class _MetricPattern36By(Generic[T]): +class _MetricPattern26By(Generic[T]): """Index endpoint methods container.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + def by_quarterindex(self) -> MetricEndpoint[T]: + return MetricEndpoint(self._client, self._name, 'quarterindex') + +class MetricPattern26(Generic[T]): + """Index accessor for metrics with 1 indexes.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + self.by: _MetricPattern26By[T] = _MetricPattern26By(client, name) + + @property + def name(self) -> str: + """Get the metric name.""" + return self._name + + def indexes(self) -> List[str]: + """Get the list of available indexes.""" + return ['quarterindex'] + + def get(self, index: str) -> Optional[MetricEndpoint[T]]: + """Get an endpoint for a specific index, if supported.""" + if index == 'quarterindex': return self.by.by_quarterindex() + return None + +class _MetricPattern27By(Generic[T]): + """Index endpoint methods container.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + + def by_semesterindex(self) -> MetricEndpoint[T]: + return MetricEndpoint(self._client, self._name, 'semesterindex') + +class MetricPattern27(Generic[T]): + """Index accessor for metrics with 1 indexes.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + self.by: _MetricPattern27By[T] = _MetricPattern27By(client, name) + + @property + def name(self) -> str: + """Get the metric name.""" + return self._name + + def indexes(self) -> List[str]: + """Get the list of available indexes.""" + return ['semesterindex'] + + def get(self, index: str) -> Optional[MetricEndpoint[T]]: + """Get an endpoint for a specific index, if supported.""" + if index == 'semesterindex': return self.by.by_semesterindex() + return None + +class _MetricPattern28By(Generic[T]): + """Index endpoint methods container.""" + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1877,13 +1569,13 @@ class _MetricPattern36By(Generic[T]): def by_txindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'txindex') -class MetricPattern36(Generic[T]): +class MetricPattern28(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern36By[T] = _MetricPattern36By(client, name) + self.by: _MetricPattern28By[T] = _MetricPattern28By(client, name) @property def name(self) -> str: @@ -1899,9 +1591,9 @@ class MetricPattern36(Generic[T]): if index == 'txindex': return self.by.by_txindex() return None -class _MetricPattern37By(Generic[T]): +class _MetricPattern29By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1909,13 +1601,13 @@ class _MetricPattern37By(Generic[T]): def by_unknownoutputindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'unknownoutputindex') -class MetricPattern37(Generic[T]): +class MetricPattern29(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern37By[T] = _MetricPattern37By(client, name) + self.by: _MetricPattern29By[T] = _MetricPattern29By(client, name) @property def name(self) -> str: @@ -1931,9 +1623,73 @@ class MetricPattern37(Generic[T]): if index == 'unknownoutputindex': return self.by.by_unknownoutputindex() return None -class _MetricPattern38By(Generic[T]): +class _MetricPattern30By(Generic[T]): """Index endpoint methods container.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + def by_weekindex(self) -> MetricEndpoint[T]: + return MetricEndpoint(self._client, self._name, 'weekindex') + +class MetricPattern30(Generic[T]): + """Index accessor for metrics with 1 indexes.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + self.by: _MetricPattern30By[T] = _MetricPattern30By(client, name) + + @property + def name(self) -> str: + """Get the metric name.""" + return self._name + + def indexes(self) -> List[str]: + """Get the list of available indexes.""" + return ['weekindex'] + + def get(self, index: str) -> Optional[MetricEndpoint[T]]: + """Get an endpoint for a specific index, if supported.""" + if index == 'weekindex': return self.by.by_weekindex() + return None + +class _MetricPattern31By(Generic[T]): + """Index endpoint methods container.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + + def by_yearindex(self) -> MetricEndpoint[T]: + return MetricEndpoint(self._client, self._name, 'yearindex') + +class MetricPattern31(Generic[T]): + """Index accessor for metrics with 1 indexes.""" + + def __init__(self, client: BrkClientBase, name: str): + self._client = client + self._name = name + self.by: _MetricPattern31By[T] = _MetricPattern31By(client, name) + + @property + def name(self) -> str: + """Get the metric name.""" + return self._name + + def indexes(self) -> List[str]: + """Get the list of available indexes.""" + return ['yearindex'] + + def get(self, index: str) -> Optional[MetricEndpoint[T]]: + """Get an endpoint for a specific index, if supported.""" + if index == 'yearindex': return self.by.by_yearindex() + return None + +class _MetricPattern32By(Generic[T]): + """Index endpoint methods container.""" + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1941,13 +1697,13 @@ class _MetricPattern38By(Generic[T]): def by_loadedaddressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'loadedaddressindex') -class MetricPattern38(Generic[T]): +class MetricPattern32(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern38By[T] = _MetricPattern38By(client, name) + self.by: _MetricPattern32By[T] = _MetricPattern32By(client, name) @property def name(self) -> str: @@ -1963,9 +1719,9 @@ class MetricPattern38(Generic[T]): if index == 'loadedaddressindex': return self.by.by_loadedaddressindex() return None -class _MetricPattern39By(Generic[T]): +class _MetricPattern33By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1973,13 +1729,13 @@ class _MetricPattern39By(Generic[T]): def by_emptyaddressindex(self) -> MetricEndpoint[T]: return MetricEndpoint(self._client, self._name, 'emptyaddressindex') -class MetricPattern39(Generic[T]): +class MetricPattern33(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name - self.by: _MetricPattern39By[T] = _MetricPattern39By(client, name) + self.by: _MetricPattern33By[T] = _MetricPattern33By(client, name) @property def name(self) -> str: @@ -1999,12 +1755,12 @@ class MetricPattern39(Generic[T]): class RealizedPattern3: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.adjusted_sopr: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'adjusted_sopr')) - self.adjusted_sopr_30d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'adjusted_sopr_30d_ema')) - self.adjusted_sopr_7d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'adjusted_sopr_7d_ema')) + self.adjusted_sopr: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'adjusted_sopr')) + self.adjusted_sopr_30d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'adjusted_sopr_30d_ema')) + self.adjusted_sopr_7d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'adjusted_sopr_7d_ema')) self.adjusted_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'adjusted_value_created')) self.adjusted_value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed')) self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'mvrv')) @@ -2023,26 +1779,26 @@ class RealizedPattern3: self.realized_price_extra: ActivePriceRatioPattern = ActivePriceRatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_profit')) self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) - self.realized_profit_to_loss_ratio: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'realized_profit_to_loss_ratio')) + self.realized_profit_to_loss_ratio: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'realized_profit_to_loss_ratio')) self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) - self.sell_side_risk_ratio: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_30d_ema: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) - self.sell_side_risk_ratio_7d_ema: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) - self.sopr: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr')) - self.sopr_30d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr_30d_ema')) - self.sopr_7d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr_7d_ema')) + self.sell_side_risk_ratio: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr_7d_ema')) self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class RealizedPattern4: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.adjusted_sopr: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'adjusted_sopr')) - self.adjusted_sopr_30d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'adjusted_sopr_30d_ema')) - self.adjusted_sopr_7d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'adjusted_sopr_7d_ema')) + self.adjusted_sopr: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'adjusted_sopr')) + self.adjusted_sopr_30d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'adjusted_sopr_30d_ema')) + self.adjusted_sopr_7d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'adjusted_sopr_7d_ema')) self.adjusted_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'adjusted_value_created')) self.adjusted_value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed')) self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'mvrv')) @@ -2061,19 +1817,19 @@ class RealizedPattern4: self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_profit')) self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) - self.sell_side_risk_ratio: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_30d_ema: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) - self.sell_side_risk_ratio_7d_ema: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) - self.sopr: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr')) - self.sopr_30d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr_30d_ema')) - self.sopr_7d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr_7d_ema')) + self.sell_side_risk_ratio: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr_7d_ema')) self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class Ratio1ySdPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self._0sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, '0sd_usd')) @@ -2107,7 +1863,7 @@ class Ratio1ySdPattern: class RealizedPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'mvrv')) @@ -2126,21 +1882,21 @@ class RealizedPattern2: self.realized_price_extra: ActivePriceRatioPattern = ActivePriceRatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_profit')) self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) - self.realized_profit_to_loss_ratio: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'realized_profit_to_loss_ratio')) + self.realized_profit_to_loss_ratio: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'realized_profit_to_loss_ratio')) self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) - self.sell_side_risk_ratio: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_30d_ema: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) - self.sell_side_risk_ratio_7d_ema: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) - self.sopr: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr')) - self.sopr_30d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr_30d_ema')) - self.sopr_7d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr_7d_ema')) + self.sell_side_risk_ratio: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr_7d_ema')) self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class RealizedPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'mvrv')) @@ -2159,19 +1915,19 @@ class RealizedPattern: self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_profit')) self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) - self.sell_side_risk_ratio: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_30d_ema: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) - self.sell_side_risk_ratio_7d_ema: MetricPattern19[StoredF32] = MetricPattern19(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) - self.sopr: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr')) - self.sopr_30d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr_30d_ema')) - self.sopr_7d_ema: MetricPattern19[StoredF64] = MetricPattern19(client, _m(acc, 'sopr_7d_ema')) + self.sell_side_risk_ratio: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern7[StoredF32] = MetricPattern7(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern7[StoredF64] = MetricPattern7(client, _m(acc, 'sopr_7d_ema')) self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class Price111dSmaPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.price: MetricPattern4[Dollars] = MetricPattern4(client, acc) @@ -2197,7 +1953,7 @@ class Price111dSmaPattern: class ActivePriceRatioPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, acc) @@ -2222,7 +1978,7 @@ class ActivePriceRatioPattern: class PercentilesPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cost_basis_pct05: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct05')) @@ -2247,31 +2003,31 @@ class PercentilesPattern2: class RelativePattern5: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss_rel_to_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) - self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) - self.net_unrealized_pnl_rel_to_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) - self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) - self.nupl: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'nupl')) - self.supply_in_loss_rel_to_circulating_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) - self.supply_in_loss_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) - self.supply_in_profit_rel_to_circulating_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) + self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) + self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) + self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) + self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) + self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl')) + self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = MetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')) - self.unrealized_loss_rel_to_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) - self.unrealized_loss_rel_to_own_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) - self.unrealized_profit_rel_to_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) - self.unrealized_profit_rel_to_own_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) + self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) + self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) + self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) + self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) + self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) class AaopoolPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self._1m_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, '1m_blocks_mined')) @@ -2291,7 +2047,7 @@ class AaopoolPattern: class PriceAgoPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self._10y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '10y_ago')) @@ -2310,25 +2066,25 @@ class PriceAgoPattern(Generic[T]): class PeriodLumpSumStackPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._10y: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'10y_{{acc}}' if acc else '10y')) - self._1m: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'1m_{{acc}}' if acc else '1m')) - self._1w: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'1w_{{acc}}' if acc else '1w')) - self._1y: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'1y_{{acc}}' if acc else '1y')) - self._2y: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'2y_{{acc}}' if acc else '2y')) - self._3m: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'3m_{{acc}}' if acc else '3m')) - self._3y: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'3y_{{acc}}' if acc else '3y')) - self._4y: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'4y_{{acc}}' if acc else '4y')) - self._5y: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'5y_{{acc}}' if acc else '5y')) - self._6m: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'6m_{{acc}}' if acc else '6m')) - self._6y: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'6y_{{acc}}' if acc else '6y')) - self._8y: ActiveSupplyPattern = ActiveSupplyPattern(client, (f'8y_{{acc}}' if acc else '8y')) + self._10y: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'10y_{{acc}}' if acc else '10y')) + self._1m: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'1m_{{acc}}' if acc else '1m')) + self._1w: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'1w_{{acc}}' if acc else '1w')) + self._1y: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'1y_{{acc}}' if acc else '1y')) + self._2y: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'2y_{{acc}}' if acc else '2y')) + self._3m: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'3m_{{acc}}' if acc else '3m')) + self._3y: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'3y_{{acc}}' if acc else '3y')) + self._4y: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'4y_{{acc}}' if acc else '4y')) + self._5y: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'5y_{{acc}}' if acc else '5y')) + self._6m: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'6m_{{acc}}' if acc else '6m')) + self._6y: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'6y_{{acc}}' if acc else '6y')) + self._8y: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, (f'8y_{{acc}}' if acc else '8y')) class PeriodAveragePricePattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self._10y: MetricPattern4[T] = MetricPattern4(client, (f'10y_{{acc}}' if acc else '10y')) @@ -2346,7 +2102,7 @@ class PeriodAveragePricePattern(Generic[T]): class ClassAveragePricePattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self._2015: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2015_average_price')) @@ -2361,41 +2117,41 @@ class ClassAveragePricePattern(Generic[T]): self._2024: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2024_average_price')) self._2025: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2025_average_price')) -class RelativePattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) - self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) - self.supply_in_loss_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) - self.unrealized_loss_rel_to_own_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) - self.unrealized_profit_rel_to_own_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) - class RelativePattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss_rel_to_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) - self.net_unrealized_pnl_rel_to_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) - self.nupl: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'nupl')) - self.supply_in_loss_rel_to_circulating_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) - self.supply_in_loss_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) - self.supply_in_profit_rel_to_circulating_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) + self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) + self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl')) + self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = MetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')) - self.unrealized_loss_rel_to_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) - self.unrealized_profit_rel_to_market_cap: MetricPattern3[StoredF32] = MetricPattern3(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) + self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) + self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) + +class RelativePattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) + self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) + self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) + self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) + self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) class AddrCountPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.all: MetricPattern1[StoredU64] = MetricPattern1(client, (f'addr_{{acc}}' if acc else 'addr')) @@ -2408,37 +2164,92 @@ class AddrCountPattern: self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1(client, (f'p2wpkh_addr_{{acc}}' if acc else 'p2wpkh_addr')) self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1(client, (f'p2wsh_addr_{{acc}}' if acc else 'p2wsh_addr')) -class UnrealizedPattern: +class OhlcPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss: MetricPattern3[Dollars] = MetricPattern3(client, _m(acc, 'neg_unrealized_loss')) - self.net_unrealized_pnl: MetricPattern3[Dollars] = MetricPattern3(client, _m(acc, 'net_unrealized_pnl')) - self.supply_in_loss: SupplyInLossPattern = SupplyInLossPattern(client, _m(acc, 'supply_in_loss')) - self.supply_in_loss_value: SupplyInLossValuePattern = SupplyInLossValuePattern(client, _m(acc, 'supply_in_loss')) - self.supply_in_profit: SupplyInLossPattern = SupplyInLossPattern(client, _m(acc, 'supply_in_profit')) - self.supply_in_profit_value: SupplyInLossValuePattern = SupplyInLossValuePattern(client, _m(acc, 'supply_in_profit')) - self.total_unrealized_pnl: MetricPattern3[Dollars] = MetricPattern3(client, _m(acc, 'total_unrealized_pnl')) - self.unrealized_loss: MetricPattern3[Dollars] = MetricPattern3(client, _m(acc, 'unrealized_loss')) - self.unrealized_profit: MetricPattern3[Dollars] = MetricPattern3(client, _m(acc, 'unrealized_profit')) + self.dateindex: MetricPattern7[T] = MetricPattern7(client, acc) + self.decade: MetricPattern8[T] = MetricPattern8(client, acc) + self.difficultyepoch: MetricPattern9[T] = MetricPattern9(client, acc) + self.height: MetricPattern12[T] = MetricPattern12(client, acc) + self.month: MetricPattern14[T] = MetricPattern14(client, acc) + self.quarter: MetricPattern26[T] = MetricPattern26(client, acc) + self.semester: MetricPattern27[T] = MetricPattern27(client, acc) + self.week: MetricPattern30[T] = MetricPattern30(client, acc) + self.year: MetricPattern31[T] = MetricPattern31(client, acc) + +class FeeRatePattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) + self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max')) + self.median: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'median')) + self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min')) + self.pct10: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct10')) + self.pct25: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct25')) + self.pct75: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct75')) + self.pct90: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct90')) + self.txindex: MetricPattern28[T] = MetricPattern28(client, acc) class _0satsPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.activity: ActivityPattern2 = ActivityPattern2(client, acc) self.addr_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'addr_count')) self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) self.realized: RealizedPattern = RealizedPattern(client, acc) self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, acc) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) + +class UnrealizedPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.neg_unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss')) + self.net_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl')) + self.supply_in_loss: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'supply_in_loss')) + self.supply_in_profit: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'supply_in_profit')) + self.total_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_unrealized_pnl')) + self.unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_loss')) + self.unrealized_profit: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_profit')) + +class _100btcPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) + self.realized: RealizedPattern = RealizedPattern(client, acc) + self.relative: RelativePattern = RelativePattern(client, acc) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) + +class _10yPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) + self.realized: RealizedPattern4 = RealizedPattern4(client, acc) + self.relative: RelativePattern = RelativePattern(client, acc) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) class PeriodCagrPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self._10y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'10y_{{acc}}' if acc else '10y')) @@ -2449,70 +2260,48 @@ class PeriodCagrPattern: self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'6y_{{acc}}' if acc else '6y')) self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'8y_{{acc}}' if acc else '8y')) +class _0satsPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) + self.realized: RealizedPattern = RealizedPattern(client, acc) + self.relative: RelativePattern4 = RelativePattern4(client, _m(acc, 'supply_in')) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) + +class _10yTo12yPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) + self.realized: RealizedPattern2 = RealizedPattern2(client, acc) + self.relative: RelativePattern2 = RelativePattern2(client, acc) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) + class BitcoinPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) - self.base: MetricPattern23[T] = MetricPattern23(client, acc) self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) + self.height: MetricPattern12[T] = MetricPattern12(client, acc) self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max')) self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min')) self.percentiles: PercentilesPattern[T] = PercentilesPattern(client, acc) self.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'sum')) -class _0satsPattern2: +class SizePattern(Generic[T]): """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.realized: RealizedPattern = RealizedPattern(client, acc) - self.relative: RelativePattern4 = RelativePattern4(client, _m(acc, 'supply_in')) - self.supply: SupplyPattern2 = SupplyPattern2(client, acc) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - -class _10yTo12yPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, acc) - self.realized: RealizedPattern2 = RealizedPattern2(client, acc) - self.relative: RelativePattern2 = RelativePattern2(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, acc) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - -class _10yPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.realized: RealizedPattern4 = RealizedPattern4(client, acc) - self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, acc) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - -class _100btcPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.realized: RealizedPattern = RealizedPattern(client, acc) - self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, acc) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - -class BlockSizePattern(Generic[T]): - """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) @@ -2524,165 +2313,144 @@ class BlockSizePattern(Generic[T]): class ActivityPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.coinblocks_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, _m(acc, 'coinblocks_destroyed')) self.coindays_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, _m(acc, 'coindays_destroyed')) - self.satblocks_destroyed: MetricPattern23[Sats] = MetricPattern23(client, _m(acc, 'satblocks_destroyed')) - self.satdays_destroyed: MetricPattern23[Sats] = MetricPattern23(client, _m(acc, 'satdays_destroyed')) - self.sent: SentPattern = SentPattern(client, _m(acc, 'sent')) + self.satblocks_destroyed: MetricPattern12[Sats] = MetricPattern12(client, _m(acc, 'satblocks_destroyed')) + self.satdays_destroyed: MetricPattern12[Sats] = MetricPattern12(client, _m(acc, 'satdays_destroyed')) + self.sent: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, _m(acc, 'sent')) class PercentilesPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.median: MetricPattern19[T] = MetricPattern19(client, _m(acc, 'median')) - self.pct10: MetricPattern19[T] = MetricPattern19(client, _m(acc, 'pct10')) - self.pct25: MetricPattern19[T] = MetricPattern19(client, _m(acc, 'pct25')) - self.pct75: MetricPattern19[T] = MetricPattern19(client, _m(acc, 'pct75')) - self.pct90: MetricPattern19[T] = MetricPattern19(client, _m(acc, 'pct90')) + self.median: MetricPattern7[T] = MetricPattern7(client, _m(acc, 'median')) + self.pct10: MetricPattern7[T] = MetricPattern7(client, _m(acc, 'pct10')) + self.pct25: MetricPattern7[T] = MetricPattern7(client, _m(acc, 'pct25')) + self.pct75: MetricPattern7[T] = MetricPattern7(client, _m(acc, 'pct75')) + self.pct90: MetricPattern7[T] = MetricPattern7(client, _m(acc, 'pct90')) -class IntervalPattern(Generic[T]): +class DateindexPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) - self.base: MetricPattern23[T] = MetricPattern23(client, acc) - self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max')) - self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min')) - self.percentiles: PercentilesPattern[T] = PercentilesPattern(client, acc) + self.close: MetricPattern7[Cents] = MetricPattern7(client, _m(acc, 'close_cents')) + self.high: MetricPattern7[Cents] = MetricPattern7(client, _m(acc, 'high_cents')) + self.low: MetricPattern7[Cents] = MetricPattern7(client, _m(acc, 'low_cents')) + self.open: MetricPattern7[Cents] = MetricPattern7(client, _m(acc, 'open_cents')) -class SupplyInLossPattern: +class SplitPattern2(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.base: MetricPattern7[Sats] = MetricPattern7(client, acc) - self.bitcoin: MetricPattern4[Bitcoin] = MetricPattern4(client, _m(acc, 'btc')) - self.dollars: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'usd')) - self.sats: MetricPattern5[Sats] = MetricPattern5(client, acc) + self.close: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'close')) + self.high: HighPattern[T] = HighPattern(client, _m(acc, 'high')) + self.low: HighPattern[T] = HighPattern(client, _m(acc, 'low')) + self.open: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'open')) -class PriceHighSatsPattern(Generic[T]): +class HighPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.dateindex: MetricPattern19[T] = MetricPattern19(client, acc) - self.difficultyepoch: MetricPattern21[T] = MetricPattern21(client, _m(acc, 'max')) - self.height: MetricPattern23[T] = MetricPattern23(client, acc) + self.dateindex: MetricPattern7[T] = MetricPattern7(client, acc) + self.difficultyepoch: MetricPattern9[T] = MetricPattern9(client, _m(acc, 'max')) + self.height: MetricPattern12[T] = MetricPattern12(client, acc) self.rest: MetricPattern5[T] = MetricPattern5(client, _m(acc, 'max')) -class TxVsizePattern(Generic[T]): +class _24hCoinbaseSumPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) - self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max')) - self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min')) - self.percentiles: PercentilesPattern[T] = PercentilesPattern(client, acc) + self.bitcoin: MetricPattern12[Bitcoin] = MetricPattern12(client, _m(acc, 'btc')) + self.dollars: MetricPattern12[Dollars] = MetricPattern12(client, _m(acc, 'usd')) + self.sats: MetricPattern12[Sats] = MetricPattern12(client, acc) -class UnclaimedRewardsPattern: +class SegwitAdoptionPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.bitcoin: BlockCountPattern[Bitcoin] = BlockCountPattern(client, _m(acc, 'btc')) - self.dollars: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'usd')) - self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc) + self.cumulative: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'cumulative')) + self.height: MetricPattern12[StoredF32] = MetricPattern12(client, acc) + self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'sum')) class CostBasisPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.max: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'max_cost_basis')) self.min: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'min_cost_basis')) self.percentiles: PercentilesPattern2 = PercentilesPattern2(client, _m(acc, 'cost_basis')) -class ActiveSupplyPattern: +class UnclaimedRewardsPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bitcoin: MetricPattern1[Bitcoin] = MetricPattern1(client, _m(acc, 'btc')) - self.dollars: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) - self.sats: MetricPattern1[Sats] = MetricPattern1(client, acc) - -class SentPattern: - """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.bitcoin: BlockCountPattern[Bitcoin] = BlockCountPattern(client, _m(acc, 'btc')) self.dollars: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'usd')) - self.sats: SatsPattern[Sats] = SatsPattern(client, acc) + self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc) class CoinbasePattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.bitcoin: BitcoinPattern[Bitcoin] = BitcoinPattern(client, _m(acc, 'btc')) self.dollars: BitcoinPattern[Dollars] = BitcoinPattern(client, _m(acc, 'usd')) self.sats: BitcoinPattern[Sats] = BitcoinPattern(client, acc) -class SupplyPattern2: +class RelativePattern4: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.supply: ActiveSupplyPattern = ActiveSupplyPattern(client, _m(acc, 'supply')) - self.supply_half: ActiveSupplyPattern = ActiveSupplyPattern(client, _m(acc, 'supply_half')) - self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'utxo_count')) - -class SatsPattern(Generic[T]): - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: MetricPattern23[T] = MetricPattern23(client, acc) - self.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative')) - self.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'sum')) - -class CostBasisPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.max: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'max_cost_basis')) - self.min: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'min_cost_basis')) - -class SupplyInLossValuePattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bitcoin: MetricPattern23[Bitcoin] = MetricPattern23(client, _m(acc, 'btc')) - self.dollars: MetricPattern23[Dollars] = MetricPattern23(client, _m(acc, 'usd')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'profit_rel_to_own_supply')) class _1dReturns1mSdPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd')) self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma')) -class RelativePattern4: +class CostBasisPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.supply_in_loss_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'loss_rel_to_own_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, _m(acc, 'profit_rel_to_own_supply')) + self.max: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'max_cost_basis')) + self.min: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'min_cost_basis')) + +class SupplyPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.halved: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'half')) + self.total: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, acc) + +class SatsPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.ohlc: OhlcPattern[OHLCSats] = OhlcPattern(client, _m(acc, 'ohlc_sats')) + self.split: SplitPattern2[Sats] = SplitPattern2(client, _m(acc, 'sats')) class BlockCountPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) @@ -2690,16 +2458,30 @@ class BlockCountPattern(Generic[T]): class RealizedPriceExtraPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio')) +class OutputsPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'utxo_count')) + +class EmptyPattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.identity: MetricPattern18[T] = MetricPattern18(client, acc) + # Catalog tree classes class CatalogTree: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.addresses: CatalogTree_Addresses = CatalogTree_Addresses(client, f'{base_path}_addresses') self.blocks: CatalogTree_Blocks = CatalogTree_Blocks(client, f'{base_path}_blocks') @@ -2719,77 +2501,91 @@ class CatalogTree: class CatalogTree_Addresses: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_p2aaddressindex: MetricPattern23[P2AAddressIndex] = MetricPattern23(client, f'{base_path}_first_p2aaddressindex') - self.first_p2pk33addressindex: MetricPattern23[P2PK33AddressIndex] = MetricPattern23(client, f'{base_path}_first_p2pk33addressindex') - self.first_p2pk65addressindex: MetricPattern23[P2PK65AddressIndex] = MetricPattern23(client, f'{base_path}_first_p2pk65addressindex') - self.first_p2pkhaddressindex: MetricPattern23[P2PKHAddressIndex] = MetricPattern23(client, f'{base_path}_first_p2pkhaddressindex') - self.first_p2shaddressindex: MetricPattern23[P2SHAddressIndex] = MetricPattern23(client, f'{base_path}_first_p2shaddressindex') - self.first_p2traddressindex: MetricPattern23[P2TRAddressIndex] = MetricPattern23(client, f'{base_path}_first_p2traddressindex') - self.first_p2wpkhaddressindex: MetricPattern23[P2WPKHAddressIndex] = MetricPattern23(client, f'{base_path}_first_p2wpkhaddressindex') - self.first_p2wshaddressindex: MetricPattern23[P2WSHAddressIndex] = MetricPattern23(client, f'{base_path}_first_p2wshaddressindex') - self.p2abytes: MetricPattern27[P2ABytes] = MetricPattern27(client, f'{base_path}_p2abytes') - self.p2pk33bytes: MetricPattern29[P2PK33Bytes] = MetricPattern29(client, f'{base_path}_p2pk33bytes') - self.p2pk65bytes: MetricPattern30[P2PK65Bytes] = MetricPattern30(client, f'{base_path}_p2pk65bytes') - self.p2pkhbytes: MetricPattern31[P2PKHBytes] = MetricPattern31(client, f'{base_path}_p2pkhbytes') - self.p2shbytes: MetricPattern32[P2SHBytes] = MetricPattern32(client, f'{base_path}_p2shbytes') - self.p2trbytes: MetricPattern33[P2TRBytes] = MetricPattern33(client, f'{base_path}_p2trbytes') - self.p2wpkhbytes: MetricPattern34[P2WPKHBytes] = MetricPattern34(client, f'{base_path}_p2wpkhbytes') - self.p2wshbytes: MetricPattern35[P2WSHBytes] = MetricPattern35(client, f'{base_path}_p2wshbytes') + self.first_p2aaddressindex: MetricPattern12[P2AAddressIndex] = MetricPattern12(client, f'{base_path}_first_p2aaddressindex') + self.first_p2pk33addressindex: MetricPattern12[P2PK33AddressIndex] = MetricPattern12(client, f'{base_path}_first_p2pk33addressindex') + self.first_p2pk65addressindex: MetricPattern12[P2PK65AddressIndex] = MetricPattern12(client, f'{base_path}_first_p2pk65addressindex') + self.first_p2pkhaddressindex: MetricPattern12[P2PKHAddressIndex] = MetricPattern12(client, f'{base_path}_first_p2pkhaddressindex') + self.first_p2shaddressindex: MetricPattern12[P2SHAddressIndex] = MetricPattern12(client, f'{base_path}_first_p2shaddressindex') + self.first_p2traddressindex: MetricPattern12[P2TRAddressIndex] = MetricPattern12(client, f'{base_path}_first_p2traddressindex') + self.first_p2wpkhaddressindex: MetricPattern12[P2WPKHAddressIndex] = MetricPattern12(client, f'{base_path}_first_p2wpkhaddressindex') + self.first_p2wshaddressindex: MetricPattern12[P2WSHAddressIndex] = MetricPattern12(client, f'{base_path}_first_p2wshaddressindex') + self.p2abytes: MetricPattern17[P2ABytes] = MetricPattern17(client, f'{base_path}_p2abytes') + self.p2pk33bytes: MetricPattern19[P2PK33Bytes] = MetricPattern19(client, f'{base_path}_p2pk33bytes') + self.p2pk65bytes: MetricPattern20[P2PK65Bytes] = MetricPattern20(client, f'{base_path}_p2pk65bytes') + self.p2pkhbytes: MetricPattern21[P2PKHBytes] = MetricPattern21(client, f'{base_path}_p2pkhbytes') + self.p2shbytes: MetricPattern22[P2SHBytes] = MetricPattern22(client, f'{base_path}_p2shbytes') + self.p2trbytes: MetricPattern23[P2TRBytes] = MetricPattern23(client, f'{base_path}_p2trbytes') + self.p2wpkhbytes: MetricPattern24[P2WPKHBytes] = MetricPattern24(client, f'{base_path}_p2wpkhbytes') + self.p2wshbytes: MetricPattern25[P2WSHBytes] = MetricPattern25(client, f'{base_path}_p2wshbytes') class CatalogTree_Blocks: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.blockhash: MetricPattern23[BlockHash] = MetricPattern23(client, f'{base_path}_blockhash') + self.blockhash: MetricPattern12[BlockHash] = MetricPattern12(client, f'{base_path}_blockhash') self.count: CatalogTree_Blocks_Count = CatalogTree_Blocks_Count(client, f'{base_path}_count') self.difficulty: CatalogTree_Blocks_Difficulty = CatalogTree_Blocks_Difficulty(client, f'{base_path}_difficulty') self.halving: CatalogTree_Blocks_Halving = CatalogTree_Blocks_Halving(client, f'{base_path}_halving') - self.interval: IntervalPattern[Timestamp] = IntervalPattern(client, 'block_interval') + self.interval: CatalogTree_Blocks_Interval = CatalogTree_Blocks_Interval(client, f'{base_path}_interval') self.mining: CatalogTree_Blocks_Mining = CatalogTree_Blocks_Mining(client, f'{base_path}_mining') self.rewards: CatalogTree_Blocks_Rewards = CatalogTree_Blocks_Rewards(client, f'{base_path}_rewards') self.size: CatalogTree_Blocks_Size = CatalogTree_Blocks_Size(client, f'{base_path}_size') self.time: CatalogTree_Blocks_Time = CatalogTree_Blocks_Time(client, f'{base_path}_time') - self.timestamp: MetricPattern23[Timestamp] = MetricPattern23(client, f'{base_path}_timestamp') - self.total_size: MetricPattern23[StoredU64] = MetricPattern23(client, f'{base_path}_total_size') + self.timestamp: MetricPattern12[Timestamp] = MetricPattern12(client, f'{base_path}_timestamp') + self.total_size: MetricPattern12[StoredU64] = MetricPattern12(client, f'{base_path}_total_size') self.weight: CatalogTree_Blocks_Weight = CatalogTree_Blocks_Weight(client, f'{base_path}_weight') class CatalogTree_Blocks_Count: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1m_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}_1m_block_count') - self._1m_start: MetricPattern23[Height] = MetricPattern23(client, f'{base_path}_1m_start') - self._1w_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}_1w_block_count') - self._1w_start: MetricPattern23[Height] = MetricPattern23(client, f'{base_path}_1w_start') - self._1y_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}_1y_block_count') - self._1y_start: MetricPattern23[Height] = MetricPattern23(client, f'{base_path}_1y_start') - self._24h_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}_24h_block_count') - self._24h_start: MetricPattern23[Height] = MetricPattern23(client, f'{base_path}_24h_start') + self._1m_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}__1m_block_count') + self._1m_start: MetricPattern12[Height] = MetricPattern12(client, f'{base_path}__1m_start') + self._1w_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}__1w_block_count') + self._1w_start: MetricPattern12[Height] = MetricPattern12(client, f'{base_path}__1w_start') + self._1y_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}__1y_block_count') + self._1y_start: MetricPattern12[Height] = MetricPattern12(client, f'{base_path}__1y_start') + self._24h_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}__24h_block_count') + self._24h_start: MetricPattern12[Height] = MetricPattern12(client, f'{base_path}__24h_start') self.block_count: BlockCountPattern[StoredU32] = BlockCountPattern(client, 'block_count') self.block_count_target: MetricPattern4[StoredU64] = MetricPattern4(client, f'{base_path}_block_count_target') class CatalogTree_Blocks_Difficulty: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.base: MetricPattern23[StoredF64] = MetricPattern23(client, f'{base_path}_base') + self.base: MetricPattern12[StoredF64] = MetricPattern12(client, f'{base_path}_base') self.blocks_before_next_difficulty_adjustment: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}_blocks_before_next_difficulty_adjustment') self.days_before_next_difficulty_adjustment: MetricPattern1[StoredF32] = MetricPattern1(client, f'{base_path}_days_before_next_difficulty_adjustment') - self.difficultyepoch: MetricPattern4[DifficultyEpoch] = MetricPattern4(client, f'{base_path}_difficultyepoch') + self.epoch: MetricPattern4[DifficultyEpoch] = MetricPattern4(client, f'{base_path}_epoch') class CatalogTree_Blocks_Halving: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.blocks_before_next_halving: MetricPattern1[StoredU32] = MetricPattern1(client, f'{base_path}_blocks_before_next_halving') self.days_before_next_halving: MetricPattern1[StoredF32] = MetricPattern1(client, f'{base_path}_days_before_next_halving') - self.halvingepoch: MetricPattern4[HalvingEpoch] = MetricPattern4(client, f'{base_path}_halvingepoch') + self.epoch: MetricPattern4[HalvingEpoch] = MetricPattern4(client, f'{base_path}_epoch') + +class CatalogTree_Blocks_Interval: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.average: MetricPattern2[Timestamp] = MetricPattern2(client, f'{base_path}_average') + self.base: MetricPattern12[Timestamp] = MetricPattern12(client, f'{base_path}_base') + self.max: MetricPattern2[Timestamp] = MetricPattern2(client, f'{base_path}_max') + self.median: MetricPattern7[Timestamp] = MetricPattern7(client, f'{base_path}_median') + self.min: MetricPattern2[Timestamp] = MetricPattern2(client, f'{base_path}_min') + self.pct10: MetricPattern7[Timestamp] = MetricPattern7(client, f'{base_path}_pct10') + self.pct25: MetricPattern7[Timestamp] = MetricPattern7(client, f'{base_path}_pct25') + self.pct75: MetricPattern7[Timestamp] = MetricPattern7(client, f'{base_path}_pct75') + self.pct90: MetricPattern7[Timestamp] = MetricPattern7(client, f'{base_path}_pct90') class CatalogTree_Blocks_Mining: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.difficulty: MetricPattern2[StoredF64] = MetricPattern2(client, f'{base_path}_difficulty') self.difficulty_adjustment: MetricPattern1[StoredF32] = MetricPattern1(client, f'{base_path}_difficulty_adjustment') @@ -2812,45 +2608,55 @@ class CatalogTree_Blocks_Mining: class CatalogTree_Blocks_Rewards: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self._24h_coinbase_sum: MetricPattern23[Sats] = MetricPattern23(client, f'{base_path}_24h_coinbase_sum') - self._24h_coinbase_usd_sum: MetricPattern23[Dollars] = MetricPattern23(client, f'{base_path}_24h_coinbase_usd_sum') + self._24h_coinbase_sum: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, '24h_coinbase_sum') self.coinbase: CoinbasePattern = CoinbasePattern(client, 'coinbase') - self.fee_dominance: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_fee_dominance') + self.fee_dominance: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_fee_dominance') self.subsidy: CoinbasePattern = CoinbasePattern(client, 'subsidy') - self.subsidy_dominance: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_subsidy_dominance') + self.subsidy_dominance: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_subsidy_dominance') self.subsidy_usd_1y_sma: MetricPattern4[Dollars] = MetricPattern4(client, f'{base_path}_subsidy_usd_1y_sma') self.unclaimed_rewards: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'unclaimed_rewards') class CatalogTree_Blocks_Size: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.block_size: BlockSizePattern[StoredU64] = BlockSizePattern(client, 'block_size') - self.block_vbytes: BlockSizePattern[StoredU64] = BlockSizePattern(client, 'block_vbytes') - self.vbytes: MetricPattern23[StoredU64] = MetricPattern23(client, f'{base_path}_vbytes') + self.size: SizePattern[StoredU64] = SizePattern(client, 'block_size') + self.vbytes: CatalogTree_Blocks_Size_Vbytes = CatalogTree_Blocks_Size_Vbytes(client, f'{base_path}_vbytes') + +class CatalogTree_Blocks_Size_Vbytes: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.average: MetricPattern2[StoredU64] = MetricPattern2(client, f'{base_path}_average') + self.base: MetricPattern12[StoredU64] = MetricPattern12(client, f'{base_path}_base') + self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_cumulative') + self.max: MetricPattern2[StoredU64] = MetricPattern2(client, f'{base_path}_max') + self.min: MetricPattern2[StoredU64] = MetricPattern2(client, f'{base_path}_min') + self.percentiles: PercentilesPattern[StoredU64] = PercentilesPattern(client, 'block_vbytes') + self.sum: MetricPattern2[StoredU64] = MetricPattern2(client, f'{base_path}_sum') class CatalogTree_Blocks_Time: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.date: MetricPattern23[Date] = MetricPattern23(client, f'{base_path}_date') - self.date_fixed: MetricPattern23[Date] = MetricPattern23(client, f'{base_path}_date_fixed') + self.date: MetricPattern12[Date] = MetricPattern12(client, f'{base_path}_date') + self.date_fixed: MetricPattern12[Date] = MetricPattern12(client, f'{base_path}_date_fixed') self.timestamp: MetricPattern2[Timestamp] = MetricPattern2(client, f'{base_path}_timestamp') - self.timestamp_fixed: MetricPattern23[Timestamp] = MetricPattern23(client, f'{base_path}_timestamp_fixed') + self.timestamp_fixed: MetricPattern12[Timestamp] = MetricPattern12(client, f'{base_path}_timestamp_fixed') class CatalogTree_Blocks_Weight: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.base: MetricPattern23[Weight] = MetricPattern23(client, f'{base_path}_base') - self.block_fullness: BitcoinPattern[StoredF32] = BitcoinPattern(client, 'block_fullness') - self.block_weight: BlockSizePattern[Weight] = BlockSizePattern(client, 'block_weight') + self.base: MetricPattern12[Weight] = MetricPattern12(client, f'{base_path}_base') + self.fullness: BitcoinPattern[StoredF32] = BitcoinPattern(client, 'block_fullness') + self.weight: SizePattern[Weight] = SizePattern(client, 'block_weight') class CatalogTree_Cointime: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.activity: CatalogTree_Cointime_Activity = CatalogTree_Cointime_Activity(client, f'{base_path}_activity') self.adjusted: CatalogTree_Cointime_Adjusted = CatalogTree_Cointime_Adjusted(client, f'{base_path}_adjusted') @@ -2861,7 +2667,7 @@ class CatalogTree_Cointime: class CatalogTree_Cointime_Activity: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.activity_to_vaultedness_ratio: MetricPattern1[StoredF64] = MetricPattern1(client, f'{base_path}_activity_to_vaultedness_ratio') self.coinblocks_created: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'coinblocks_created') @@ -2871,7 +2677,7 @@ class CatalogTree_Cointime_Activity: class CatalogTree_Cointime_Adjusted: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.cointime_adj_inflation_rate: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_cointime_adj_inflation_rate') self.cointime_adj_tx_btc_velocity: MetricPattern4[StoredF64] = MetricPattern4(client, f'{base_path}_cointime_adj_tx_btc_velocity') @@ -2879,7 +2685,7 @@ class CatalogTree_Cointime_Adjusted: class CatalogTree_Cointime_Cap: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.active_cap: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_active_cap') self.cointime_cap: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_cointime_cap') @@ -2889,7 +2695,7 @@ class CatalogTree_Cointime_Cap: class CatalogTree_Cointime_Pricing: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.active_price: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_active_price') self.active_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'active_price_ratio') @@ -2902,14 +2708,14 @@ class CatalogTree_Cointime_Pricing: class CatalogTree_Cointime_Supply: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.active_supply: ActiveSupplyPattern = ActiveSupplyPattern(client, 'active_supply') - self.vaulted_supply: ActiveSupplyPattern = ActiveSupplyPattern(client, 'vaulted_supply') + self.active_supply: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'active_supply') + self.vaulted_supply: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'vaulted_supply') class CatalogTree_Cointime_Value: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.cointime_value_created: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'cointime_value_created') self.cointime_value_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'cointime_value_destroyed') @@ -2917,7 +2723,7 @@ class CatalogTree_Cointime_Value: class CatalogTree_Constants: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.constant_0: MetricPattern3[StoredU16] = MetricPattern3(client, f'{base_path}_constant_0') self.constant_1: MetricPattern3[StoredU16] = MetricPattern3(client, f'{base_path}_constant_1') @@ -2940,21 +2746,21 @@ class CatalogTree_Constants: class CatalogTree_Distribution: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.addr_count: AddrCountPattern = AddrCountPattern(client, 'addr_count') self.address_cohorts: CatalogTree_Distribution_AddressCohorts = CatalogTree_Distribution_AddressCohorts(client, f'{base_path}_address_cohorts') self.addresses_data: CatalogTree_Distribution_AddressesData = CatalogTree_Distribution_AddressesData(client, f'{base_path}_addresses_data') self.any_address_indexes: CatalogTree_Distribution_AnyAddressIndexes = CatalogTree_Distribution_AnyAddressIndexes(client, f'{base_path}_any_address_indexes') - self.chain_state: MetricPattern23[SupplyState] = MetricPattern23(client, f'{base_path}_chain_state') + self.chain_state: MetricPattern12[SupplyState] = MetricPattern12(client, f'{base_path}_chain_state') self.empty_addr_count: AddrCountPattern = AddrCountPattern(client, 'empty_addr_count') - self.emptyaddressindex: MetricPattern39[EmptyAddressIndex] = MetricPattern39(client, f'{base_path}_emptyaddressindex') - self.loadedaddressindex: MetricPattern38[LoadedAddressIndex] = MetricPattern38(client, f'{base_path}_loadedaddressindex') + self.emptyaddressindex: MetricPattern33[EmptyAddressIndex] = MetricPattern33(client, f'{base_path}_emptyaddressindex') + self.loadedaddressindex: MetricPattern32[LoadedAddressIndex] = MetricPattern32(client, f'{base_path}_loadedaddressindex') self.utxo_cohorts: CatalogTree_Distribution_UtxoCohorts = CatalogTree_Distribution_UtxoCohorts(client, f'{base_path}_utxo_cohorts') class CatalogTree_Distribution_AddressCohorts: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.amount_range: CatalogTree_Distribution_AddressCohorts_AmountRange = CatalogTree_Distribution_AddressCohorts_AmountRange(client, f'{base_path}_amount_range') self.ge_amount: CatalogTree_Distribution_AddressCohorts_GeAmount = CatalogTree_Distribution_AddressCohorts_GeAmount(client, f'{base_path}_ge_amount') @@ -2962,7 +2768,7 @@ class CatalogTree_Distribution_AddressCohorts: class CatalogTree_Distribution_AddressCohorts_AmountRange: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._0sats: _0satsPattern = _0satsPattern(client, 'addrs_with_0sats') self._100btc_to_1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_100btc_under_1k_btc') @@ -2982,7 +2788,7 @@ class CatalogTree_Distribution_AddressCohorts_AmountRange: class CatalogTree_Distribution_AddressCohorts_GeAmount: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._100btc: _0satsPattern = _0satsPattern(client, 'addrs_above_100btc') self._100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100k_sats') @@ -3000,7 +2806,7 @@ class CatalogTree_Distribution_AddressCohorts_GeAmount: class CatalogTree_Distribution_AddressCohorts_LtAmount: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._100btc: _0satsPattern = _0satsPattern(client, 'addrs_under_100btc') self._100k_btc: _0satsPattern = _0satsPattern(client, 'addrs_under_100k_btc') @@ -3018,27 +2824,27 @@ class CatalogTree_Distribution_AddressCohorts_LtAmount: class CatalogTree_Distribution_AddressesData: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.empty: MetricPattern39[EmptyAddressData] = MetricPattern39(client, f'{base_path}_empty') - self.loaded: MetricPattern38[LoadedAddressData] = MetricPattern38(client, f'{base_path}_loaded') + self.empty: MetricPattern33[EmptyAddressData] = MetricPattern33(client, f'{base_path}_empty') + self.loaded: MetricPattern32[LoadedAddressData] = MetricPattern32(client, f'{base_path}_loaded') class CatalogTree_Distribution_AnyAddressIndexes: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.p2a: MetricPattern27[AnyAddressIndex] = MetricPattern27(client, f'{base_path}_p2a') - self.p2pk33: MetricPattern29[AnyAddressIndex] = MetricPattern29(client, f'{base_path}_p2pk33') - self.p2pk65: MetricPattern30[AnyAddressIndex] = MetricPattern30(client, f'{base_path}_p2pk65') - self.p2pkh: MetricPattern31[AnyAddressIndex] = MetricPattern31(client, f'{base_path}_p2pkh') - self.p2sh: MetricPattern32[AnyAddressIndex] = MetricPattern32(client, f'{base_path}_p2sh') - self.p2tr: MetricPattern33[AnyAddressIndex] = MetricPattern33(client, f'{base_path}_p2tr') - self.p2wpkh: MetricPattern34[AnyAddressIndex] = MetricPattern34(client, f'{base_path}_p2wpkh') - self.p2wsh: MetricPattern35[AnyAddressIndex] = MetricPattern35(client, f'{base_path}_p2wsh') + self.p2a: MetricPattern17[AnyAddressIndex] = MetricPattern17(client, f'{base_path}_p2a') + self.p2pk33: MetricPattern19[AnyAddressIndex] = MetricPattern19(client, f'{base_path}_p2pk33') + self.p2pk65: MetricPattern20[AnyAddressIndex] = MetricPattern20(client, f'{base_path}_p2pk65') + self.p2pkh: MetricPattern21[AnyAddressIndex] = MetricPattern21(client, f'{base_path}_p2pkh') + self.p2sh: MetricPattern22[AnyAddressIndex] = MetricPattern22(client, f'{base_path}_p2sh') + self.p2tr: MetricPattern23[AnyAddressIndex] = MetricPattern23(client, f'{base_path}_p2tr') + self.p2wpkh: MetricPattern24[AnyAddressIndex] = MetricPattern24(client, f'{base_path}_p2wpkh') + self.p2wsh: MetricPattern25[AnyAddressIndex] = MetricPattern25(client, f'{base_path}_p2wsh') class CatalogTree_Distribution_UtxoCohorts: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.age_range: CatalogTree_Distribution_UtxoCohorts_AgeRange = CatalogTree_Distribution_UtxoCohorts_AgeRange(client, f'{base_path}_age_range') self.all: CatalogTree_Distribution_UtxoCohorts_All = CatalogTree_Distribution_UtxoCohorts_All(client, f'{base_path}_all') @@ -3054,7 +2860,7 @@ class CatalogTree_Distribution_UtxoCohorts: class CatalogTree_Distribution_UtxoCohorts_AgeRange: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._10y_to_12y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_10y_up_to_12y_old') self._12y_to_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_12y_up_to_15y_old') @@ -3080,29 +2886,30 @@ class CatalogTree_Distribution_UtxoCohorts_AgeRange: class CatalogTree_Distribution_UtxoCohorts_All: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.activity: ActivityPattern2 = ActivityPattern2(client, '') self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, '') + self.outputs: OutputsPattern = OutputsPattern(client, 'utxo_count') self.realized: RealizedPattern3 = RealizedPattern3(client, '') self.relative: CatalogTree_Distribution_UtxoCohorts_All_Relative = CatalogTree_Distribution_UtxoCohorts_All_Relative(client, f'{base_path}_relative') - self.supply: SupplyPattern2 = SupplyPattern2(client, '') + self.supply: SupplyPattern2 = SupplyPattern2(client, 'supply') self.unrealized: UnrealizedPattern = UnrealizedPattern(client, '') class CatalogTree_Distribution_UtxoCohorts_All_Relative: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, f'{base_path}_neg_unrealized_loss_rel_to_own_total_unrealized_pnl') - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, f'{base_path}_net_unrealized_pnl_rel_to_own_total_unrealized_pnl') - self.supply_in_loss_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, f'{base_path}_supply_in_loss_rel_to_own_supply') - self.supply_in_profit_rel_to_own_supply: MetricPattern3[StoredF64] = MetricPattern3(client, f'{base_path}_supply_in_profit_rel_to_own_supply') - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, f'{base_path}_unrealized_loss_rel_to_own_total_unrealized_pnl') - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern3[StoredF32] = MetricPattern3(client, f'{base_path}_unrealized_profit_rel_to_own_total_unrealized_pnl') + self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, f'{base_path}_neg_unrealized_loss_rel_to_own_total_unrealized_pnl') + self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, f'{base_path}_net_unrealized_pnl_rel_to_own_total_unrealized_pnl') + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, f'{base_path}_supply_in_loss_rel_to_own_supply') + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, f'{base_path}_supply_in_profit_rel_to_own_supply') + self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, f'{base_path}_unrealized_loss_rel_to_own_total_unrealized_pnl') + self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, f'{base_path}_unrealized_profit_rel_to_own_total_unrealized_pnl') class CatalogTree_Distribution_UtxoCohorts_AmountRange: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._0sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_with_0sats') self._100btc_to_1k_btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100btc_under_1k_btc') @@ -3122,7 +2929,7 @@ class CatalogTree_Distribution_UtxoCohorts_AmountRange: class CatalogTree_Distribution_UtxoCohorts_Epoch: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._0: _0satsPattern2 = _0satsPattern2(client, 'epoch_0') self._1: _0satsPattern2 = _0satsPattern2(client, 'epoch_1') @@ -3132,7 +2939,7 @@ class CatalogTree_Distribution_UtxoCohorts_Epoch: class CatalogTree_Distribution_UtxoCohorts_GeAmount: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._100btc: _100btcPattern = _100btcPattern(client, 'utxos_above_100btc') self._100k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_100k_sats') @@ -3150,7 +2957,7 @@ class CatalogTree_Distribution_UtxoCohorts_GeAmount: class CatalogTree_Distribution_UtxoCohorts_LtAmount: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._100btc: _100btcPattern = _100btcPattern(client, 'utxos_under_100btc') self._100k_btc: _100btcPattern = _100btcPattern(client, 'utxos_under_100k_btc') @@ -3168,7 +2975,7 @@ class CatalogTree_Distribution_UtxoCohorts_LtAmount: class CatalogTree_Distribution_UtxoCohorts_MaxAge: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._10y: _10yPattern = _10yPattern(client, 'utxos_up_to_10y_old') self._12y: _10yPattern = _10yPattern(client, 'utxos_up_to_12y_old') @@ -3191,7 +2998,7 @@ class CatalogTree_Distribution_UtxoCohorts_MaxAge: class CatalogTree_Distribution_UtxoCohorts_MinAge: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._10y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_10y_old') self._12y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_12y_old') @@ -3214,36 +3021,38 @@ class CatalogTree_Distribution_UtxoCohorts_MinAge: class CatalogTree_Distribution_UtxoCohorts_Term: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.long: CatalogTree_Distribution_UtxoCohorts_Term_Long = CatalogTree_Distribution_UtxoCohorts_Term_Long(client, f'{base_path}_long') self.short: CatalogTree_Distribution_UtxoCohorts_Term_Short = CatalogTree_Distribution_UtxoCohorts_Term_Short(client, f'{base_path}_short') class CatalogTree_Distribution_UtxoCohorts_Term_Long: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.activity: ActivityPattern2 = ActivityPattern2(client, 'lth') self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, 'lth') + self.outputs: OutputsPattern = OutputsPattern(client, 'lth_utxo_count') self.realized: RealizedPattern2 = RealizedPattern2(client, 'lth') self.relative: RelativePattern5 = RelativePattern5(client, 'lth') - self.supply: SupplyPattern2 = SupplyPattern2(client, 'lth') + self.supply: SupplyPattern2 = SupplyPattern2(client, 'lth_supply') self.unrealized: UnrealizedPattern = UnrealizedPattern(client, 'lth') class CatalogTree_Distribution_UtxoCohorts_Term_Short: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.activity: ActivityPattern2 = ActivityPattern2(client, 'sth') self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, 'sth') + self.outputs: OutputsPattern = OutputsPattern(client, 'sth_utxo_count') self.realized: RealizedPattern3 = RealizedPattern3(client, 'sth') self.relative: RelativePattern5 = RelativePattern5(client, 'sth') - self.supply: SupplyPattern2 = SupplyPattern2(client, 'sth') + self.supply: SupplyPattern2 = SupplyPattern2(client, 'sth_supply') self.unrealized: UnrealizedPattern = UnrealizedPattern(client, 'sth') class CatalogTree_Distribution_UtxoCohorts_Type: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.empty: _0satsPattern2 = _0satsPattern2(client, 'empty_outputs') self.p2a: _0satsPattern2 = _0satsPattern2(client, 'p2a') @@ -3259,7 +3068,7 @@ class CatalogTree_Distribution_UtxoCohorts_Type: class CatalogTree_Distribution_UtxoCohorts_Year: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._2009: _0satsPattern2 = _0satsPattern2(client, 'year_2009') self._2010: _0satsPattern2 = _0satsPattern2(client, 'year_2010') @@ -3282,101 +3091,159 @@ class CatalogTree_Distribution_UtxoCohorts_Year: class CatalogTree_Indexes: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.address: CatalogTree_Indexes_Address = CatalogTree_Indexes_Address(client, f'{base_path}_address') - self.block: CatalogTree_Indexes_Block = CatalogTree_Indexes_Block(client, f'{base_path}_block') - self.time: CatalogTree_Indexes_Time = CatalogTree_Indexes_Time(client, f'{base_path}_time') - self.transaction: CatalogTree_Indexes_Transaction = CatalogTree_Indexes_Transaction(client, f'{base_path}_transaction') + self.dateindex: CatalogTree_Indexes_Dateindex = CatalogTree_Indexes_Dateindex(client, f'{base_path}_dateindex') + self.decadeindex: CatalogTree_Indexes_Decadeindex = CatalogTree_Indexes_Decadeindex(client, f'{base_path}_decadeindex') + self.difficultyepoch: CatalogTree_Indexes_Difficultyepoch = CatalogTree_Indexes_Difficultyepoch(client, f'{base_path}_difficultyepoch') + self.halvingepoch: CatalogTree_Indexes_Halvingepoch = CatalogTree_Indexes_Halvingepoch(client, f'{base_path}_halvingepoch') + self.height: CatalogTree_Indexes_Height = CatalogTree_Indexes_Height(client, f'{base_path}_height') + self.monthindex: CatalogTree_Indexes_Monthindex = CatalogTree_Indexes_Monthindex(client, f'{base_path}_monthindex') + self.quarterindex: CatalogTree_Indexes_Quarterindex = CatalogTree_Indexes_Quarterindex(client, f'{base_path}_quarterindex') + self.semesterindex: CatalogTree_Indexes_Semesterindex = CatalogTree_Indexes_Semesterindex(client, f'{base_path}_semesterindex') + self.txindex: CatalogTree_Indexes_Txindex = CatalogTree_Indexes_Txindex(client, f'{base_path}_txindex') + self.txinindex: EmptyPattern[TxInIndex] = EmptyPattern(client, 'txinindex') + self.txoutindex: EmptyPattern[TxOutIndex] = EmptyPattern(client, 'txoutindex') + self.weekindex: CatalogTree_Indexes_Weekindex = CatalogTree_Indexes_Weekindex(client, f'{base_path}_weekindex') + self.yearindex: CatalogTree_Indexes_Yearindex = CatalogTree_Indexes_Yearindex(client, f'{base_path}_yearindex') class CatalogTree_Indexes_Address: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.emptyoutputindex: MetricPattern22[EmptyOutputIndex] = MetricPattern22(client, f'{base_path}_emptyoutputindex') - self.opreturnindex: MetricPattern25[OpReturnIndex] = MetricPattern25(client, f'{base_path}_opreturnindex') - self.p2aaddressindex: MetricPattern27[P2AAddressIndex] = MetricPattern27(client, f'{base_path}_p2aaddressindex') - self.p2msoutputindex: MetricPattern28[P2MSOutputIndex] = MetricPattern28(client, f'{base_path}_p2msoutputindex') - self.p2pk33addressindex: MetricPattern29[P2PK33AddressIndex] = MetricPattern29(client, f'{base_path}_p2pk33addressindex') - self.p2pk65addressindex: MetricPattern30[P2PK65AddressIndex] = MetricPattern30(client, f'{base_path}_p2pk65addressindex') - self.p2pkhaddressindex: MetricPattern31[P2PKHAddressIndex] = MetricPattern31(client, f'{base_path}_p2pkhaddressindex') - self.p2shaddressindex: MetricPattern32[P2SHAddressIndex] = MetricPattern32(client, f'{base_path}_p2shaddressindex') - self.p2traddressindex: MetricPattern33[P2TRAddressIndex] = MetricPattern33(client, f'{base_path}_p2traddressindex') - self.p2wpkhaddressindex: MetricPattern34[P2WPKHAddressIndex] = MetricPattern34(client, f'{base_path}_p2wpkhaddressindex') - self.p2wshaddressindex: MetricPattern35[P2WSHAddressIndex] = MetricPattern35(client, f'{base_path}_p2wshaddressindex') - self.unknownoutputindex: MetricPattern37[UnknownOutputIndex] = MetricPattern37(client, f'{base_path}_unknownoutputindex') + self.empty: EmptyPattern[EmptyOutputIndex] = EmptyPattern(client, 'emptyoutputindex') + self.opreturn: EmptyPattern[OpReturnIndex] = EmptyPattern(client, 'opreturnindex') + self.p2a: EmptyPattern[P2AAddressIndex] = EmptyPattern(client, 'p2aaddressindex') + self.p2ms: EmptyPattern[P2MSOutputIndex] = EmptyPattern(client, 'p2msoutputindex') + self.p2pk33: EmptyPattern[P2PK33AddressIndex] = EmptyPattern(client, 'p2pk33addressindex') + self.p2pk65: EmptyPattern[P2PK65AddressIndex] = EmptyPattern(client, 'p2pk65addressindex') + self.p2pkh: EmptyPattern[P2PKHAddressIndex] = EmptyPattern(client, 'p2pkhaddressindex') + self.p2sh: EmptyPattern[P2SHAddressIndex] = EmptyPattern(client, 'p2shaddressindex') + self.p2tr: EmptyPattern[P2TRAddressIndex] = EmptyPattern(client, 'p2traddressindex') + self.p2wpkh: EmptyPattern[P2WPKHAddressIndex] = EmptyPattern(client, 'p2wpkhaddressindex') + self.p2wsh: EmptyPattern[P2WSHAddressIndex] = EmptyPattern(client, 'p2wshaddressindex') + self.unknown: EmptyPattern[UnknownOutputIndex] = EmptyPattern(client, 'unknownoutputindex') -class CatalogTree_Indexes_Block: +class CatalogTree_Indexes_Dateindex: """Catalog tree node.""" - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern7[Date] = MetricPattern7(client, f'{base_path}_date') + self.first_height: MetricPattern7[Height] = MetricPattern7(client, f'{base_path}_first_height') + self.height_count: MetricPattern7[StoredU64] = MetricPattern7(client, f'{base_path}_height_count') + self.identity: MetricPattern7[DateIndex] = MetricPattern7(client, f'{base_path}_identity') + self.monthindex: MetricPattern7[MonthIndex] = MetricPattern7(client, f'{base_path}_monthindex') + self.weekindex: MetricPattern7[WeekIndex] = MetricPattern7(client, f'{base_path}_weekindex') + +class CatalogTree_Indexes_Decadeindex: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_yearindex: MetricPattern8[YearIndex] = MetricPattern8(client, f'{base_path}_first_yearindex') + self.identity: MetricPattern8[DecadeIndex] = MetricPattern8(client, f'{base_path}_identity') + self.yearindex_count: MetricPattern8[StoredU64] = MetricPattern8(client, f'{base_path}_yearindex_count') + +class CatalogTree_Indexes_Difficultyepoch: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_height: MetricPattern9[Height] = MetricPattern9(client, f'{base_path}_first_height') + self.height_count: MetricPattern9[StoredU64] = MetricPattern9(client, f'{base_path}_height_count') + self.identity: MetricPattern9[DifficultyEpoch] = MetricPattern9(client, f'{base_path}_identity') + +class CatalogTree_Indexes_Halvingepoch: + """Catalog tree node.""" + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.dateindex: MetricPattern23[DateIndex] = MetricPattern23(client, f'{base_path}_dateindex') - self.difficultyepoch: MetricPattern12[DifficultyEpoch] = MetricPattern12(client, f'{base_path}_difficultyepoch') self.first_height: MetricPattern11[Height] = MetricPattern11(client, f'{base_path}_first_height') - self.halvingepoch: MetricPattern13[HalvingEpoch] = MetricPattern13(client, f'{base_path}_halvingepoch') - self.height: MetricPattern23[Height] = MetricPattern23(client, f'{base_path}_height') - self.height_count: MetricPattern21[StoredU64] = MetricPattern21(client, f'{base_path}_height_count') - self.txindex_count: MetricPattern23[StoredU64] = MetricPattern23(client, f'{base_path}_txindex_count') + self.identity: MetricPattern11[HalvingEpoch] = MetricPattern11(client, f'{base_path}_identity') -class CatalogTree_Indexes_Time: +class CatalogTree_Indexes_Height: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.date: MetricPattern19[Date] = MetricPattern19(client, f'{base_path}_date') - self.dateindex: MetricPattern19[DateIndex] = MetricPattern19(client, f'{base_path}_dateindex') - self.dateindex_count: MetricPattern17[StoredU64] = MetricPattern17(client, f'{base_path}_dateindex_count') - self.decadeindex: MetricPattern10[DecadeIndex] = MetricPattern10(client, f'{base_path}_decadeindex') - self.first_dateindex: MetricPattern17[DateIndex] = MetricPattern17(client, f'{base_path}_first_dateindex') - self.first_height: MetricPattern19[Height] = MetricPattern19(client, f'{base_path}_first_height') - self.first_monthindex: MetricPattern6[MonthIndex] = MetricPattern6(client, f'{base_path}_first_monthindex') - self.first_yearindex: MetricPattern20[YearIndex] = MetricPattern20(client, f'{base_path}_first_yearindex') - self.height_count: MetricPattern19[StoredU64] = MetricPattern19(client, f'{base_path}_height_count') - self.monthindex: MetricPattern8[MonthIndex] = MetricPattern8(client, f'{base_path}_monthindex') - self.monthindex_count: MetricPattern6[StoredU64] = MetricPattern6(client, f'{base_path}_monthindex_count') - self.quarterindex: MetricPattern15[QuarterIndex] = MetricPattern15(client, f'{base_path}_quarterindex') - self.semesterindex: MetricPattern16[SemesterIndex] = MetricPattern16(client, f'{base_path}_semesterindex') - self.weekindex: MetricPattern9[WeekIndex] = MetricPattern9(client, f'{base_path}_weekindex') - self.yearindex: MetricPattern18[YearIndex] = MetricPattern18(client, f'{base_path}_yearindex') - self.yearindex_count: MetricPattern20[StoredU64] = MetricPattern20(client, f'{base_path}_yearindex_count') + self.dateindex: MetricPattern12[DateIndex] = MetricPattern12(client, f'{base_path}_dateindex') + self.difficultyepoch: MetricPattern12[DifficultyEpoch] = MetricPattern12(client, f'{base_path}_difficultyepoch') + self.halvingepoch: MetricPattern12[HalvingEpoch] = MetricPattern12(client, f'{base_path}_halvingepoch') + self.identity: MetricPattern12[Height] = MetricPattern12(client, f'{base_path}_identity') + self.txindex_count: MetricPattern12[StoredU64] = MetricPattern12(client, f'{base_path}_txindex_count') -class CatalogTree_Indexes_Transaction: +class CatalogTree_Indexes_Monthindex: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.input_count: MetricPattern36[StoredU64] = MetricPattern36(client, f'{base_path}_input_count') - self.output_count: MetricPattern36[StoredU64] = MetricPattern36(client, f'{base_path}_output_count') - self.txindex: MetricPattern36[TxIndex] = MetricPattern36(client, f'{base_path}_txindex') - self.txinindex: MetricPattern24[TxInIndex] = MetricPattern24(client, f'{base_path}_txinindex') - self.txoutindex: MetricPattern26[TxOutIndex] = MetricPattern26(client, f'{base_path}_txoutindex') + self.dateindex_count: MetricPattern14[StoredU64] = MetricPattern14(client, f'{base_path}_dateindex_count') + self.first_dateindex: MetricPattern14[DateIndex] = MetricPattern14(client, f'{base_path}_first_dateindex') + self.identity: MetricPattern14[MonthIndex] = MetricPattern14(client, f'{base_path}_identity') + self.quarterindex: MetricPattern14[QuarterIndex] = MetricPattern14(client, f'{base_path}_quarterindex') + self.semesterindex: MetricPattern14[SemesterIndex] = MetricPattern14(client, f'{base_path}_semesterindex') + self.yearindex: MetricPattern14[YearIndex] = MetricPattern14(client, f'{base_path}_yearindex') + +class CatalogTree_Indexes_Quarterindex: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_monthindex: MetricPattern26[MonthIndex] = MetricPattern26(client, f'{base_path}_first_monthindex') + self.identity: MetricPattern26[QuarterIndex] = MetricPattern26(client, f'{base_path}_identity') + self.monthindex_count: MetricPattern26[StoredU64] = MetricPattern26(client, f'{base_path}_monthindex_count') + +class CatalogTree_Indexes_Semesterindex: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_monthindex: MetricPattern27[MonthIndex] = MetricPattern27(client, f'{base_path}_first_monthindex') + self.identity: MetricPattern27[SemesterIndex] = MetricPattern27(client, f'{base_path}_identity') + self.monthindex_count: MetricPattern27[StoredU64] = MetricPattern27(client, f'{base_path}_monthindex_count') + +class CatalogTree_Indexes_Txindex: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern28[TxIndex] = MetricPattern28(client, f'{base_path}_identity') + self.input_count: MetricPattern28[StoredU64] = MetricPattern28(client, f'{base_path}_input_count') + self.output_count: MetricPattern28[StoredU64] = MetricPattern28(client, f'{base_path}_output_count') + +class CatalogTree_Indexes_Weekindex: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.dateindex_count: MetricPattern30[StoredU64] = MetricPattern30(client, f'{base_path}_dateindex_count') + self.first_dateindex: MetricPattern30[DateIndex] = MetricPattern30(client, f'{base_path}_first_dateindex') + self.identity: MetricPattern30[WeekIndex] = MetricPattern30(client, f'{base_path}_identity') + +class CatalogTree_Indexes_Yearindex: + """Catalog tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.decadeindex: MetricPattern31[DecadeIndex] = MetricPattern31(client, f'{base_path}_decadeindex') + self.first_monthindex: MetricPattern31[MonthIndex] = MetricPattern31(client, f'{base_path}_first_monthindex') + self.identity: MetricPattern31[YearIndex] = MetricPattern31(client, f'{base_path}_identity') + self.monthindex_count: MetricPattern31[StoredU64] = MetricPattern31(client, f'{base_path}_monthindex_count') class CatalogTree_Inputs: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.count: CatalogTree_Inputs_Count = CatalogTree_Inputs_Count(client, f'{base_path}_count') - self.first_txinindex: MetricPattern23[TxInIndex] = MetricPattern23(client, f'{base_path}_first_txinindex') - self.outpoint: MetricPattern24[OutPoint] = MetricPattern24(client, f'{base_path}_outpoint') - self.outputtype: MetricPattern24[OutputType] = MetricPattern24(client, f'{base_path}_outputtype') + self.count: SizePattern[StoredU64] = SizePattern(client, 'input_count') + self.first_txinindex: MetricPattern12[TxInIndex] = MetricPattern12(client, f'{base_path}_first_txinindex') + self.outpoint: MetricPattern13[OutPoint] = MetricPattern13(client, f'{base_path}_outpoint') + self.outputtype: MetricPattern13[OutputType] = MetricPattern13(client, f'{base_path}_outputtype') self.spent: CatalogTree_Inputs_Spent = CatalogTree_Inputs_Spent(client, f'{base_path}_spent') - self.txindex: MetricPattern24[TxIndex] = MetricPattern24(client, f'{base_path}_txindex') - self.typeindex: MetricPattern24[TypeIndex] = MetricPattern24(client, f'{base_path}_typeindex') - -class CatalogTree_Inputs_Count: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.count: BlockSizePattern[StoredU64] = BlockSizePattern(client, 'input_count') + self.txindex: MetricPattern13[TxIndex] = MetricPattern13(client, f'{base_path}_txindex') + self.typeindex: MetricPattern13[TypeIndex] = MetricPattern13(client, f'{base_path}_typeindex') + self.witness_size: MetricPattern13[StoredU32] = MetricPattern13(client, f'{base_path}_witness_size') class CatalogTree_Inputs_Spent: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.txoutindex: MetricPattern24[TxOutIndex] = MetricPattern24(client, f'{base_path}_txoutindex') - self.value: MetricPattern24[Sats] = MetricPattern24(client, f'{base_path}_value') + self.txoutindex: MetricPattern13[TxOutIndex] = MetricPattern13(client, f'{base_path}_txoutindex') + self.value: MetricPattern13[Sats] = MetricPattern13(client, f'{base_path}_value') class CatalogTree_Market: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.ath: CatalogTree_Market_Ath = CatalogTree_Market_Ath(client, f'{base_path}_ath') self.dca: CatalogTree_Market_Dca = CatalogTree_Market_Dca(client, f'{base_path}_dca') @@ -3389,18 +3256,18 @@ class CatalogTree_Market: class CatalogTree_Market_Ath: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.days_since_price_ath: MetricPattern4[StoredU16] = MetricPattern4(client, f'{base_path}_days_since_price_ath') self.max_days_between_price_aths: MetricPattern4[StoredU16] = MetricPattern4(client, f'{base_path}_max_days_between_price_aths') self.max_years_between_price_aths: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_max_years_between_price_aths') - self.price_ath: MetricPattern3[Dollars] = MetricPattern3(client, f'{base_path}_price_ath') + self.price_ath: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_price_ath') self.price_drawdown: MetricPattern3[StoredF32] = MetricPattern3(client, f'{base_path}_price_drawdown') self.years_since_price_ath: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_years_since_price_ath') class CatalogTree_Market_Dca: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.class_average_price: ClassAveragePricePattern[Dollars] = ClassAveragePricePattern(client, 'dca_class') self.class_returns: ClassAveragePricePattern[StoredF32] = ClassAveragePricePattern(client, 'dca_class') @@ -3413,53 +3280,53 @@ class CatalogTree_Market_Dca: class CatalogTree_Market_Dca_ClassStack: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self._2015: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2015_stack') - self._2016: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2016_stack') - self._2017: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2017_stack') - self._2018: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2018_stack') - self._2019: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2019_stack') - self._2020: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2020_stack') - self._2021: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2021_stack') - self._2022: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2022_stack') - self._2023: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2023_stack') - self._2024: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2024_stack') - self._2025: ActiveSupplyPattern = ActiveSupplyPattern(client, 'dca_class_2025_stack') + self._2015: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2015_stack') + self._2016: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2016_stack') + self._2017: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2017_stack') + self._2018: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2018_stack') + self._2019: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2019_stack') + self._2020: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2020_stack') + self._2021: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2021_stack') + self._2022: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2022_stack') + self._2023: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2023_stack') + self._2024: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2024_stack') + self._2025: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'dca_class_2025_stack') class CatalogTree_Market_Indicators: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.gini: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_gini') - self.macd_histogram: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_macd_histogram') - self.macd_line: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_macd_line') - self.macd_signal: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_macd_signal') + self.gini: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_gini') + self.macd_histogram: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_macd_histogram') + self.macd_line: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_macd_line') + self.macd_signal: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_macd_signal') self.nvt: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_nvt') - self.pi_cycle: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_pi_cycle') + self.pi_cycle: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_pi_cycle') self.puell_multiple: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_puell_multiple') - self.rsi_14d: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_rsi_14d') - self.rsi_14d_max: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_rsi_14d_max') - self.rsi_14d_min: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_rsi_14d_min') - self.rsi_average_gain_14d: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_rsi_average_gain_14d') - self.rsi_average_loss_14d: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_rsi_average_loss_14d') - self.rsi_gains: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_rsi_gains') - self.rsi_losses: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_rsi_losses') - self.stoch_d: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_stoch_d') - self.stoch_k: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_stoch_k') - self.stoch_rsi: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_stoch_rsi') - self.stoch_rsi_d: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_stoch_rsi_d') - self.stoch_rsi_k: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_stoch_rsi_k') + self.rsi_14d: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_rsi_14d') + self.rsi_14d_max: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_rsi_14d_max') + self.rsi_14d_min: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_rsi_14d_min') + self.rsi_average_gain_14d: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_rsi_average_gain_14d') + self.rsi_average_loss_14d: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_rsi_average_loss_14d') + self.rsi_gains: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_rsi_gains') + self.rsi_losses: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_rsi_losses') + self.stoch_d: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_stoch_d') + self.stoch_k: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_stoch_k') + self.stoch_rsi: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_stoch_rsi') + self.stoch_rsi_d: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_stoch_rsi_d') + self.stoch_rsi_k: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_stoch_rsi_k') class CatalogTree_Market_Lookback: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.price_ago: PriceAgoPattern[Dollars] = PriceAgoPattern(client, 'price') class CatalogTree_Market_MovingAverage: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.price_111d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_111d_sma') self.price_12d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_12d_ema') @@ -3499,7 +3366,7 @@ class CatalogTree_Market_MovingAverage: class CatalogTree_Market_Range: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.price_1m_max: MetricPattern4[Dollars] = MetricPattern4(client, f'{base_path}_price_1m_max') self.price_1m_min: MetricPattern4[Dollars] = MetricPattern4(client, f'{base_path}_price_1m_min') @@ -3510,12 +3377,12 @@ class CatalogTree_Market_Range: self.price_2w_choppiness_index: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_price_2w_choppiness_index') self.price_2w_max: MetricPattern4[Dollars] = MetricPattern4(client, f'{base_path}_price_2w_max') self.price_2w_min: MetricPattern4[Dollars] = MetricPattern4(client, f'{base_path}_price_2w_min') - self.price_true_range: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_price_true_range') - self.price_true_range_2w_sum: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_price_true_range_2w_sum') + self.price_true_range: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_price_true_range') + self.price_true_range_2w_sum: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_price_true_range_2w_sum') class CatalogTree_Market_Returns: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self._1d_returns_1m_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, '1d_returns_1m_sd') self._1d_returns_1w_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, '1d_returns_1w_sd') @@ -3524,58 +3391,58 @@ class CatalogTree_Market_Returns: self.downside_1m_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, 'downside_1m_sd') self.downside_1w_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, 'downside_1w_sd') self.downside_1y_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, 'downside_1y_sd') - self.downside_returns: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_downside_returns') + self.downside_returns: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_downside_returns') self.price_returns: PriceAgoPattern[StoredF32] = PriceAgoPattern(client, 'price_returns') class CatalogTree_Market_Volatility: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.price_1m_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_price_1m_volatility') self.price_1w_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_price_1w_volatility') self.price_1y_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_price_1y_volatility') - self.sharpe_1m: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_sharpe_1m') - self.sharpe_1w: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_sharpe_1w') - self.sharpe_1y: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_sharpe_1y') - self.sortino_1m: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_sortino_1m') - self.sortino_1w: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_sortino_1w') - self.sortino_1y: MetricPattern19[StoredF32] = MetricPattern19(client, f'{base_path}_sortino_1y') + self.sharpe_1m: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_sharpe_1m') + self.sharpe_1w: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_sharpe_1w') + self.sharpe_1y: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_sharpe_1y') + self.sortino_1m: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_sortino_1m') + self.sortino_1w: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_sortino_1w') + self.sortino_1y: MetricPattern7[StoredF32] = MetricPattern7(client, f'{base_path}_sortino_1y') class CatalogTree_Outputs: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.count: CatalogTree_Outputs_Count = CatalogTree_Outputs_Count(client, f'{base_path}_count') - self.first_txoutindex: MetricPattern23[TxOutIndex] = MetricPattern23(client, f'{base_path}_first_txoutindex') - self.outputtype: MetricPattern26[OutputType] = MetricPattern26(client, f'{base_path}_outputtype') + self.first_txoutindex: MetricPattern12[TxOutIndex] = MetricPattern12(client, f'{base_path}_first_txoutindex') + self.outputtype: MetricPattern16[OutputType] = MetricPattern16(client, f'{base_path}_outputtype') self.spent: CatalogTree_Outputs_Spent = CatalogTree_Outputs_Spent(client, f'{base_path}_spent') - self.txindex: MetricPattern26[TxIndex] = MetricPattern26(client, f'{base_path}_txindex') - self.typeindex: MetricPattern26[TypeIndex] = MetricPattern26(client, f'{base_path}_typeindex') - self.value: MetricPattern26[Sats] = MetricPattern26(client, f'{base_path}_value') + self.txindex: MetricPattern16[TxIndex] = MetricPattern16(client, f'{base_path}_txindex') + self.typeindex: MetricPattern16[TypeIndex] = MetricPattern16(client, f'{base_path}_typeindex') + self.value: MetricPattern16[Sats] = MetricPattern16(client, f'{base_path}_value') class CatalogTree_Outputs_Count: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.count: BlockSizePattern[StoredU64] = BlockSizePattern(client, 'output_count') + self.total_count: SizePattern[StoredU64] = SizePattern(client, 'output_count') self.utxo_count: BitcoinPattern[StoredU64] = BitcoinPattern(client, 'exact_utxo_count') class CatalogTree_Outputs_Spent: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.txinindex: MetricPattern26[TxInIndex] = MetricPattern26(client, f'{base_path}_txinindex') + self.txinindex: MetricPattern16[TxInIndex] = MetricPattern16(client, f'{base_path}_txinindex') class CatalogTree_Pools: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.pool: MetricPattern23[PoolSlug] = MetricPattern23(client, f'{base_path}_pool') + self.pool: MetricPattern12[PoolSlug] = MetricPattern12(client, f'{base_path}_pool') self.vecs: CatalogTree_Pools_Vecs = CatalogTree_Pools_Vecs(client, f'{base_path}_vecs') class CatalogTree_Pools_Vecs: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.aaopool: AaopoolPattern = AaopoolPattern(client, 'aaopool') self.antpool: AaopoolPattern = AaopoolPattern(client, 'antpool') @@ -3738,66 +3605,51 @@ class CatalogTree_Pools_Vecs: class CatalogTree_Positions: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.position: MetricPattern14[BlkPosition] = MetricPattern14(client, f'{base_path}_position') + self.block_position: MetricPattern12[BlkPosition] = MetricPattern12(client, f'{base_path}_block_position') + self.tx_position: MetricPattern28[BlkPosition] = MetricPattern28(client, f'{base_path}_tx_position') class CatalogTree_Price: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.cents: CatalogTree_Price_Cents = CatalogTree_Price_Cents(client, f'{base_path}_cents') - self.sats: CatalogTree_Price_Sats = CatalogTree_Price_Sats(client, f'{base_path}_sats') - self.usd: CatalogTree_Price_Usd = CatalogTree_Price_Usd(client, f'{base_path}_usd') + self.sats: SatsPattern = SatsPattern(client, 'price') + self.usd: SatsPattern = SatsPattern(client, 'price') class CatalogTree_Price_Cents: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ohlc: MetricPattern7[OHLCCents] = MetricPattern7(client, f'{base_path}_ohlc') + self.ohlc: MetricPattern6[OHLCCents] = MetricPattern6(client, f'{base_path}_ohlc') + self.split: CatalogTree_Price_Cents_Split = CatalogTree_Price_Cents_Split(client, f'{base_path}_split') -class CatalogTree_Price_Sats: +class CatalogTree_Price_Cents_Split: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.price_close_sats: MetricPattern1[Sats] = MetricPattern1(client, f'{base_path}_price_close_sats') - self.price_high_sats: PriceHighSatsPattern[Sats] = PriceHighSatsPattern(client, 'price_high_sats') - self.price_low_sats: PriceHighSatsPattern[Sats] = PriceHighSatsPattern(client, 'price_low_sats') - self.price_ohlc_sats: MetricPattern1[OHLCSats] = MetricPattern1(client, f'{base_path}_price_ohlc_sats') - self.price_open_sats: MetricPattern1[Sats] = MetricPattern1(client, f'{base_path}_price_open_sats') - -class CatalogTree_Price_Usd: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.price_close: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_price_close') - self.price_close_cents: MetricPattern7[Cents] = MetricPattern7(client, f'{base_path}_price_close_cents') - self.price_high: PriceHighSatsPattern[Dollars] = PriceHighSatsPattern(client, 'price_high') - self.price_high_cents: MetricPattern7[Cents] = MetricPattern7(client, f'{base_path}_price_high_cents') - self.price_low: PriceHighSatsPattern[Dollars] = PriceHighSatsPattern(client, 'price_low') - self.price_low_cents: MetricPattern7[Cents] = MetricPattern7(client, f'{base_path}_price_low_cents') - self.price_ohlc: MetricPattern1[OHLCDollars] = MetricPattern1(client, f'{base_path}_price_ohlc') - self.price_open: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_price_open') - self.price_open_cents: MetricPattern7[Cents] = MetricPattern7(client, f'{base_path}_price_open_cents') + self.dateindex: DateindexPattern2 = DateindexPattern2(client, 'price') + self.height: DateindexPattern2 = DateindexPattern2(client, 'price') class CatalogTree_Scripts: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.count: CatalogTree_Scripts_Count = CatalogTree_Scripts_Count(client, f'{base_path}_count') - self.empty_to_txindex: MetricPattern22[TxIndex] = MetricPattern22(client, f'{base_path}_empty_to_txindex') - self.first_emptyoutputindex: MetricPattern23[EmptyOutputIndex] = MetricPattern23(client, f'{base_path}_first_emptyoutputindex') - self.first_opreturnindex: MetricPattern23[OpReturnIndex] = MetricPattern23(client, f'{base_path}_first_opreturnindex') - self.first_p2msoutputindex: MetricPattern23[P2MSOutputIndex] = MetricPattern23(client, f'{base_path}_first_p2msoutputindex') - self.first_unknownoutputindex: MetricPattern23[UnknownOutputIndex] = MetricPattern23(client, f'{base_path}_first_unknownoutputindex') - self.opreturn_to_txindex: MetricPattern25[TxIndex] = MetricPattern25(client, f'{base_path}_opreturn_to_txindex') - self.p2ms_to_txindex: MetricPattern28[TxIndex] = MetricPattern28(client, f'{base_path}_p2ms_to_txindex') - self.unknown_to_txindex: MetricPattern37[TxIndex] = MetricPattern37(client, f'{base_path}_unknown_to_txindex') + self.empty_to_txindex: MetricPattern10[TxIndex] = MetricPattern10(client, f'{base_path}_empty_to_txindex') + self.first_emptyoutputindex: MetricPattern12[EmptyOutputIndex] = MetricPattern12(client, f'{base_path}_first_emptyoutputindex') + self.first_opreturnindex: MetricPattern12[OpReturnIndex] = MetricPattern12(client, f'{base_path}_first_opreturnindex') + self.first_p2msoutputindex: MetricPattern12[P2MSOutputIndex] = MetricPattern12(client, f'{base_path}_first_p2msoutputindex') + self.first_unknownoutputindex: MetricPattern12[UnknownOutputIndex] = MetricPattern12(client, f'{base_path}_first_unknownoutputindex') + self.opreturn_to_txindex: MetricPattern15[TxIndex] = MetricPattern15(client, f'{base_path}_opreturn_to_txindex') + self.p2ms_to_txindex: MetricPattern18[TxIndex] = MetricPattern18(client, f'{base_path}_p2ms_to_txindex') + self.unknown_to_txindex: MetricPattern29[TxIndex] = MetricPattern29(client, f'{base_path}_unknown_to_txindex') self.value: CatalogTree_Scripts_Value = CatalogTree_Scripts_Value(client, f'{base_path}_value') class CatalogTree_Scripts_Count: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.emptyoutput: BitcoinPattern[StoredU64] = BitcoinPattern(client, 'emptyoutput_count') self.opreturn: BitcoinPattern[StoredU64] = BitcoinPattern(client, 'opreturn_count') @@ -3811,111 +3663,108 @@ class CatalogTree_Scripts_Count: self.p2wpkh: BitcoinPattern[StoredU64] = BitcoinPattern(client, 'p2wpkh_count') self.p2wsh: BitcoinPattern[StoredU64] = BitcoinPattern(client, 'p2wsh_count') self.segwit: BitcoinPattern[StoredU64] = BitcoinPattern(client, 'segwit_count') - self.segwit_adoption: SatsPattern[StoredF32] = SatsPattern(client, 'segwit_adoption') - self.taproot_adoption: SatsPattern[StoredF32] = SatsPattern(client, 'taproot_adoption') + self.segwit_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern(client, 'segwit_adoption') + self.taproot_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern(client, 'taproot_adoption') self.unknownoutput: BitcoinPattern[StoredU64] = BitcoinPattern(client, 'unknownoutput_count') class CatalogTree_Scripts_Value: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.opreturn: CoinbasePattern = CoinbasePattern(client, 'opreturn_value') class CatalogTree_Supply: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.burned: CatalogTree_Supply_Burned = CatalogTree_Supply_Burned(client, f'{base_path}_burned') - self.circulating: ActiveSupplyPattern = ActiveSupplyPattern(client, 'circulating') + self.circulating: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'circulating_supply') self.inflation: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_inflation') - self.market_cap: MetricPattern3[Dollars] = MetricPattern3(client, f'{base_path}_market_cap') + self.market_cap: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_market_cap') self.velocity: CatalogTree_Supply_Velocity = CatalogTree_Supply_Velocity(client, f'{base_path}_velocity') class CatalogTree_Supply_Burned: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.opreturn: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'opreturn_supply') self.unspendable: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'unspendable_supply') class CatalogTree_Supply_Velocity: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.btc: MetricPattern4[StoredF64] = MetricPattern4(client, f'{base_path}_btc') self.usd: MetricPattern4[StoredF64] = MetricPattern4(client, f'{base_path}_usd') class CatalogTree_Transactions: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.base_size: MetricPattern36[StoredU32] = MetricPattern36(client, f'{base_path}_base_size') + self.base_size: MetricPattern28[StoredU32] = MetricPattern28(client, f'{base_path}_base_size') self.count: CatalogTree_Transactions_Count = CatalogTree_Transactions_Count(client, f'{base_path}_count') self.fees: CatalogTree_Transactions_Fees = CatalogTree_Transactions_Fees(client, f'{base_path}_fees') - self.first_txindex: MetricPattern23[TxIndex] = MetricPattern23(client, f'{base_path}_first_txindex') - self.first_txinindex: MetricPattern36[TxInIndex] = MetricPattern36(client, f'{base_path}_first_txinindex') - self.first_txoutindex: MetricPattern36[TxOutIndex] = MetricPattern36(client, f'{base_path}_first_txoutindex') - self.height: MetricPattern36[Height] = MetricPattern36(client, f'{base_path}_height') - self.is_explicitly_rbf: MetricPattern36[StoredBool] = MetricPattern36(client, f'{base_path}_is_explicitly_rbf') - self.rawlocktime: MetricPattern36[RawLockTime] = MetricPattern36(client, f'{base_path}_rawlocktime') + self.first_txindex: MetricPattern12[TxIndex] = MetricPattern12(client, f'{base_path}_first_txindex') + self.first_txinindex: MetricPattern28[TxInIndex] = MetricPattern28(client, f'{base_path}_first_txinindex') + self.first_txoutindex: MetricPattern28[TxOutIndex] = MetricPattern28(client, f'{base_path}_first_txoutindex') + self.height: MetricPattern28[Height] = MetricPattern28(client, f'{base_path}_height') + self.is_explicitly_rbf: MetricPattern28[StoredBool] = MetricPattern28(client, f'{base_path}_is_explicitly_rbf') + self.rawlocktime: MetricPattern28[RawLockTime] = MetricPattern28(client, f'{base_path}_rawlocktime') self.size: CatalogTree_Transactions_Size = CatalogTree_Transactions_Size(client, f'{base_path}_size') - self.total_size: MetricPattern36[StoredU32] = MetricPattern36(client, f'{base_path}_total_size') - self.txid: MetricPattern36[Txid] = MetricPattern36(client, f'{base_path}_txid') - self.txversion: MetricPattern36[TxVersion] = MetricPattern36(client, f'{base_path}_txversion') + self.total_size: MetricPattern28[StoredU32] = MetricPattern28(client, f'{base_path}_total_size') + self.txid: MetricPattern28[Txid] = MetricPattern28(client, f'{base_path}_txid') + self.txversion: MetricPattern28[TxVersion] = MetricPattern28(client, f'{base_path}_txversion') self.versions: CatalogTree_Transactions_Versions = CatalogTree_Transactions_Versions(client, f'{base_path}_versions') self.volume: CatalogTree_Transactions_Volume = CatalogTree_Transactions_Volume(client, f'{base_path}_volume') class CatalogTree_Transactions_Count: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.is_coinbase: MetricPattern36[StoredBool] = MetricPattern36(client, f'{base_path}_is_coinbase') + self.is_coinbase: MetricPattern28[StoredBool] = MetricPattern28(client, f'{base_path}_is_coinbase') self.tx_count: BitcoinPattern[StoredU64] = BitcoinPattern(client, 'tx_count') class CatalogTree_Transactions_Fees: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): self.fee: CatalogTree_Transactions_Fees_Fee = CatalogTree_Transactions_Fees_Fee(client, f'{base_path}_fee') - self.fee_rate: IntervalPattern[FeeRate] = IntervalPattern(client, 'fee_rate') - self.input_value: MetricPattern36[Sats] = MetricPattern36(client, f'{base_path}_input_value') - self.output_value: MetricPattern36[Sats] = MetricPattern36(client, f'{base_path}_output_value') + self.fee_rate: FeeRatePattern[FeeRate] = FeeRatePattern(client, 'fee_rate') + self.input_value: MetricPattern28[Sats] = MetricPattern28(client, f'{base_path}_input_value') + self.output_value: MetricPattern28[Sats] = MetricPattern28(client, f'{base_path}_output_value') class CatalogTree_Transactions_Fees_Fee: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.bitcoin: BlockSizePattern[Bitcoin] = BlockSizePattern(client, 'fee_btc') - self.dollars: BlockSizePattern[Dollars] = BlockSizePattern(client, 'fee_usd') - self.sats: BitcoinPattern[Sats] = BitcoinPattern(client, 'fee') + self.bitcoin: SizePattern[Bitcoin] = SizePattern(client, 'fee_btc') + self.dollars: SizePattern[Dollars] = SizePattern(client, 'fee_usd') + self.sats: SizePattern[Sats] = SizePattern(client, 'fee') + self.txindex: MetricPattern28[Sats] = MetricPattern28(client, f'{base_path}_txindex') class CatalogTree_Transactions_Size: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.tx_vsize: TxVsizePattern[VSize] = TxVsizePattern(client, 'tx_vsize') - self.tx_weight: TxVsizePattern[Weight] = TxVsizePattern(client, 'tx_weight') - self.vsize: MetricPattern36[VSize] = MetricPattern36(client, f'{base_path}_vsize') - self.weight: MetricPattern36[Weight] = MetricPattern36(client, f'{base_path}_weight') + self.vsize: FeeRatePattern[VSize] = FeeRatePattern(client, '') + self.weight: FeeRatePattern[Weight] = FeeRatePattern(client, '') class CatalogTree_Transactions_Versions: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.tx_v1: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v1') - self.tx_v2: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v2') - self.tx_v3: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v3') + self.v1: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v1') + self.v2: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v2') + self.v3: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v3') class CatalogTree_Transactions_Volume: """Catalog tree node.""" - + def __init__(self, client: BrkClientBase, base_path: str = ''): - self.annualized_volume: MetricPattern4[Sats] = MetricPattern4(client, f'{base_path}_annualized_volume') - self.annualized_volume_btc: MetricPattern4[Bitcoin] = MetricPattern4(client, f'{base_path}_annualized_volume_btc') - self.annualized_volume_usd: MetricPattern4[Dollars] = MetricPattern4(client, f'{base_path}_annualized_volume_usd') + self.annualized_volume: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'annualized_volume') self.inputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_inputs_per_sec') self.outputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_outputs_per_sec') - self.sent_sum: ActiveSupplyPattern = ActiveSupplyPattern(client, 'sent_sum') + self.sent_sum: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, 'sent_sum') self.tx_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, f'{base_path}_tx_per_sec') class BrkClient(BrkClientBase): @@ -4940,7 +4789,7 @@ class BrkClient(BrkClientBase): query = '&'.join(params) return self.get(f'/api/metric/{metric}/{index}{"?" + query if query else ""}') - def get_metrics_bulk(self, count: Optional[Any] = None, format: Optional[Format] = None, from_: Optional[Any] = None, index: Index, metrics: Metrics, to: Optional[Any] = None) -> List[AnyMetricData]: + def get_metrics_bulk(self, index: Index, metrics: Metrics, count: Optional[Any] = None, format: Optional[Format] = None, from_: Optional[Any] = None, to: Optional[Any] = None) -> List[AnyMetricData]: """Bulk metric data. Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects.""" @@ -5127,3 +4976,4 @@ class BrkClient(BrkClientBase): Returns the current version of the API server""" return self.get('/version') + diff --git a/websites/bitview/index.html b/websites/bitview/index.html index 0ca5651ec..c6dfa2f7b 100644 --- a/websites/bitview/index.html +++ b/websites/bitview/index.html @@ -1563,7 +1563,7 @@ - + @@ -1633,7 +1633,7 @@ "/scripts/entry.js": "/scripts/entry.15f91516.js", "/scripts/lazy.js": "/scripts/lazy.cdb73318.js", "/scripts/main.js": "/scripts/main.60f735cb.js", - "/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.0b8c7f06.js", + "/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.df202eed.js", "/scripts/modules/lean-qr/2.6.1/index.mjs": "/scripts/modules/lean-qr/2.6.1/index.09195c13.mjs", "/scripts/modules/leeoniya-ufuzzy/1.0.19/dist/uFuzzy.mjs": "/scripts/modules/leeoniya-ufuzzy/1.0.19/dist/uFuzzy.803b7fb0.mjs", "/scripts/modules/lightweight-charts/5.0.9/dist/lightweight-charts.standalone.production.mjs": "/scripts/modules/lightweight-charts/5.0.9/dist/lightweight-charts.standalone.production.1e264451.mjs",