diff --git a/Cargo.lock b/Cargo.lock index a79ec447b..dcc738ae3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2761,7 +2761,7 @@ dependencies = [ [[package]] name = "rawdb" -version = "0.5.6" +version = "0.5.7" dependencies = [ "libc", "log", @@ -3702,7 +3702,7 @@ checksum = "8f54a172d0620933a27a4360d3db3e2ae0dd6cceae9730751a036bbf182c4b23" [[package]] name = "vecdb" -version = "0.5.6" +version = "0.5.7" dependencies = [ "ctrlc", "log", @@ -3721,7 +3721,7 @@ dependencies = [ [[package]] name = "vecdb_derive" -version = "0.5.6" +version = "0.5.7" dependencies = [ "quote", "syn", diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index cf1b6d1e9..a7646f203 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -3073,38 +3073,6 @@ impl ClassAveragePricePattern { } } -/// Pattern struct for repeated tree structure. -pub struct RelativePattern { - 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: 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: 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: 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, @@ -3137,6 +3105,38 @@ impl RelativePattern2 { } } +/// Pattern struct for repeated tree structure. +pub struct RelativePattern { + 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: 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: 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: 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 AddrCountPattern { pub all: MetricPattern1, @@ -3167,36 +3167,6 @@ impl AddrCountPattern { } } -/// Pattern struct for repeated tree structure. -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 OhlcPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - 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, @@ -3227,6 +3197,36 @@ impl FeeRatePattern { } } +/// Pattern struct for repeated tree structure. +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 OhlcPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + 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 _0satsPattern { pub activity: ActivityPattern2, @@ -3255,6 +3255,32 @@ impl _0satsPattern { } } +/// 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, + pub unrealized: UnrealizedPattern, +} + +impl _0satsPattern2 { + /// 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: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")), + 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, @@ -3307,6 +3333,32 @@ impl _100btcPattern { } } +/// Pattern struct for repeated tree structure. +pub struct _10yTo12yPattern { + pub activity: ActivityPattern2, + pub cost_basis: CostBasisPattern2, + pub outputs: OutputsPattern, + pub realized: RealizedPattern2, + pub relative: RelativePattern2, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, +} + +impl _10yTo12yPattern { + /// 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: 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(), _m(&acc, "supply")), + unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _10yPattern { pub activity: ActivityPattern2, @@ -3359,62 +3411,10 @@ impl PeriodCagrPattern { } } -/// 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, - pub unrealized: UnrealizedPattern, -} - -impl _0satsPattern2 { - /// 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: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")), - supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct _10yTo12yPattern { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern2, - pub outputs: OutputsPattern, - pub realized: RealizedPattern2, - pub relative: RelativePattern2, - pub supply: SupplyPattern2, - pub unrealized: UnrealizedPattern, -} - -impl _10yTo12yPattern { - /// 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: 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(), _m(&acc, "supply")), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct BitcoinPattern { pub average: MetricPattern2, - pub cumulative: MetricPattern1, + pub cumulative: MetricPattern2, pub height: MetricPattern12, pub max: MetricPattern2, pub min: MetricPattern2, @@ -3427,7 +3427,7 @@ impl BitcoinPattern { pub fn new(client: Arc, acc: String) -> Self { Self { average: MetricPattern2::new(client.clone(), _m(&acc, "average")), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + cumulative: MetricPattern2::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")), @@ -3439,24 +3439,24 @@ impl BitcoinPattern { /// Pattern struct for repeated tree structure. pub struct SizePattern { - pub average: MetricPattern2, + pub average: MetricPattern1, pub cumulative: MetricPattern1, - pub max: MetricPattern2, - pub min: MetricPattern2, + pub max: MetricPattern1, + pub min: MetricPattern1, pub percentiles: PercentilesPattern, - pub sum: MetricPattern2, + pub sum: MetricPattern1, } impl SizePattern { /// 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")), + average: MetricPattern1::new(client.clone(), _m(&acc, "average")), cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), - max: MetricPattern2::new(client.clone(), _m(&acc, "max")), - min: MetricPattern2::new(client.clone(), _m(&acc, "min")), + max: MetricPattern1::new(client.clone(), _m(&acc, "max")), + min: MetricPattern1::new(client.clone(), _m(&acc, "min")), percentiles: PercentilesPattern::new(client.clone(), acc.clone()), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), + sum: MetricPattern1::new(client.clone(), _m(&acc, "sum")), } } } @@ -3525,26 +3525,6 @@ impl DateindexPattern2 { } } -/// Pattern struct for repeated tree structure. -pub struct SplitPattern2 { - pub close: MetricPattern1, - pub high: HighPattern, - pub low: HighPattern, - pub open: MetricPattern1, -} - -impl SplitPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - 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 HighPattern { pub dateindex: MetricPattern7, @@ -3565,6 +3545,26 @@ impl HighPattern { } } +/// Pattern struct for repeated tree structure. +pub struct SplitPattern2 { + pub close: MetricPattern1, + pub high: HighPattern, + pub low: HighPattern, + pub open: MetricPattern1, +} + +impl SplitPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + 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 _24hCoinbaseSumPattern { pub bitcoin: MetricPattern12, @@ -3584,37 +3584,19 @@ impl _24hCoinbaseSumPattern { } /// Pattern struct for repeated tree structure. -pub struct SegwitAdoptionPattern { - pub cumulative: MetricPattern2, - pub height: MetricPattern12, - pub sum: MetricPattern2, +pub struct CoinbasePattern { + pub bitcoin: BitcoinPattern, + pub dollars: BitcoinPattern, + pub sats: BitcoinPattern, } -impl SegwitAdoptionPattern { +impl CoinbasePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - height: MetricPattern12::new(client.clone(), acc.clone()), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CostBasisPattern2 { - pub max: MetricPattern1, - pub min: MetricPattern1, - pub percentiles: PercentilesPattern2, -} - -impl CostBasisPattern2 { - /// 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")), - percentiles: PercentilesPattern2::new(client.clone(), _m(&acc, "cost_basis")), + bitcoin: BitcoinPattern::new(client.clone(), _m(&acc, "btc")), + dollars: BitcoinPattern::new(client.clone(), _m(&acc, "usd")), + sats: BitcoinPattern::new(client.clone(), acc.clone()), } } } @@ -3638,83 +3620,37 @@ impl UnclaimedRewardsPattern { } /// Pattern struct for repeated tree structure. -pub struct CoinbasePattern { - pub bitcoin: BitcoinPattern, - pub dollars: BitcoinPattern, - pub sats: BitcoinPattern, -} - -impl CoinbasePattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - bitcoin: BitcoinPattern::new(client.clone(), _m(&acc, "btc")), - dollars: BitcoinPattern::new(client.clone(), _m(&acc, "usd")), - sats: BitcoinPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct RelativePattern4 { - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, -} - -impl RelativePattern4 { - /// 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: 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")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct _1dReturns1mSdPattern { - pub sd: MetricPattern4, - pub sma: MetricPattern4, -} - -impl _1dReturns1mSdPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - sd: MetricPattern4::new(client.clone(), _m(&acc, "sd")), - sma: MetricPattern4::new(client.clone(), _m(&acc, "sma")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CostBasisPattern { +pub struct CostBasisPattern2 { pub max: MetricPattern1, pub min: MetricPattern1, + pub percentiles: PercentilesPattern2, } -impl CostBasisPattern { +impl CostBasisPattern2 { /// 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")), + percentiles: PercentilesPattern2::new(client.clone(), _m(&acc, "cost_basis")), } } } /// Pattern struct for repeated tree structure. -pub struct SupplyPattern2 { - pub halved: _24hCoinbaseSumPattern, - pub total: _24hCoinbaseSumPattern, +pub struct SegwitAdoptionPattern { + pub cumulative: MetricPattern2, + pub height: MetricPattern12, + pub sum: MetricPattern2, } -impl SupplyPattern2 { +impl SegwitAdoptionPattern { /// 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()), + cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), + height: MetricPattern12::new(client.clone(), acc.clone()), + sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), } } } @@ -3735,6 +3671,70 @@ impl SatsPattern { } } +/// 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 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 _1dReturns1mSdPattern { + pub sd: MetricPattern4, + pub sma: MetricPattern4, +} + +impl _1dReturns1mSdPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + sd: MetricPattern4::new(client.clone(), _m(&acc, "sd")), + sma: MetricPattern4::new(client.clone(), _m(&acc, "sma")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct RelativePattern4 { + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, +} + +impl RelativePattern4 { + /// 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: 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")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct BlockCountPattern { pub cumulative: MetricPattern1, @@ -3751,20 +3751,6 @@ impl BlockCountPattern { } } -/// Pattern struct for repeated tree structure. -pub struct RealizedPriceExtraPattern { - pub ratio: MetricPattern4, -} - -impl RealizedPriceExtraPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - ratio: MetricPattern4::new(client.clone(), _m(&acc, "ratio")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct OutputsPattern { pub utxo_count: MetricPattern1, @@ -3779,16 +3765,30 @@ impl OutputsPattern { } } +/// Pattern struct for repeated tree structure. +pub struct RealizedPriceExtraPattern { + pub ratio: MetricPattern4, +} + +impl RealizedPriceExtraPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + ratio: MetricPattern4::new(client.clone(), _m(&acc, "ratio")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct EmptyPattern { - pub identity: MetricPattern18, + pub identity: MetricPattern25, } 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()), + identity: MetricPattern25::new(client.clone(), acc.clone()), } } } diff --git a/crates/brk_computer/src/blocks/mining/import.rs b/crates/brk_computer/src/blocks/mining/import.rs index 9cedd5c66..e58cacf9c 100644 --- a/crates/brk_computer/src/blocks/mining/import.rs +++ b/crates/brk_computer/src/blocks/mining/import.rs @@ -6,7 +6,7 @@ use vecdb::{Database, IterableCloneableVec}; use super::Vecs; use crate::{ indexes, - internal::{ComputedBlockLast, ComputedBlockSum, ComputedDateLast, DerivedComputedBlockLast}, + internal::{ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedDerivedBlockLast}, }; impl Vecs { @@ -106,7 +106,7 @@ impl Vecs { indexes, )?, // Derived from external indexer data - no height storage needed - difficulty: DerivedComputedBlockLast::forced_import( + difficulty: ComputedDerivedBlockLast::forced_import( db, "difficulty", indexer.vecs.blocks.difficulty.boxed_clone(), diff --git a/crates/brk_computer/src/blocks/mining/vecs.rs b/crates/brk_computer/src/blocks/mining/vecs.rs index b2caa2289..6b45470db 100644 --- a/crates/brk_computer/src/blocks/mining/vecs.rs +++ b/crates/brk_computer/src/blocks/mining/vecs.rs @@ -2,7 +2,7 @@ use brk_traversable::Traversable; use brk_types::{StoredF32, StoredF64}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSum, ComputedDateLast, DerivedComputedBlockLast, + ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedDerivedBlockLast, }; /// Mining-related metrics: hash rate, hash price, hash value, difficulty @@ -24,7 +24,7 @@ pub struct Vecs { pub hash_value_phs_min: ComputedBlockLast, pub hash_value_rebound: ComputedBlockLast, /// Derived from indexer - no height storage needed - pub difficulty: DerivedComputedBlockLast, + pub difficulty: ComputedDerivedBlockLast, pub difficulty_as_hash: ComputedBlockLast, pub difficulty_adjustment: ComputedBlockSum, } diff --git a/crates/brk_computer/src/blocks/size/import.rs b/crates/brk_computer/src/blocks/size/import.rs index c3c6a5e1d..6b6d53e7f 100644 --- a/crates/brk_computer/src/blocks/size/import.rs +++ b/crates/brk_computer/src/blocks/size/import.rs @@ -4,7 +4,7 @@ use brk_types::{Height, StoredU64, Version}; use vecdb::{Database, IterableCloneableVec, VecIndex}; use super::Vecs; -use crate::{indexes, internal::{DerivedComputedBlockFull, LazyComputedBlockFull}}; +use crate::{indexes, internal::{ComputedDerivedBlockFull, LazyComputedBlockFull}}; impl Vecs { pub fn forced_import( @@ -26,7 +26,7 @@ impl Vecs { .map(|w| StoredU64::from(w.to_vbytes_floor())) }, )?, - size: DerivedComputedBlockFull::forced_import( + size: ComputedDerivedBlockFull::forced_import( db, "block_size", indexer.vecs.blocks.total_size.boxed_clone(), diff --git a/crates/brk_computer/src/blocks/size/vecs.rs b/crates/brk_computer/src/blocks/size/vecs.rs index 3a33453af..c4fe97256 100644 --- a/crates/brk_computer/src/blocks/size/vecs.rs +++ b/crates/brk_computer/src/blocks/size/vecs.rs @@ -1,10 +1,10 @@ use brk_traversable::Traversable; use brk_types::{StoredU64, Weight}; -use crate::internal::{DerivedComputedBlockFull, LazyComputedBlockFull}; +use crate::internal::{ComputedDerivedBlockFull, LazyComputedBlockFull}; #[derive(Clone, Traversable)] pub struct Vecs { pub vbytes: LazyComputedBlockFull, - pub size: DerivedComputedBlockFull, + pub size: ComputedDerivedBlockFull, } diff --git a/crates/brk_computer/src/blocks/time/import.rs b/crates/brk_computer/src/blocks/time/import.rs index 16274f727..3481e2d85 100644 --- a/crates/brk_computer/src/blocks/time/import.rs +++ b/crates/brk_computer/src/blocks/time/import.rs @@ -4,7 +4,7 @@ use brk_types::{Date, Height, Version}; use vecdb::{Database, EagerVec, ImportableVec, IterableCloneableVec, LazyVecFrom1, VecIndex}; use super::Vecs; -use crate::{indexes, internal::DerivedComputedBlockFirst}; +use crate::{indexes, internal::ComputedDerivedBlockFirst}; impl Vecs { pub fn forced_import( @@ -31,7 +31,7 @@ impl Vecs { |height: Height, timestamp_iter| timestamp_iter.get(height).map(Date::from), ), timestamp_fixed: height_to_timestamp_fixed, - timestamp: DerivedComputedBlockFirst::forced_import( + timestamp: ComputedDerivedBlockFirst::forced_import( db, "timestamp", indexer.vecs.blocks.timestamp.boxed_clone(), diff --git a/crates/brk_computer/src/blocks/time/vecs.rs b/crates/brk_computer/src/blocks/time/vecs.rs index 227f194e8..7516cdf8c 100644 --- a/crates/brk_computer/src/blocks/time/vecs.rs +++ b/crates/brk_computer/src/blocks/time/vecs.rs @@ -2,7 +2,7 @@ use brk_traversable::Traversable; use brk_types::{Date, Height, Timestamp}; use vecdb::{EagerVec, LazyVecFrom1, PcoVec}; -use crate::internal::DerivedComputedBlockFirst; +use crate::internal::ComputedDerivedBlockFirst; /// Timestamp and date metrics for blocks #[derive(Clone, Traversable)] @@ -10,5 +10,5 @@ pub struct Vecs { pub date: LazyVecFrom1, pub date_fixed: LazyVecFrom1, pub timestamp_fixed: EagerVec>, - pub timestamp: DerivedComputedBlockFirst, + pub timestamp: ComputedDerivedBlockFirst, } diff --git a/crates/brk_computer/src/blocks/weight/import.rs b/crates/brk_computer/src/blocks/weight/import.rs index fe4f39a38..c03ac577e 100644 --- a/crates/brk_computer/src/blocks/weight/import.rs +++ b/crates/brk_computer/src/blocks/weight/import.rs @@ -6,7 +6,7 @@ use vecdb::{Database, IterableCloneableVec}; use super::Vecs; use crate::{ indexes, - internal::{DerivedComputedBlockFull, LazyBlockFull, WeightToFullness}, + internal::{ComputedDerivedBlockFull, LazyBlockFull, WeightToFullness}, }; impl Vecs { @@ -16,7 +16,7 @@ impl Vecs { indexer: &Indexer, indexes: &indexes::Vecs, ) -> Result { - let weight = DerivedComputedBlockFull::forced_import( + let weight = ComputedDerivedBlockFull::forced_import( db, "block_weight", indexer.vecs.blocks.weight.boxed_clone(), diff --git a/crates/brk_computer/src/blocks/weight/vecs.rs b/crates/brk_computer/src/blocks/weight/vecs.rs index 65af41210..7277675d2 100644 --- a/crates/brk_computer/src/blocks/weight/vecs.rs +++ b/crates/brk_computer/src/blocks/weight/vecs.rs @@ -1,10 +1,10 @@ use brk_traversable::Traversable; use brk_types::{StoredF32, Weight}; -use crate::internal::{DerivedComputedBlockFull, LazyBlockFull}; +use crate::internal::{ComputedDerivedBlockFull, LazyBlockFull}; #[derive(Clone, Traversable)] pub struct Vecs { - pub weight: DerivedComputedBlockFull, + pub weight: ComputedDerivedBlockFull, pub fullness: LazyBlockFull, } diff --git a/crates/brk_computer/src/internal/computed/block/full.rs b/crates/brk_computer/src/internal/computed/block/full.rs index c281d7f62..daaf133f2 100644 --- a/crates/brk_computer/src/internal/computed/block/full.rs +++ b/crates/brk_computer/src/internal/computed/block/full.rs @@ -10,7 +10,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes}; -use crate::internal::{ComputedVecValue, DerivedComputedBlockFull, NumericValue}; +use crate::internal::{ComputedVecValue, ComputedDerivedBlockFull, NumericValue}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -22,7 +22,7 @@ where pub height: EagerVec>, #[deref] #[deref_mut] - pub rest: DerivedComputedBlockFull, + pub rest: ComputedDerivedBlockFull, } const VERSION: Version = Version::ZERO; @@ -41,7 +41,7 @@ where let height: EagerVec> = EagerVec::forced_import(db, name, v)?; - let rest = DerivedComputedBlockFull::forced_import( + let rest = ComputedDerivedBlockFull::forced_import( db, name, height.boxed_clone(), diff --git a/crates/brk_computer/src/internal/computed/block/last.rs b/crates/brk_computer/src/internal/computed/block/last.rs index cc15c9cbd..685c48199 100644 --- a/crates/brk_computer/src/internal/computed/block/last.rs +++ b/crates/brk_computer/src/internal/computed/block/last.rs @@ -10,7 +10,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes}; -use crate::internal::{ComputedVecValue, DerivedComputedBlockLast, NumericValue}; +use crate::internal::{ComputedVecValue, ComputedDerivedBlockLast, NumericValue}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -22,7 +22,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub rest: DerivedComputedBlockLast, + pub rest: ComputedDerivedBlockLast, } const VERSION: Version = Version::ZERO; @@ -42,7 +42,7 @@ where let height: EagerVec> = EagerVec::forced_import(db, name, v)?; let rest = - DerivedComputedBlockLast::forced_import(db, name, height.boxed_clone(), v, indexes)?; + ComputedDerivedBlockLast::forced_import(db, name, height.boxed_clone(), v, indexes)?; Ok(Self { height, rest }) } 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 912393098..b77c01e84 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 @@ -14,7 +14,7 @@ use vecdb::{Database, Exit, IterableCloneableVec, LazyVecFrom2}; use crate::{indexes, ComputeIndexes}; -use crate::internal::{ComputedVecValue, DerivedComputedBlockSumCum, NumericValue}; +use crate::internal::{ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue}; /// Lazy binary height + stored derived block SumCum. /// @@ -33,7 +33,7 @@ where pub height: LazyVecFrom2, #[deref] #[deref_mut] - pub rest: DerivedComputedBlockSumCum, + pub rest: ComputedDerivedBlockSumCum, } const VERSION: Version = Version::ZERO; @@ -53,7 +53,7 @@ where ) -> Result { let v = version + VERSION; - let rest = DerivedComputedBlockSumCum::forced_import( + let rest = ComputedDerivedBlockSumCum::forced_import( db, name, height.boxed_clone(), diff --git a/crates/brk_computer/src/internal/computed/block/sum.rs b/crates/brk_computer/src/internal/computed/block/sum.rs index 925eaa02a..ba2dbdd2d 100644 --- a/crates/brk_computer/src/internal/computed/block/sum.rs +++ b/crates/brk_computer/src/internal/computed/block/sum.rs @@ -10,7 +10,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes}; -use crate::internal::{ComputedVecValue, DerivedComputedBlockSum, NumericValue}; +use crate::internal::{ComputedVecValue, ComputedDerivedBlockSum, NumericValue}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -22,7 +22,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub rest: DerivedComputedBlockSum, + pub rest: ComputedDerivedBlockSum, } const VERSION: Version = Version::ZERO; @@ -42,7 +42,7 @@ where let height: EagerVec> = EagerVec::forced_import(db, name, v)?; let rest = - DerivedComputedBlockSum::forced_import(db, name, height.boxed_clone(), v, indexes)?; + ComputedDerivedBlockSum::forced_import(db, name, height.boxed_clone(), v, indexes)?; Ok(Self { height, rest }) } 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 fe648d754..3739d4223 100644 --- a/crates/brk_computer/src/internal/computed/block/sum_cum.rs +++ b/crates/brk_computer/src/internal/computed/block/sum_cum.rs @@ -13,7 +13,7 @@ use vecdb::{ use crate::{indexes, ComputeIndexes}; -use crate::internal::{ComputedVecValue, DerivedComputedBlockSumCum, NumericValue}; +use crate::internal::{ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -25,7 +25,7 @@ where pub height: EagerVec>, #[deref] #[deref_mut] - pub rest: DerivedComputedBlockSumCum, + pub rest: ComputedDerivedBlockSumCum, } const VERSION: Version = Version::ZERO; @@ -44,7 +44,7 @@ where let height: EagerVec> = EagerVec::forced_import(db, name, v)?; - let rest = DerivedComputedBlockSumCum::forced_import( + let rest = ComputedDerivedBlockSumCum::forced_import( db, name, height.boxed_clone(), diff --git a/crates/brk_computer/src/internal/computed/date/average.rs b/crates/brk_computer/src/internal/computed/date/average.rs index b337f5737..068354cf4 100644 --- a/crates/brk_computer/src/internal/computed/date/average.rs +++ b/crates/brk_computer/src/internal/computed/date/average.rs @@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes}; -use crate::internal::{ComputedVecValue, DerivedDateAverage}; +use crate::internal::{ComputedVecValue, LazyPeriodsAverage}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -21,7 +21,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub rest: DerivedDateAverage, + pub rest: LazyPeriodsAverage, } const VERSION: Version = Version::ZERO; @@ -39,7 +39,7 @@ where let dateindex = EagerVec::forced_import(db, name, version + VERSION)?; Ok(Self { - rest: DerivedDateAverage::from_source( + rest: LazyPeriodsAverage::from_source( name, version + VERSION, dateindex.boxed_clone(), diff --git a/crates/brk_computer/src/internal/computed/date/first.rs b/crates/brk_computer/src/internal/computed/date/first.rs index 5c49dd254..f5a75f4d3 100644 --- a/crates/brk_computer/src/internal/computed/date/first.rs +++ b/crates/brk_computer/src/internal/computed/date/first.rs @@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes}; -use crate::internal::{ComputedVecValue, DerivedDateFirst}; +use crate::internal::{ComputedVecValue, LazyPeriodsFirst}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -21,7 +21,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub rest: DerivedDateFirst, + pub rest: LazyPeriodsFirst, } const VERSION: Version = Version::ZERO; @@ -39,7 +39,7 @@ where let dateindex = EagerVec::forced_import(db, name, version + VERSION)?; Ok(Self { - rest: DerivedDateFirst::from_source( + rest: LazyPeriodsFirst::from_source( name, version + VERSION, dateindex.boxed_clone(), diff --git a/crates/brk_computer/src/internal/computed/date/last.rs b/crates/brk_computer/src/internal/computed/date/last.rs index 720261ac1..403ce181a 100644 --- a/crates/brk_computer/src/internal/computed/date/last.rs +++ b/crates/brk_computer/src/internal/computed/date/last.rs @@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, Itera use crate::{ComputeIndexes, indexes}; -use crate::internal::{ComputedVecValue, DerivedDateLast}; +use crate::internal::{ComputedVecValue, LazyPeriodsLast}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -21,7 +21,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub rest: DerivedDateLast, + pub rest: LazyPeriodsLast, } const VERSION: Version = Version::ZERO; @@ -39,7 +39,7 @@ where let dateindex = EagerVec::forced_import(db, name, version + VERSION)?; Ok(Self { - rest: DerivedDateLast::from_source( + rest: LazyPeriodsLast::from_source( name, version + VERSION, dateindex.boxed_clone(), diff --git a/crates/brk_computer/src/internal/computed/date/max.rs b/crates/brk_computer/src/internal/computed/date/max.rs index feb2d45c8..ad8871fe4 100644 --- a/crates/brk_computer/src/internal/computed/date/max.rs +++ b/crates/brk_computer/src/internal/computed/date/max.rs @@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes}; -use crate::internal::{ComputedVecValue, DerivedDateMax}; +use crate::internal::{ComputedVecValue, LazyPeriodsMax}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -21,7 +21,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub rest: DerivedDateMax, + pub rest: LazyPeriodsMax, } const VERSION: Version = Version::ZERO; @@ -39,7 +39,7 @@ where let dateindex = EagerVec::forced_import(db, name, version + VERSION)?; Ok(Self { - rest: DerivedDateMax::from_source( + rest: LazyPeriodsMax::from_source( name, version + VERSION, dateindex.boxed_clone(), diff --git a/crates/brk_computer/src/internal/computed/date/min.rs b/crates/brk_computer/src/internal/computed/date/min.rs index 6f0a7eb02..dc1be9762 100644 --- a/crates/brk_computer/src/internal/computed/date/min.rs +++ b/crates/brk_computer/src/internal/computed/date/min.rs @@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes}; -use crate::internal::{ComputedVecValue, DerivedDateMin}; +use crate::internal::{ComputedVecValue, LazyPeriodsMin}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -21,7 +21,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub rest: DerivedDateMin, + pub rest: LazyPeriodsMin, } const VERSION: Version = Version::ZERO; @@ -39,7 +39,7 @@ where let dateindex = EagerVec::forced_import(db, name, version + VERSION)?; Ok(Self { - rest: DerivedDateMin::from_source( + rest: LazyPeriodsMin::from_source( name, version + VERSION, dateindex.boxed_clone(), diff --git a/crates/brk_computer/src/internal/derived/block/distribution.rs b/crates/brk_computer/src/internal/derived/block/distribution.rs index 9ed564efe..61adc1f4c 100644 --- a/crates/brk_computer/src/internal/derived/block/distribution.rs +++ b/crates/brk_computer/src/internal/derived/block/distribution.rs @@ -1,4 +1,4 @@ -//! DerivedComputedBlockDistribution - dateindex storage + lazy time periods + difficultyepoch. +//! ComputedDerivedBlockDistribution - dateindex storage + lazy time periods + difficultyepoch. use brk_error::Result; @@ -11,26 +11,26 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec} use crate::{ ComputeIndexes, indexes, internal::{ - ComputedVecValue, DerivedDateDistribution, Distribution, LazyDistribution, NumericValue, + ComputedVecValue, LazyPeriodsDistribution, Distribution, LazyDistribution, NumericValue, }, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct DerivedComputedBlockDistribution +pub struct ComputedDerivedBlockDistribution where T: ComputedVecValue + PartialOrd + JsonSchema, { pub dateindex: Distribution, #[deref] #[deref_mut] - pub dates: DerivedDateDistribution, + pub dates: LazyPeriodsDistribution, pub difficultyepoch: LazyDistribution, } const VERSION: Version = Version::ZERO; -impl DerivedComputedBlockDistribution +impl ComputedDerivedBlockDistribution where T: NumericValue + JsonSchema, { @@ -44,7 +44,7 @@ where let dateindex = Distribution::forced_import(db, name, version + VERSION)?; let v = version + VERSION; - let dates = DerivedDateDistribution::from_sources( + let dates = LazyPeriodsDistribution::from_sources( name, v, dateindex.average.0.boxed_clone(), diff --git a/crates/brk_computer/src/internal/derived/block/first.rs b/crates/brk_computer/src/internal/derived/block/first.rs index a0f0ade67..1fd8e4e3e 100644 --- a/crates/brk_computer/src/internal/derived/block/first.rs +++ b/crates/brk_computer/src/internal/derived/block/first.rs @@ -1,4 +1,4 @@ -//! DerivedComputedBlockFirst - dateindex storage + difficultyepoch + lazy time periods (first value). +//! ComputedDerivedBlockFirst - dateindex storage + difficultyepoch + lazy time periods (first value). use brk_error::Result; @@ -10,12 +10,12 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec} use crate::{ ComputeIndexes, indexes, - internal::{ComputedVecValue, DerivedDateFirst, FirstVec, LazyFirst, NumericValue}, + internal::{ComputedVecValue, LazyPeriodsFirst, FirstVec, LazyFirst, NumericValue}, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct DerivedComputedBlockFirst +pub struct ComputedDerivedBlockFirst where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -23,13 +23,13 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub dates: DerivedDateFirst, + pub dates: LazyPeriodsFirst, pub difficultyepoch: LazyFirst, } const VERSION: Version = Version::ZERO; -impl DerivedComputedBlockFirst +impl ComputedDerivedBlockFirst where T: NumericValue + JsonSchema, { @@ -44,7 +44,7 @@ where let v = version + VERSION; Ok(Self { - dates: DerivedDateFirst::from_source(name, v, dateindex.0.boxed_clone(), indexes), + dates: LazyPeriodsFirst::from_source(name, v, dateindex.0.boxed_clone(), indexes), difficultyepoch: LazyFirst::from_source( name, v, diff --git a/crates/brk_computer/src/internal/derived/block/full.rs b/crates/brk_computer/src/internal/derived/block/full.rs index 9509dcae9..4c7d51abc 100644 --- a/crates/brk_computer/src/internal/derived/block/full.rs +++ b/crates/brk_computer/src/internal/derived/block/full.rs @@ -1,4 +1,4 @@ -//! DerivedComputedBlockFull - height_cumulative + dateindex storage + difficultyepoch + lazy time periods. +//! ComputedDerivedBlockFull - height_cumulative + dateindex storage + difficultyepoch + lazy time periods. use brk_error::Result; @@ -11,14 +11,14 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec} use crate::{ ComputeIndexes, indexes, internal::{ - ComputedVecValue, CumulativeVec, DerivedDateFull, Full, LazyFull, NumericValue, + ComputedVecValue, CumulativeVec, LazyPeriodsFull, Full, LazyFull, NumericValue, compute_cumulative_extend, }, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct DerivedComputedBlockFull +pub struct ComputedDerivedBlockFull where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,13 +27,13 @@ where pub dateindex: Full, #[deref] #[deref_mut] - pub dates: DerivedDateFull, + pub dates: LazyPeriodsFull, pub difficultyepoch: LazyFull, } const VERSION: Version = Version::ZERO; -impl DerivedComputedBlockFull +impl ComputedDerivedBlockFull where T: NumericValue + JsonSchema, { @@ -49,7 +49,7 @@ where let dateindex = Full::forced_import(db, name, v)?; Ok(Self { - dates: DerivedDateFull::from_sources( + dates: LazyPeriodsFull::from_sources( name, v, dateindex.distribution.average.0.boxed_clone(), diff --git a/crates/brk_computer/src/internal/derived/block/last.rs b/crates/brk_computer/src/internal/derived/block/last.rs index ad908f6de..4169338d6 100644 --- a/crates/brk_computer/src/internal/derived/block/last.rs +++ b/crates/brk_computer/src/internal/derived/block/last.rs @@ -1,4 +1,4 @@ -//! DerivedComputedBlockLast - dateindex storage + difficultyepoch + lazy time periods. +//! ComputedDerivedBlockLast - dateindex storage + difficultyepoch + lazy time periods. use brk_error::Result; @@ -10,12 +10,12 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec} use crate::{ ComputeIndexes, indexes, - internal::{ComputedVecValue, DerivedDateLast, LastVec, LazyLast, NumericValue}, + internal::{ComputedVecValue, LazyPeriodsLast, LastVec, LazyLast, NumericValue}, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct DerivedComputedBlockLast +pub struct ComputedDerivedBlockLast where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -23,13 +23,13 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub dates: DerivedDateLast, + pub dates: LazyPeriodsLast, pub difficultyepoch: LazyLast, } const VERSION: Version = Version::ZERO; -impl DerivedComputedBlockLast +impl ComputedDerivedBlockLast where T: NumericValue + JsonSchema, { @@ -44,7 +44,7 @@ where let v = version + VERSION; Ok(Self { - dates: DerivedDateLast::from_source(name, v, dateindex.0.boxed_clone(), indexes), + dates: LazyPeriodsLast::from_source(name, v, dateindex.0.boxed_clone(), indexes), difficultyepoch: LazyLast::from_source( name, v, diff --git a/crates/brk_computer/src/internal/derived/block/sum.rs b/crates/brk_computer/src/internal/derived/block/sum.rs index db2df6fc1..cf11c739f 100644 --- a/crates/brk_computer/src/internal/derived/block/sum.rs +++ b/crates/brk_computer/src/internal/derived/block/sum.rs @@ -1,4 +1,4 @@ -//! DerivedComputedBlockSum - dateindex storage + difficultyepoch + lazy time periods. +//! ComputedDerivedBlockSum - dateindex storage + difficultyepoch + lazy time periods. use brk_error::Result; @@ -13,25 +13,25 @@ use vecdb::{ use crate::{ ComputeIndexes, indexes, - internal::{ComputedVecValue, DerivedDateSum, LazySum, NumericValue, SumVec}, + internal::{ComputedVecValue, LazyPeriodsSum, LazySum, NumericValue, SumVec}, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct DerivedComputedBlockSum +pub struct ComputedDerivedBlockSum where T: ComputedVecValue + PartialOrd + JsonSchema, { pub dateindex: SumVec, #[deref] #[deref_mut] - pub dates: DerivedDateSum, + pub dates: LazyPeriodsSum, pub difficultyepoch: LazySum, } const VERSION: Version = Version::ZERO; -impl DerivedComputedBlockSum +impl ComputedDerivedBlockSum where T: NumericValue + JsonSchema, { @@ -46,7 +46,7 @@ where let v = version + VERSION; Ok(Self { - dates: DerivedDateSum::from_source(name, v, dateindex.0.boxed_clone(), indexes), + dates: LazyPeriodsSum::from_source(name, v, dateindex.0.boxed_clone(), indexes), difficultyepoch: LazySum::from_source_raw( name, v, diff --git a/crates/brk_computer/src/internal/derived/block/sum_cum.rs b/crates/brk_computer/src/internal/derived/block/sum_cum.rs index 2a730019b..a57995e37 100644 --- a/crates/brk_computer/src/internal/derived/block/sum_cum.rs +++ b/crates/brk_computer/src/internal/derived/block/sum_cum.rs @@ -1,4 +1,4 @@ -//! DerivedComputedBlockSumCum - aggregates derived from an external height source. +//! ComputedDerivedBlockSumCum - aggregates derived from an external height source. use brk_error::Result; @@ -14,14 +14,14 @@ use vecdb::{ use crate::{ ComputeIndexes, indexes, internal::{ - ComputedVecValue, CumulativeVec, DerivedDateSumCum, LazySumCum, NumericValue, SumCum, + ComputedVecValue, CumulativeVec, LazyPeriodsSumCum, LazySumCum, NumericValue, SumCum, compute_cumulative_extend, }, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct DerivedComputedBlockSumCum +pub struct ComputedDerivedBlockSumCum where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -30,13 +30,13 @@ where pub dateindex: SumCum, #[deref] #[deref_mut] - pub dates: DerivedDateSumCum, + pub dates: LazyPeriodsSumCum, pub difficultyepoch: LazySumCum, } const VERSION: Version = Version::ZERO; -impl DerivedComputedBlockSumCum +impl ComputedDerivedBlockSumCum where T: NumericValue + JsonSchema, { @@ -52,7 +52,7 @@ where let height_cumulative = CumulativeVec::forced_import(db, name, v)?; let dateindex = SumCum::forced_import_sum_raw(db, name, v)?; - let dates = DerivedDateSumCum::from_sources( + let dates = LazyPeriodsSumCum::from_sources( name, v, dateindex.sum.0.boxed_clone(), diff --git a/crates/brk_computer/src/internal/derived/date/average.rs b/crates/brk_computer/src/internal/derived/date/average.rs index 4b23cda40..12e4316ad 100644 --- a/crates/brk_computer/src/internal/derived/date/average.rs +++ b/crates/brk_computer/src/internal/derived/date/average.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateAverage +pub struct LazyPeriodsAverage where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateAverage +impl LazyPeriodsAverage where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/date/distribution.rs b/crates/brk_computer/src/internal/derived/date/distribution.rs index 1cae076c7..1488c1328 100644 --- a/crates/brk_computer/src/internal/derived/date/distribution.rs +++ b/crates/brk_computer/src/internal/derived/date/distribution.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateDistribution +pub struct LazyPeriodsDistribution where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateDistribution +impl LazyPeriodsDistribution where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/date/first.rs b/crates/brk_computer/src/internal/derived/date/first.rs index 3c58e5949..1c72f4da0 100644 --- a/crates/brk_computer/src/internal/derived/date/first.rs +++ b/crates/brk_computer/src/internal/derived/date/first.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateFirst +pub struct LazyPeriodsFirst where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateFirst +impl LazyPeriodsFirst where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/date/full.rs b/crates/brk_computer/src/internal/derived/date/full.rs index 80bb38e99..62641b57b 100644 --- a/crates/brk_computer/src/internal/derived/date/full.rs +++ b/crates/brk_computer/src/internal/derived/date/full.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateFull +pub struct LazyPeriodsFull where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateFull +impl LazyPeriodsFull where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/date/last.rs b/crates/brk_computer/src/internal/derived/date/last.rs index 6d0c1af8a..1816a2958 100644 --- a/crates/brk_computer/src/internal/derived/date/last.rs +++ b/crates/brk_computer/src/internal/derived/date/last.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateLast +pub struct LazyPeriodsLast where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateLast +impl LazyPeriodsLast where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/date/max.rs b/crates/brk_computer/src/internal/derived/date/max.rs index 66c88f8f0..7340eeb69 100644 --- a/crates/brk_computer/src/internal/derived/date/max.rs +++ b/crates/brk_computer/src/internal/derived/date/max.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateMax +pub struct LazyPeriodsMax where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateMax +impl LazyPeriodsMax where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/date/min.rs b/crates/brk_computer/src/internal/derived/date/min.rs index cb526dd8f..63bb275c8 100644 --- a/crates/brk_computer/src/internal/derived/date/min.rs +++ b/crates/brk_computer/src/internal/derived/date/min.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateMin +pub struct LazyPeriodsMin where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateMin +impl LazyPeriodsMin where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/date/sum.rs b/crates/brk_computer/src/internal/derived/date/sum.rs index 728eb7da7..5bbcb382a 100644 --- a/crates/brk_computer/src/internal/derived/date/sum.rs +++ b/crates/brk_computer/src/internal/derived/date/sum.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateSum +pub struct LazyPeriodsSum where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateSum +impl LazyPeriodsSum where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/date/sum_cum.rs b/crates/brk_computer/src/internal/derived/date/sum_cum.rs index 314b08b1c..7f4fed887 100644 --- a/crates/brk_computer/src/internal/derived/date/sum_cum.rs +++ b/crates/brk_computer/src/internal/derived/date/sum_cum.rs @@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct DerivedDateSumCum +pub struct LazyPeriodsSumCum where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl DerivedDateSumCum +impl LazyPeriodsSumCum where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/derived/tx/distribution.rs b/crates/brk_computer/src/internal/derived/tx/distribution.rs index 76c69ffb9..b4a5b6980 100644 --- a/crates/brk_computer/src/internal/derived/tx/distribution.rs +++ b/crates/brk_computer/src/internal/derived/tx/distribution.rs @@ -16,7 +16,7 @@ use vecdb::{CollectableVec, Database, Exit, IterableCloneableVec}; use crate::{ ComputeIndexes, indexes, internal::{ - ComputedVecValue, DerivedDateDistribution, Distribution, LazyDistribution, MinMaxAverage, + ComputedVecValue, LazyPeriodsDistribution, Distribution, LazyDistribution, MinMaxAverage, NumericValue, }, }; @@ -33,7 +33,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub dates: DerivedDateDistribution, + pub dates: LazyPeriodsDistribution, } const VERSION: Version = Version::ZERO; @@ -62,7 +62,7 @@ where indexes.difficultyepoch.identity.boxed_clone(), ); - let dates = DerivedDateDistribution::from_sources( + let dates = LazyPeriodsDistribution::from_sources( name, v, dateindex.average.0.boxed_clone(), diff --git a/crates/brk_computer/src/internal/derived/tx/full.rs b/crates/brk_computer/src/internal/derived/tx/full.rs index c99785ce3..a1cd8c1c0 100644 --- a/crates/brk_computer/src/internal/derived/tx/full.rs +++ b/crates/brk_computer/src/internal/derived/tx/full.rs @@ -11,7 +11,7 @@ use vecdb::{CollectableVec, Database, Exit, IterableCloneableVec}; use crate::{ indexes, ComputeIndexes, - internal::{ComputedVecValue, DerivedDateFull, Full, LazyFull, NumericValue, Stats}, + internal::{ComputedVecValue, LazyPeriodsFull, Full, LazyFull, NumericValue, Stats}, }; /// Aggregates from TxIndex to height/dateindex with full stats. @@ -27,7 +27,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub dates: DerivedDateFull, + pub dates: LazyPeriodsFull, } const VERSION: Version = Version::ZERO; @@ -58,7 +58,7 @@ where indexes.difficultyepoch.identity.boxed_clone(), ); - let dates = DerivedDateFull::from_sources( + let dates = LazyPeriodsFull::from_sources( name, v, dateindex.average.0.boxed_clone(), diff --git a/crates/brk_computer/src/internal/lazy/block/binary_full.rs b/crates/brk_computer/src/internal/lazy/block/binary_full.rs index 160e96bd8..9ed671e77 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_full.rs +++ b/crates/brk_computer/src/internal/lazy/block/binary_full.rs @@ -8,7 +8,7 @@ use vecdb::{BinaryTransform, IterableBoxedVec, LazyVecFrom2}; use crate::internal::{ComputedBlockFull, ComputedVecValue, DerivedTxFull, NumericValue}; -use super::super::derived_block::LazyDerivedBlock2SumCum; +use super::super::derived_block::LazyBinaryDerivedBlockSumCum; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -22,7 +22,7 @@ where pub height: LazyVecFrom2, #[deref] #[deref_mut] - pub rest: LazyDerivedBlock2SumCum, + pub rest: LazyBinaryDerivedBlockSumCum, } const VERSION: Version = Version::ZERO; @@ -45,7 +45,7 @@ where Self { height: LazyVecFrom2::transformed::(name, v, height_source1, height_source2), - rest: LazyDerivedBlock2SumCum::from_derived_full::( + rest: LazyBinaryDerivedBlockSumCum::from_derived_full::( name, v, &source1.dateindex.sum_cum, diff --git a/crates/brk_computer/src/internal/lazy/block/binary_last.rs b/crates/brk_computer/src/internal/lazy/block/binary_last.rs index a8989e82c..0c2b761b1 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_last.rs +++ b/crates/brk_computer/src/internal/lazy/block/binary_last.rs @@ -8,10 +8,10 @@ use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom use crate::internal::{ ComputedBlockLast, ComputedBlockSumCum, ComputedHeightDateLast, ComputedVecValue, - DerivedDateLast, LazyBinaryDateLast, LazyTransform2Last, NumericValue, + LazyPeriodsLast, LazyBinaryDateLast, LazyBinaryTransformLast, NumericValue, }; -use super::super::derived_block::LazyDerivedBlock2Last; +use super::super::derived_block::LazyBinaryDerivedBlockLast; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -24,7 +24,7 @@ where pub height: LazyVecFrom2, #[deref] #[deref_mut] - pub rest: LazyDerivedBlock2Last, + pub rest: LazyBinaryDerivedBlockLast, } const VERSION: Version = Version::ZERO; @@ -54,7 +54,7 @@ where source1.height_cumulative.0.boxed_clone(), source2.height_cumulative.0.boxed_clone(), ), - rest: LazyDerivedBlock2Last::from_computed_sum_cum::(name, v, source1, source2), + rest: LazyBinaryDerivedBlockLast::from_computed_sum_cum::(name, v, source1, source2), } } @@ -77,7 +77,7 @@ where source1.height.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2Last::from_computed_last::(name, v, source1, source2), + rest: LazyBinaryDerivedBlockLast::from_computed_last::(name, v, source1, source2), } } @@ -100,7 +100,7 @@ where source1.height.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2Last::from_computed_height_date_last::( + rest: LazyBinaryDerivedBlockLast::from_computed_height_date_last::( name, v, source1, source2, ), } @@ -128,14 +128,14 @@ where source1.height.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2Last { + rest: LazyBinaryDerivedBlockLast { dates: LazyBinaryDateLast::from_computed_and_binary_last::( name, v, &source1.rest, &source2.rest.dates, ), - difficultyepoch: LazyTransform2Last::from_vecs::( + difficultyepoch: LazyBinaryTransformLast::from_vecs::( name, v, source1.difficultyepoch.0.boxed_clone(), @@ -165,7 +165,7 @@ where source1.height.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2Last::from_computed_height_date_and_block_last::( + rest: LazyBinaryDerivedBlockLast::from_computed_height_date_and_block_last::( name, v, source1, source2, ), } @@ -193,14 +193,14 @@ where source1.height.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2Last { + rest: LazyBinaryDerivedBlockLast { dates: LazyBinaryDateLast::from_binary_and_block_last::( name, v, &source1.rest.dates, source2, ), - difficultyepoch: LazyTransform2Last::from_vecs::( + difficultyepoch: LazyBinaryTransformLast::from_vecs::( name, v, source1.rest.difficultyepoch.boxed_clone(), @@ -233,14 +233,14 @@ where source1.height.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2Last { + rest: LazyBinaryDerivedBlockLast { dates: LazyBinaryDateLast::from_both_binary_last::( name, v, &source1.rest.dates, &source2.rest.dates, ), - difficultyepoch: LazyTransform2Last::from_vecs::( + difficultyepoch: LazyBinaryTransformLast::from_vecs::( name, v, source1.rest.difficultyepoch.boxed_clone(), @@ -262,15 +262,15 @@ where difficultyepoch_source1: IterableBoxedVec, difficultyepoch_source2: IterableBoxedVec, dateindex_source1: IterableBoxedVec, - dates_source1: &DerivedDateLast, + dates_source1: &LazyPeriodsLast, dateindex_source2: IterableBoxedVec, - dates_source2: &DerivedDateLast, + dates_source2: &LazyPeriodsLast, ) -> Self { let v = version + VERSION; Self { height: LazyVecFrom2::transformed::(name, v, height_source1, height_source2), - rest: LazyDerivedBlock2Last { + rest: LazyBinaryDerivedBlockLast { dates: LazyBinaryDateLast::from_both_derived_last::( name, v, @@ -279,7 +279,7 @@ where dateindex_source2, dates_source2, ), - difficultyepoch: LazyTransform2Last::from_vecs::( + difficultyepoch: LazyBinaryTransformLast::from_vecs::( name, v, difficultyepoch_source1, 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 f5058908f..55225404c 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_sum.rs +++ b/crates/brk_computer/src/internal/lazy/block/binary_sum.rs @@ -6,9 +6,9 @@ use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2}; -use crate::internal::{ComputedBlockSum, ComputedVecValue, DerivedComputedBlockSum, NumericValue}; +use crate::internal::{ComputedBlockSum, ComputedVecValue, ComputedDerivedBlockSum, NumericValue}; -use super::super::derived_block::LazyDerivedBlock2Sum; +use super::super::derived_block::LazyBinaryDerivedBlockSum; const VERSION: Version = Version::ZERO; @@ -24,7 +24,7 @@ where pub height: LazyVecFrom2, #[deref] #[deref_mut] - pub rest: LazyDerivedBlock2Sum, + pub rest: LazyBinaryDerivedBlockSum, } impl BinaryBlockSum @@ -38,14 +38,14 @@ where version: Version, height_source1: IterableBoxedVec, height_source2: IterableBoxedVec, - source1: &DerivedComputedBlockSum, - source2: &DerivedComputedBlockSum, + source1: &ComputedDerivedBlockSum, + source2: &ComputedDerivedBlockSum, ) -> Self { let v = version + VERSION; Self { height: LazyVecFrom2::transformed::(name, v, height_source1, height_source2), - rest: LazyDerivedBlock2Sum::from_derived::(name, v, source1, source2), + rest: LazyBinaryDerivedBlockSum::from_derived::(name, v, source1, source2), } } @@ -64,7 +64,7 @@ where source1.height.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2Sum::from_derived::(name, v, &source1.rest, &source2.rest), + rest: LazyBinaryDerivedBlockSum::from_derived::(name, v, &source1.rest, &source2.rest), } } } 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 ec5b2a0ff..b07f46cb1 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 @@ -7,11 +7,11 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, DerivedComputedBlockLast, - DerivedComputedBlockSumCum, NumericValue, + ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast, + ComputedDerivedBlockSumCum, NumericValue, }; -use super::super::derived_block::LazyDerivedBlock2SumCum; +use super::super::derived_block::LazyBinaryDerivedBlockSumCum; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -27,7 +27,7 @@ where pub height_cumulative: LazyVecFrom2, #[deref] #[deref_mut] - pub rest: LazyDerivedBlock2SumCum, + pub rest: LazyBinaryDerivedBlockSumCum, } const VERSION: Version = Version::ZERO; @@ -60,7 +60,7 @@ where source1.height_cumulative.0.boxed_clone(), source2.height_cumulative.0.boxed_clone(), ), - rest: LazyDerivedBlock2SumCum::from_computed_sum_raw::( + rest: LazyBinaryDerivedBlockSumCum::from_computed_sum_raw::( name, v, &source1.dateindex, @@ -78,8 +78,8 @@ where version: Version, height_source1: IterableBoxedVec, height_source2: IterableBoxedVec, - source1: &DerivedComputedBlockSumCum, - source2: &DerivedComputedBlockSumCum, + source1: &ComputedDerivedBlockSumCum, + source2: &ComputedDerivedBlockSumCum, ) -> Self where S1T: PartialOrd, @@ -95,7 +95,7 @@ where source1.height_cumulative.0.boxed_clone(), source2.height_cumulative.0.boxed_clone(), ), - rest: LazyDerivedBlock2SumCum::from_computed_sum_raw::( + rest: LazyBinaryDerivedBlockSumCum::from_computed_sum_raw::( name, v, &source1.dateindex, @@ -131,7 +131,7 @@ where source1.height_cumulative.0.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2SumCum::from_computed_last::(name, v, source1, source2), + rest: LazyBinaryDerivedBlockSumCum::from_computed_last::(name, v, source1, source2), } } @@ -140,7 +140,7 @@ where version: Version, height_source1: IterableBoxedVec, height_source2: IterableBoxedVec, - source1: &DerivedComputedBlockSumCum, + source1: &ComputedDerivedBlockSumCum, source2: &ComputedBlockLast, ) -> Self where @@ -156,7 +156,7 @@ where source1.height_cumulative.0.boxed_clone(), source2.height.boxed_clone(), ), - rest: LazyDerivedBlock2SumCum::from_derived_computed_last::(name, v, source1, source2), + rest: LazyBinaryDerivedBlockSumCum::from_derived_computed_last::(name, v, source1, source2), } } @@ -165,8 +165,8 @@ where version: Version, height_source1: IterableBoxedVec, height_source2: IterableBoxedVec, - source1: &DerivedComputedBlockSumCum, - source2: &DerivedComputedBlockLast, + source1: &ComputedDerivedBlockSumCum, + source2: &ComputedDerivedBlockLast, ) -> Self where S1T: NumericValue, @@ -181,7 +181,7 @@ where source1.height_cumulative.0.boxed_clone(), height_source2, ), - rest: LazyDerivedBlock2SumCum::from_derived_last::(name, v, source1, source2), + rest: LazyBinaryDerivedBlockSumCum::from_derived_last::(name, v, source1, source2), } } @@ -191,7 +191,7 @@ where height_source1: IterableBoxedVec, height_source2: IterableBoxedVec, source1: &ComputedBlockSumCum, - source2: &DerivedComputedBlockLast, + source2: &ComputedDerivedBlockLast, ) -> Self where S1T: PartialOrd, @@ -206,7 +206,7 @@ where source1.height_cumulative.0.boxed_clone(), height_source2, ), - rest: LazyDerivedBlock2SumCum::from_computed_derived_last::(name, v, source1, source2), + rest: LazyBinaryDerivedBlockSumCum::from_computed_derived_last::(name, v, source1, source2), } } } diff --git a/crates/brk_computer/src/internal/lazy/block/computed_full.rs b/crates/brk_computer/src/internal/lazy/block/computed_full.rs index 5ab65e56a..4e7e57fa4 100644 --- a/crates/brk_computer/src/internal/lazy/block/computed_full.rs +++ b/crates/brk_computer/src/internal/lazy/block/computed_full.rs @@ -1,4 +1,4 @@ -//! LazyComputedBlockFull - lazy height + DerivedComputedBlockFull. +//! LazyComputedBlockFull - lazy height + ComputedDerivedBlockFull. use brk_error::Result; use brk_traversable::Traversable; @@ -9,7 +9,7 @@ use vecdb::{Database, Exit, IterableCloneableVec, LazyVecFrom1, UnaryTransform}; use crate::{ ComputeIndexes, indexes, - internal::{ComputedVecValue, DerivedComputedBlockFull, NumericValue}, + internal::{ComputedVecValue, ComputedDerivedBlockFull, NumericValue}, }; const VERSION: Version = Version::ZERO; @@ -26,7 +26,7 @@ where pub height: LazyVecFrom1, #[deref] #[deref_mut] - pub rest: DerivedComputedBlockFull, + pub rest: ComputedDerivedBlockFull, } impl LazyComputedBlockFull @@ -46,7 +46,7 @@ where let height = LazyVecFrom1::transformed::(name, v, source.boxed_clone()); let rest = - DerivedComputedBlockFull::forced_import(db, name, height.boxed_clone(), v, indexes)?; + ComputedDerivedBlockFull::forced_import(db, name, height.boxed_clone(), v, indexes)?; Ok(Self { height, rest }) } @@ -64,7 +64,7 @@ where let height = LazyVecFrom1::init(name, v, source.boxed_clone(), init_fn); let rest = - DerivedComputedBlockFull::forced_import(db, name, height.boxed_clone(), v, indexes)?; + ComputedDerivedBlockFull::forced_import(db, name, height.boxed_clone(), v, indexes)?; Ok(Self { height, rest }) } diff --git a/crates/brk_computer/src/internal/lazy/block/distribution.rs b/crates/brk_computer/src/internal/lazy/block/distribution.rs index 7bd3ef3c1..ee7287c40 100644 --- a/crates/brk_computer/src/internal/lazy/block/distribution.rs +++ b/crates/brk_computer/src/internal/lazy/block/distribution.rs @@ -9,7 +9,7 @@ use vecdb::{ComputeFrom1, Database, Exit, IterableCloneableVec, LazyVecFrom1, Un use crate::{ ComputeIndexes, indexes, - internal::{ComputedVecValue, DerivedComputedBlockDistribution, NumericValue}, + internal::{ComputedVecValue, ComputedDerivedBlockDistribution, NumericValue}, }; const VERSION: Version = Version::ZERO; @@ -30,7 +30,7 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub rest: DerivedComputedBlockDistribution, + pub rest: ComputedDerivedBlockDistribution, } impl LazyBlockDistribution @@ -49,7 +49,7 @@ where let height = LazyVecFrom1::transformed::(name, v, source.boxed_clone()); - let rest = DerivedComputedBlockDistribution::forced_import( + let rest = ComputedDerivedBlockDistribution::forced_import( db, name, height.boxed_clone(), @@ -72,7 +72,7 @@ where let height = LazyVecFrom1::init(name, v, source.boxed_clone(), init_fn); - let rest = DerivedComputedBlockDistribution::forced_import( + let rest = ComputedDerivedBlockDistribution::forced_import( db, name, height.boxed_clone(), diff --git a/crates/brk_computer/src/internal/lazy/block/full.rs b/crates/brk_computer/src/internal/lazy/block/full.rs index 752915e74..284fd9cc0 100644 --- a/crates/brk_computer/src/internal/lazy/block/full.rs +++ b/crates/brk_computer/src/internal/lazy/block/full.rs @@ -7,7 +7,7 @@ use schemars::JsonSchema; use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform}; use crate::internal::{ - ComputedBlockFull, ComputedVecValue, DerivedComputedBlockFull, NumericValue, + ComputedBlockFull, ComputedVecValue, ComputedDerivedBlockFull, NumericValue, }; use super::super::derived_block::LazyDerivedBlockFull; @@ -55,7 +55,7 @@ where name: &str, version: Version, height_source: IterableBoxedVec, - source: &DerivedComputedBlockFull, + source: &ComputedDerivedBlockFull, ) -> Self where S1T: NumericValue, diff --git a/crates/brk_computer/src/internal/lazy/block/last.rs b/crates/brk_computer/src/internal/lazy/block/last.rs index 46cc078cc..2580197fe 100644 --- a/crates/brk_computer/src/internal/lazy/block/last.rs +++ b/crates/brk_computer/src/internal/lazy/block/last.rs @@ -7,7 +7,7 @@ use schemars::JsonSchema; use vecdb::{IterableBoxedVec, IterableCloneableVec, LazyVecFrom1, UnaryTransform}; use crate::internal::{ - ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, DerivedComputedBlockLast, + ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, ComputedDerivedBlockLast, NumericValue, }; @@ -52,7 +52,7 @@ where name: &str, version: Version, height_source: IterableBoxedVec, - source: &DerivedComputedBlockLast, + source: &ComputedDerivedBlockLast, ) -> Self where S1T: NumericValue, diff --git a/crates/brk_computer/src/internal/lazy/block/sum.rs b/crates/brk_computer/src/internal/lazy/block/sum.rs index c2368d63d..2262fb6dd 100644 --- a/crates/brk_computer/src/internal/lazy/block/sum.rs +++ b/crates/brk_computer/src/internal/lazy/block/sum.rs @@ -6,7 +6,7 @@ use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform}; -use crate::internal::{ComputedBlockSum, ComputedVecValue, DerivedComputedBlockSum, NumericValue}; +use crate::internal::{ComputedBlockSum, ComputedVecValue, ComputedDerivedBlockSum, NumericValue}; use super::super::derived_block::LazyDerivedBlockSum; #[derive(Clone, Deref, DerefMut, Traversable)] @@ -53,7 +53,7 @@ where name: &str, version: Version, height_source: IterableBoxedVec, - source: &DerivedComputedBlockSum, + source: &ComputedDerivedBlockSum, ) -> Self where S1T: NumericValue, 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 6360012b4..811ea5e4a 100644 --- a/crates/brk_computer/src/internal/lazy/block/sum_cum.rs +++ b/crates/brk_computer/src/internal/lazy/block/sum_cum.rs @@ -7,7 +7,7 @@ use schemars::JsonSchema; use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform}; use crate::internal::{ - ComputedBlockSumCum, ComputedVecValue, DerivedComputedBlockSumCum, NumericValue, + ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue, }; use super::super::derived_block::LazyDerivedBlockSumCum; @@ -55,7 +55,7 @@ where name: &str, version: Version, height_source: IterableBoxedVec, - source: &DerivedComputedBlockSumCum, + source: &ComputedDerivedBlockSumCum, ) -> Self where S1T: NumericValue, diff --git a/crates/brk_computer/src/internal/lazy/date/binary_last.rs b/crates/brk_computer/src/internal/lazy/date/binary_last.rs index 6109a15c3..9838b8acc 100644 --- a/crates/brk_computer/src/internal/lazy/date/binary_last.rs +++ b/crates/brk_computer/src/internal/lazy/date/binary_last.rs @@ -8,11 +8,11 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedVecValue, DerivedDateLast, - DerivedDateSumCum, NumericValue, + ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedVecValue, LazyPeriodsLast, + LazyPeriodsSumCum, NumericValue, }; -use super::super::transform::LazyTransform2Last; +use super::super::transform::LazyBinaryTransformLast; const VERSION: Version = Version::ZERO; @@ -25,12 +25,12 @@ where S2T: ComputedVecValue, { pub dateindex: LazyVecFrom2, - pub weekindex: LazyTransform2Last, - pub monthindex: LazyTransform2Last, - pub quarterindex: LazyTransform2Last, - pub semesterindex: LazyTransform2Last, - pub yearindex: LazyTransform2Last, - pub decadeindex: LazyTransform2Last, + pub weekindex: LazyBinaryTransformLast, + pub monthindex: LazyBinaryTransformLast, + pub quarterindex: LazyBinaryTransformLast, + pub semesterindex: LazyBinaryTransformLast, + pub yearindex: LazyBinaryTransformLast, + pub decadeindex: LazyBinaryTransformLast, } impl LazyBinaryDateLast @@ -49,7 +49,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_lazy_last::( + LazyBinaryTransformLast::from_lazy_last::( name, v, &source1.$p, @@ -78,14 +78,14 @@ where name: &str, version: Version, dateindex_source1: IterableBoxedVec, - source1: &DerivedDateLast, + source1: &LazyPeriodsLast, source2: &ComputedDateLast, ) -> Self { let v = version + VERSION; macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_lazy_last::( + LazyBinaryTransformLast::from_lazy_last::( name, v, &source1.$p, @@ -114,7 +114,7 @@ where name: &str, version: Version, dateindex_source1: IterableBoxedVec, - source1: &DerivedDateLast, + source1: &LazyPeriodsLast, source2: &ComputedBlockLast, ) -> Self where @@ -124,7 +124,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_lazy_last::( + LazyBinaryTransformLast::from_lazy_last::( name, v, &source1.$p, @@ -153,15 +153,15 @@ where name: &str, version: Version, dateindex_source1: IterableBoxedVec, - source1: &DerivedDateLast, + source1: &LazyPeriodsLast, dateindex_source2: IterableBoxedVec, - source2: &DerivedDateLast, + source2: &LazyPeriodsLast, ) -> Self { let v = version + VERSION; macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_lazy_last::( + LazyBinaryTransformLast::from_lazy_last::( name, v, &source1.$p, @@ -199,7 +199,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_lazy_last::( + LazyBinaryTransformLast::from_lazy_last::( name, v, &source1.$p, @@ -237,7 +237,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_lazy_last::( + LazyBinaryTransformLast::from_lazy_last::( name, v, &source1.$p, @@ -276,7 +276,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_lazy_last::( + LazyBinaryTransformLast::from_lazy_last::( name, v, &source1.$p, @@ -314,7 +314,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_vecs::( + LazyBinaryTransformLast::from_vecs::( name, v, source1.$p.boxed_clone(), @@ -353,7 +353,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_vecs::( + LazyBinaryTransformLast::from_vecs::( name, v, source1.$p.boxed_clone(), @@ -382,9 +382,9 @@ where name: &str, version: Version, dateindex_source1: IterableBoxedVec, - dates1: &DerivedDateSumCum, + dates1: &LazyPeriodsSumCum, dateindex_source2: IterableBoxedVec, - dates2: &DerivedDateSumCum, + dates2: &LazyPeriodsSumCum, ) -> Self where S1T: PartialOrd, @@ -394,7 +394,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_vecs::( + LazyBinaryTransformLast::from_vecs::( name, v, dates1.$p.cumulative.boxed_clone(), @@ -419,12 +419,12 @@ where } } - /// Create from a DerivedDateLast source and a BinaryDateLast source. + /// Create from a LazyPeriodsLast source and a BinaryDateLast source. pub fn from_derived_last_and_binary_last( name: &str, version: Version, dateindex_source1: IterableBoxedVec, - source1: &DerivedDateLast, + source1: &LazyPeriodsLast, source2: &LazyBinaryDateLast, ) -> Self where @@ -436,7 +436,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_vecs::( + LazyBinaryTransformLast::from_vecs::( name, v, source1.$p.boxed_clone(), @@ -477,7 +477,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_vecs::( + LazyBinaryTransformLast::from_vecs::( name, v, source1.$p.boxed_clone(), @@ -519,7 +519,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_vecs::( + LazyBinaryTransformLast::from_vecs::( name, v, source1.$p.boxed_clone(), @@ -560,7 +560,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_vecs::( + LazyBinaryTransformLast::from_vecs::( name, v, source1.$p.boxed_clone(), @@ -603,7 +603,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2Last::from_vecs::( + LazyBinaryTransformLast::from_vecs::( name, v, source1.$p.boxed_clone(), diff --git a/crates/brk_computer/src/internal/lazy/date/binary_sum.rs b/crates/brk_computer/src/internal/lazy/date/binary_sum.rs index 4e0035609..bcdda9d16 100644 --- a/crates/brk_computer/src/internal/lazy/date/binary_sum.rs +++ b/crates/brk_computer/src/internal/lazy/date/binary_sum.rs @@ -7,28 +7,28 @@ use brk_types::{ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableCloneableVec}; -use crate::internal::{ComputedVecValue, DerivedComputedBlockSum, LazyTransform2Sum, NumericValue}; +use crate::internal::{ComputedVecValue, ComputedDerivedBlockSum, LazyBinaryTransformSum, NumericValue}; const VERSION: Version = Version::ZERO; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct LazyDate2Sum +pub struct LazyBinaryDateSum where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, S2T: ComputedVecValue, { - pub dateindex: LazyTransform2Sum, - pub weekindex: LazyTransform2Sum, - pub monthindex: LazyTransform2Sum, - pub quarterindex: LazyTransform2Sum, - pub semesterindex: LazyTransform2Sum, - pub yearindex: LazyTransform2Sum, - pub decadeindex: LazyTransform2Sum, + pub dateindex: LazyBinaryTransformSum, + pub weekindex: LazyBinaryTransformSum, + pub monthindex: LazyBinaryTransformSum, + pub quarterindex: LazyBinaryTransformSum, + pub semesterindex: LazyBinaryTransformSum, + pub yearindex: LazyBinaryTransformSum, + pub decadeindex: LazyBinaryTransformSum, } -impl LazyDate2Sum +impl LazyBinaryDateSum where T: ComputedVecValue + JsonSchema + 'static, S1T: NumericValue + JsonSchema, @@ -37,19 +37,19 @@ where pub fn from_derived>( name: &str, version: Version, - source1: &DerivedComputedBlockSum, - source2: &DerivedComputedBlockSum, + source1: &ComputedDerivedBlockSum, + source2: &ComputedDerivedBlockSum, ) -> Self { let v = version + VERSION; macro_rules! period { ($p:ident) => { - LazyTransform2Sum::from_boxed::(name, v, source1.$p.boxed_clone(), source2.$p.boxed_clone()) + LazyBinaryTransformSum::from_boxed::(name, v, source1.$p.boxed_clone(), source2.$p.boxed_clone()) }; } Self { - dateindex: LazyTransform2Sum::from_sum::(name, v, &source1.dateindex, &source2.dateindex), + dateindex: LazyBinaryTransformSum::from_sum::(name, v, &source1.dateindex, &source2.dateindex), weekindex: period!(weekindex), monthindex: period!(monthindex), quarterindex: period!(quarterindex), diff --git a/crates/brk_computer/src/internal/lazy/date/binary_sum_cum.rs b/crates/brk_computer/src/internal/lazy/date/binary_sum_cum.rs index 802af2f41..477714cba 100644 --- a/crates/brk_computer/src/internal/lazy/date/binary_sum_cum.rs +++ b/crates/brk_computer/src/internal/lazy/date/binary_sum_cum.rs @@ -8,32 +8,32 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableCloneableVec}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, DerivedComputedBlockLast, - DerivedComputedBlockSumCum, DerivedDateFull, DerivedDateSumCum, NumericValue, SumCum, + ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast, + ComputedDerivedBlockSumCum, LazyPeriodsFull, LazyPeriodsSumCum, NumericValue, SumCum, }; -use super::super::transform::LazyTransform2SumCum; +use super::super::transform::LazyBinaryTransformSumCum; const VERSION: Version = Version::ZERO; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct LazyDate2SumCum +pub struct LazyBinaryDateSumCum where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, S2T: ComputedVecValue, { - pub dateindex: LazyTransform2SumCum, - pub weekindex: LazyTransform2SumCum, - pub monthindex: LazyTransform2SumCum, - pub quarterindex: LazyTransform2SumCum, - pub semesterindex: LazyTransform2SumCum, - pub yearindex: LazyTransform2SumCum, - pub decadeindex: LazyTransform2SumCum, + pub dateindex: LazyBinaryTransformSumCum, + pub weekindex: LazyBinaryTransformSumCum, + pub monthindex: LazyBinaryTransformSumCum, + pub quarterindex: LazyBinaryTransformSumCum, + pub semesterindex: LazyBinaryTransformSumCum, + pub yearindex: LazyBinaryTransformSumCum, + pub decadeindex: LazyBinaryTransformSumCum, } -impl LazyDate2SumCum +impl LazyBinaryDateSumCum where T: ComputedVecValue + JsonSchema + 'static, S1T: ComputedVecValue + JsonSchema, @@ -44,15 +44,15 @@ where name: &str, version: Version, dateindex1: &SumCum, - periods1: &DerivedDateSumCum, + periods1: &LazyPeriodsSumCum, dateindex2: &SumCum, - periods2: &DerivedDateSumCum, + periods2: &LazyPeriodsSumCum, ) -> Self { let v = version + VERSION; macro_rules! period { ($p:ident) => { - LazyTransform2SumCum::from_sources::( + LazyBinaryTransformSumCum::from_sources::( name, v, periods1.$p.sum.boxed_clone(), periods2.$p.sum.boxed_clone(), periods1.$p.cumulative.boxed_clone(), periods2.$p.cumulative.boxed_clone(), @@ -61,7 +61,7 @@ where } Self { - dateindex: LazyTransform2SumCum::from_sum_cum::(name, v, dateindex1, dateindex2), + dateindex: LazyBinaryTransformSumCum::from_sum_cum::(name, v, dateindex1, dateindex2), weekindex: period!(weekindex), monthindex: period!(monthindex), quarterindex: period!(quarterindex), @@ -75,22 +75,22 @@ where name: &str, version: Version, dateindex1: &SumCum, - dates1: &DerivedDateFull, + dates1: &LazyPeriodsFull, dateindex2: &SumCum, - dates2: &DerivedDateFull, + dates2: &LazyPeriodsFull, ) -> Self { let v = version + VERSION; macro_rules! period { ($p:ident) => { - LazyTransform2SumCum::from_lazy_stats_aggregate::( + LazyBinaryTransformSumCum::from_lazy_stats_aggregate::( name, v, &dates1.$p, &dates2.$p, ) }; } Self { - dateindex: LazyTransform2SumCum::from_sum_cum::(name, v, dateindex1, dateindex2), + dateindex: LazyBinaryTransformSumCum::from_sum_cum::(name, v, dateindex1, dateindex2), weekindex: period!(weekindex), monthindex: period!(monthindex), quarterindex: period!(quarterindex), @@ -107,15 +107,15 @@ where name: &str, version: Version, dateindex1: &SumCum, - periods1: &DerivedDateSumCum, + periods1: &LazyPeriodsSumCum, dateindex2: &SumCum, - periods2: &DerivedDateSumCum, + periods2: &LazyPeriodsSumCum, ) -> Self { let v = version + VERSION; macro_rules! period { ($p:ident) => { - LazyTransform2SumCum::from_sources_sum_raw::( + LazyBinaryTransformSumCum::from_sources_sum_raw::( name, v, periods1.$p.sum.boxed_clone(), periods2.$p.sum.boxed_clone(), periods1.$p.cumulative.boxed_clone(), periods2.$p.cumulative.boxed_clone(), @@ -124,7 +124,7 @@ where } Self { - dateindex: LazyTransform2SumCum::from_sum_cum_sum_raw::(name, v, dateindex1, dateindex2), + dateindex: LazyBinaryTransformSumCum::from_sum_cum_sum_raw::(name, v, dateindex1, dateindex2), weekindex: period!(weekindex), monthindex: period!(monthindex), quarterindex: period!(quarterindex), @@ -150,7 +150,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2SumCum::from_sources_last_sum_raw::( + LazyBinaryTransformSumCum::from_sources_last_sum_raw::( name, v, source1.rest.$p.sum.boxed_clone(), source1.rest.$p.cumulative.boxed_clone(), @@ -160,7 +160,7 @@ where } Self { - dateindex: LazyTransform2SumCum::from_sum_cum_last_sum_raw::( + dateindex: LazyBinaryTransformSumCum::from_sum_cum_last_sum_raw::( name, v, &source1.dateindex, &source2.dateindex, ), weekindex: period!(weekindex), @@ -175,7 +175,7 @@ where pub fn from_derived_computed_last>( name: &str, version: Version, - source1: &DerivedComputedBlockSumCum, + source1: &ComputedDerivedBlockSumCum, source2: &ComputedBlockLast, ) -> Self where @@ -186,7 +186,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2SumCum::from_sources_last_sum_raw::( + LazyBinaryTransformSumCum::from_sources_last_sum_raw::( name, v, source1.$p.sum.boxed_clone(), source1.$p.cumulative.boxed_clone(), @@ -196,7 +196,7 @@ where } Self { - dateindex: LazyTransform2SumCum::from_sum_cum_last_sum_raw::( + dateindex: LazyBinaryTransformSumCum::from_sum_cum_last_sum_raw::( name, v, &source1.dateindex, &source2.dateindex, ), weekindex: period!(weekindex), @@ -212,7 +212,7 @@ where name: &str, version: Version, source1: &ComputedBlockSumCum, - source2: &DerivedComputedBlockLast, + source2: &ComputedDerivedBlockLast, ) -> Self where S1T: PartialOrd, @@ -222,7 +222,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2SumCum::from_sources_last_sum_raw::( + LazyBinaryTransformSumCum::from_sources_last_sum_raw::( name, v, source1.rest.$p.sum.boxed_clone(), source1.rest.$p.cumulative.boxed_clone(), @@ -232,7 +232,7 @@ where } Self { - dateindex: LazyTransform2SumCum::from_sum_cum_last_sum_raw::( + dateindex: LazyBinaryTransformSumCum::from_sum_cum_last_sum_raw::( name, v, &source1.dateindex, &source2.dateindex, ), weekindex: period!(weekindex), @@ -247,8 +247,8 @@ where pub fn from_derived_last>( name: &str, version: Version, - source1: &DerivedComputedBlockSumCum, - source2: &DerivedComputedBlockLast, + source1: &ComputedDerivedBlockSumCum, + source2: &ComputedDerivedBlockLast, ) -> Self where S1T: NumericValue, @@ -258,7 +258,7 @@ where macro_rules! period { ($p:ident) => { - LazyTransform2SumCum::from_sources_last_sum_raw::( + LazyBinaryTransformSumCum::from_sources_last_sum_raw::( name, v, source1.$p.sum.boxed_clone(), source1.$p.cumulative.boxed_clone(), @@ -268,7 +268,7 @@ where } Self { - dateindex: LazyTransform2SumCum::from_sum_cum_last_sum_raw::( + dateindex: LazyBinaryTransformSumCum::from_sum_cum_last_sum_raw::( name, v, &source1.dateindex, &source2.dateindex, ), weekindex: period!(weekindex), diff --git a/crates/brk_computer/src/internal/lazy/date/full.rs b/crates/brk_computer/src/internal/lazy/date/full.rs index 78a3a16c8..721b8eb48 100644 --- a/crates/brk_computer/src/internal/lazy/date/full.rs +++ b/crates/brk_computer/src/internal/lazy/date/full.rs @@ -5,7 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex, use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedVecValue, DerivedDateFull, Full}; +use crate::internal::{ComputedVecValue, LazyPeriodsFull, Full}; use super::super::transform::{LazyTransformFull, LazyTransformStats}; @@ -36,7 +36,7 @@ where name: &str, version: Version, dateindex: &Full, - source: &DerivedDateFull, + source: &LazyPeriodsFull, ) -> Self { let v = version + VERSION; diff --git a/crates/brk_computer/src/internal/lazy/date/last.rs b/crates/brk_computer/src/internal/lazy/date/last.rs index 85ffab409..da3988ae2 100644 --- a/crates/brk_computer/src/internal/lazy/date/last.rs +++ b/crates/brk_computer/src/internal/lazy/date/last.rs @@ -7,7 +7,7 @@ use brk_types::{ use schemars::JsonSchema; use vecdb::{IterableBoxedVec, IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedBlockLast, ComputedDateLast, ComputedVecValue, DerivedDateLast, NumericValue}; +use crate::internal::{ComputedBlockLast, ComputedDateLast, ComputedVecValue, LazyPeriodsLast, NumericValue}; use super::super::transform::LazyTransformLast; @@ -55,7 +55,7 @@ where name: &str, version: Version, dateindex_source: IterableBoxedVec, - source: &DerivedDateLast, + source: &LazyPeriodsLast, ) -> Self { let v = version + VERSION; diff --git a/crates/brk_computer/src/internal/lazy/date/sum.rs b/crates/brk_computer/src/internal/lazy/date/sum.rs index e92ba98e5..71686863d 100644 --- a/crates/brk_computer/src/internal/lazy/date/sum.rs +++ b/crates/brk_computer/src/internal/lazy/date/sum.rs @@ -5,7 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex, use schemars::JsonSchema; use vecdb::{IterableBoxedVec, IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedVecValue, DerivedDateSum}; +use crate::internal::{ComputedVecValue, LazyPeriodsSum}; use super::super::transform::LazyTransformSum; @@ -36,7 +36,7 @@ where name: &str, version: Version, dateindex_source: IterableBoxedVec, - source: &DerivedDateSum, + source: &LazyPeriodsSum, ) -> Self { let v = version + VERSION; diff --git a/crates/brk_computer/src/internal/lazy/date/sum_cum.rs b/crates/brk_computer/src/internal/lazy/date/sum_cum.rs index 18cd997ad..7819f69bc 100644 --- a/crates/brk_computer/src/internal/lazy/date/sum_cum.rs +++ b/crates/brk_computer/src/internal/lazy/date/sum_cum.rs @@ -5,7 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex, use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedVecValue, DerivedDateSumCum, SumCum}; +use crate::internal::{ComputedVecValue, LazyPeriodsSumCum, SumCum}; use super::super::transform::LazyTransformSumCum; @@ -36,7 +36,7 @@ where name: &str, version: Version, dateindex: &SumCum, - source: &DerivedDateSumCum, + source: &LazyPeriodsSumCum, ) -> Self { let v = version + VERSION; diff --git a/crates/brk_computer/src/internal/lazy/derived_block/binary_last.rs b/crates/brk_computer/src/internal/lazy/derived_block/binary_last.rs index 6d47d9814..8ad523175 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/binary_last.rs +++ b/crates/brk_computer/src/internal/lazy/derived_block/binary_last.rs @@ -8,12 +8,12 @@ use vecdb::{BinaryTransform, IterableCloneableVec}; use crate::internal::{ ComputedBlockLast, ComputedBlockSumCum, ComputedHeightDateLast, ComputedVecValue, - LazyBinaryDateLast, LazyTransform2Last, NumericValue, + LazyBinaryDateLast, LazyBinaryTransformLast, NumericValue, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct LazyDerivedBlock2Last +pub struct LazyBinaryDerivedBlockLast where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, @@ -22,12 +22,12 @@ where #[deref] #[deref_mut] pub dates: LazyBinaryDateLast, - pub difficultyepoch: LazyTransform2Last, + pub difficultyepoch: LazyBinaryTransformLast, } const VERSION: Version = Version::ZERO; -impl LazyDerivedBlock2Last +impl LazyBinaryDerivedBlockLast where T: ComputedVecValue + JsonSchema + 'static, S1T: ComputedVecValue + JsonSchema, @@ -54,7 +54,7 @@ where source2.dateindex.cumulative.boxed_clone(), &source2.dates, ), - difficultyepoch: LazyTransform2Last::from_vecs::( + difficultyepoch: LazyBinaryTransformLast::from_vecs::( name, v, source1.difficultyepoch.cumulative.boxed_clone(), @@ -77,7 +77,7 @@ where Self { dates: LazyBinaryDateLast::from_both_block_last::(name, v, source1, source2), - difficultyepoch: LazyTransform2Last::from_vecs::( + difficultyepoch: LazyBinaryTransformLast::from_vecs::( name, v, source1.difficultyepoch.boxed_clone(), @@ -105,7 +105,7 @@ where &source1.rest, &source2.rest, ), - difficultyepoch: LazyTransform2Last::from_vecs::( + difficultyepoch: LazyBinaryTransformLast::from_vecs::( name, v, source1.difficultyepoch.0.boxed_clone(), @@ -133,7 +133,7 @@ where &source1.rest, source2, ), - difficultyepoch: LazyTransform2Last::from_vecs::( + difficultyepoch: LazyBinaryTransformLast::from_vecs::( name, v, source1.difficultyepoch.0.boxed_clone(), diff --git a/crates/brk_computer/src/internal/lazy/derived_block/binary_sum.rs b/crates/brk_computer/src/internal/lazy/derived_block/binary_sum.rs index 10a2358f5..3374c1e48 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/binary_sum.rs +++ b/crates/brk_computer/src/internal/lazy/derived_block/binary_sum.rs @@ -6,13 +6,13 @@ use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableCloneableVec}; -use crate::internal::{ComputedVecValue, DerivedComputedBlockSum, LazyDate2Sum, LazyTransform2Sum, NumericValue}; +use crate::internal::{ComputedVecValue, ComputedDerivedBlockSum, LazyBinaryDateSum, LazyBinaryTransformSum, NumericValue}; const VERSION: Version = Version::ZERO; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct LazyDerivedBlock2Sum +pub struct LazyBinaryDerivedBlockSum where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, @@ -20,11 +20,11 @@ where { #[deref] #[deref_mut] - pub dates: LazyDate2Sum, - pub difficultyepoch: LazyTransform2Sum, + pub dates: LazyBinaryDateSum, + pub difficultyepoch: LazyBinaryTransformSum, } -impl LazyDerivedBlock2Sum +impl LazyBinaryDerivedBlockSum where T: ComputedVecValue + JsonSchema + 'static, S1T: NumericValue + JsonSchema, @@ -33,14 +33,14 @@ where pub fn from_derived>( name: &str, version: Version, - source1: &DerivedComputedBlockSum, - source2: &DerivedComputedBlockSum, + source1: &ComputedDerivedBlockSum, + source2: &ComputedDerivedBlockSum, ) -> Self { let v = version + VERSION; Self { - dates: LazyDate2Sum::from_derived::(name, v, source1, source2), - difficultyepoch: LazyTransform2Sum::from_boxed::( + dates: LazyBinaryDateSum::from_derived::(name, v, source1, source2), + difficultyepoch: LazyBinaryTransformSum::from_boxed::( name, v, source1.difficultyepoch.boxed_clone(), diff --git a/crates/brk_computer/src/internal/lazy/derived_block/binary_sum_cum.rs b/crates/brk_computer/src/internal/lazy/derived_block/binary_sum_cum.rs index 532eb2f02..36b970ad4 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/binary_sum_cum.rs +++ b/crates/brk_computer/src/internal/lazy/derived_block/binary_sum_cum.rs @@ -7,18 +7,18 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableCloneableVec}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, DerivedComputedBlockLast, - DerivedComputedBlockSumCum, DerivedDateFull, DerivedDateSumCum, LazyDate2SumCum, LazyFull, + ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast, + ComputedDerivedBlockSumCum, LazyPeriodsFull, LazyPeriodsSumCum, LazyBinaryDateSumCum, LazyFull, LazySumCum, NumericValue, SumCum, }; -use super::super::transform::LazyTransform2SumCum; +use super::super::transform::LazyBinaryTransformSumCum; const VERSION: Version = Version::ZERO; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct LazyDerivedBlock2SumCum +pub struct LazyBinaryDerivedBlockSumCum where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, @@ -26,11 +26,11 @@ where { #[deref] #[deref_mut] - pub dates: LazyDate2SumCum, - pub difficultyepoch: LazyTransform2SumCum, + pub dates: LazyBinaryDateSumCum, + pub difficultyepoch: LazyBinaryTransformSumCum, } -impl LazyDerivedBlock2SumCum +impl LazyBinaryDerivedBlockSumCum where T: ComputedVecValue + JsonSchema + 'static, S1T: ComputedVecValue + JsonSchema, @@ -41,19 +41,19 @@ where name: &str, version: Version, dateindex1: &SumCum, - periods1: &DerivedDateSumCum, + periods1: &LazyPeriodsSumCum, difficultyepoch1: &LazySumCum, dateindex2: &SumCum, - periods2: &DerivedDateSumCum, + periods2: &LazyPeriodsSumCum, difficultyepoch2: &LazySumCum, ) -> Self { let v = version + VERSION; Self { - dates: LazyDate2SumCum::from_computed::( + dates: LazyBinaryDateSumCum::from_computed::( name, v, dateindex1, periods1, dateindex2, periods2, ), - difficultyepoch: LazyTransform2SumCum::from_sources::( + difficultyepoch: LazyBinaryTransformSumCum::from_sources::( name, v, difficultyepoch1.sum.boxed_clone(), @@ -69,10 +69,10 @@ where name: &str, version: Version, dateindex1: &SumCum, - dates1: &DerivedDateFull, + dates1: &LazyPeriodsFull, difficultyepoch1: &LazyFull, dateindex2: &SumCum, - dates2: &DerivedDateFull, + dates2: &LazyPeriodsFull, difficultyepoch2: &LazyFull, ) -> Self where @@ -85,10 +85,10 @@ where let v = version + VERSION; Self { - dates: LazyDate2SumCum::from_derived_full::( + dates: LazyBinaryDateSumCum::from_derived_full::( name, v, dateindex1, dates1, dateindex2, dates2, ), - difficultyepoch: LazyTransform2SumCum::from_lazy_stats_aggregate::( + difficultyepoch: LazyBinaryTransformSumCum::from_lazy_stats_aggregate::( name, v, difficultyepoch1, @@ -103,19 +103,19 @@ where name: &str, version: Version, dateindex1: &SumCum, - periods1: &DerivedDateSumCum, + periods1: &LazyPeriodsSumCum, difficultyepoch1: &LazySumCum, dateindex2: &SumCum, - periods2: &DerivedDateSumCum, + periods2: &LazyPeriodsSumCum, difficultyepoch2: &LazySumCum, ) -> Self { let v = version + VERSION; Self { - dates: LazyDate2SumCum::from_computed_sum_raw::( + dates: LazyBinaryDateSumCum::from_computed_sum_raw::( name, v, dateindex1, periods1, dateindex2, periods2, ), - difficultyepoch: LazyTransform2SumCum::from_sources_sum_raw::( + difficultyepoch: LazyBinaryTransformSumCum::from_sources_sum_raw::( name, v, difficultyepoch1.sum.boxed_clone(), @@ -141,8 +141,8 @@ where let v = version + VERSION; Self { - dates: LazyDate2SumCum::from_computed_last::(name, v, source1, source2), - difficultyepoch: LazyTransform2SumCum::from_sources_last_sum_raw::( + dates: LazyBinaryDateSumCum::from_computed_last::(name, v, source1, source2), + difficultyepoch: LazyBinaryTransformSumCum::from_sources_last_sum_raw::( name, v, source1.difficultyepoch.sum.boxed_clone(), @@ -155,7 +155,7 @@ where pub fn from_derived_computed_last>( name: &str, version: Version, - source1: &DerivedComputedBlockSumCum, + source1: &ComputedDerivedBlockSumCum, source2: &ComputedBlockLast, ) -> Self where @@ -165,8 +165,8 @@ where let v = version + VERSION; Self { - dates: LazyDate2SumCum::from_derived_computed_last::(name, v, source1, source2), - difficultyepoch: LazyTransform2SumCum::from_sources_last_sum_raw::( + dates: LazyBinaryDateSumCum::from_derived_computed_last::(name, v, source1, source2), + difficultyepoch: LazyBinaryTransformSumCum::from_sources_last_sum_raw::( name, v, source1.difficultyepoch.sum.boxed_clone(), @@ -180,7 +180,7 @@ where name: &str, version: Version, source1: &ComputedBlockSumCum, - source2: &DerivedComputedBlockLast, + source2: &ComputedDerivedBlockLast, ) -> Self where S1T: PartialOrd, @@ -189,8 +189,8 @@ where let v = version + VERSION; Self { - dates: LazyDate2SumCum::from_computed_derived_last::(name, v, source1, source2), - difficultyepoch: LazyTransform2SumCum::from_sources_last_sum_raw::( + dates: LazyBinaryDateSumCum::from_computed_derived_last::(name, v, source1, source2), + difficultyepoch: LazyBinaryTransformSumCum::from_sources_last_sum_raw::( name, v, source1.difficultyepoch.sum.boxed_clone(), @@ -203,8 +203,8 @@ where pub fn from_derived_last>( name: &str, version: Version, - source1: &DerivedComputedBlockSumCum, - source2: &DerivedComputedBlockLast, + source1: &ComputedDerivedBlockSumCum, + source2: &ComputedDerivedBlockLast, ) -> Self where S1T: NumericValue, @@ -213,8 +213,8 @@ where let v = version + VERSION; Self { - dates: LazyDate2SumCum::from_derived_last::(name, v, source1, source2), - difficultyepoch: LazyTransform2SumCum::from_sources_last_sum_raw::( + dates: LazyBinaryDateSumCum::from_derived_last::(name, v, source1, source2), + difficultyepoch: LazyBinaryTransformSumCum::from_sources_last_sum_raw::( name, v, source1.difficultyepoch.sum.boxed_clone(), diff --git a/crates/brk_computer/src/internal/lazy/derived_block/full.rs b/crates/brk_computer/src/internal/lazy/derived_block/full.rs index faf1539e6..6615066cf 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/full.rs +++ b/crates/brk_computer/src/internal/lazy/derived_block/full.rs @@ -7,7 +7,7 @@ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; use crate::internal::{ - ComputedVecValue, DerivedComputedBlockFull, DerivedDateFull, Full, LazyDateFull, NumericValue, + ComputedVecValue, ComputedDerivedBlockFull, LazyPeriodsFull, Full, LazyDateFull, NumericValue, }; use super::super::transform::LazyTransformStats; @@ -36,7 +36,7 @@ where name: &str, version: Version, dateindex: &Full, - periods: &DerivedDateFull, + periods: &LazyPeriodsFull, difficultyepoch: &crate::internal::LazyFull< DifficultyEpoch, S1T, @@ -63,7 +63,7 @@ where pub fn from_derived_computed>( name: &str, version: Version, - source: &DerivedComputedBlockFull, + source: &ComputedDerivedBlockFull, ) -> Self where S1T: NumericValue, diff --git a/crates/brk_computer/src/internal/lazy/derived_block/last.rs b/crates/brk_computer/src/internal/lazy/derived_block/last.rs index ffb578275..1ddcf146e 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/last.rs +++ b/crates/brk_computer/src/internal/lazy/derived_block/last.rs @@ -7,7 +7,7 @@ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; use crate::internal::{ - ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, DerivedComputedBlockLast, + ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, ComputedDerivedBlockLast, LazyDateLast, NumericValue, }; @@ -61,7 +61,7 @@ where pub fn from_derived_computed>( name: &str, version: Version, - source: &DerivedComputedBlockLast, + source: &ComputedDerivedBlockLast, ) -> Self where S1T: NumericValue, diff --git a/crates/brk_computer/src/internal/lazy/derived_block/sum.rs b/crates/brk_computer/src/internal/lazy/derived_block/sum.rs index 4fdcde4cf..ad1e1152f 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/sum.rs +++ b/crates/brk_computer/src/internal/lazy/derived_block/sum.rs @@ -7,7 +7,7 @@ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; use crate::internal::{ - ComputedVecValue, DerivedComputedBlockSum, DerivedDateSum, LazyDateSum, LazySum, NumericValue, SumVec, + ComputedVecValue, ComputedDerivedBlockSum, LazyPeriodsSum, LazyDateSum, LazySum, NumericValue, SumVec, }; use super::super::transform::LazyTransformSum; @@ -36,7 +36,7 @@ where name: &str, version: Version, dateindex: &SumVec, - periods: &DerivedDateSum, + periods: &LazyPeriodsSum, difficultyepoch: &LazySum, ) -> Self { let v = version + VERSION; @@ -54,7 +54,7 @@ where pub fn from_derived_computed>( name: &str, version: Version, - source: &DerivedComputedBlockSum, + source: &ComputedDerivedBlockSum, ) -> Self where S1T: NumericValue, diff --git a/crates/brk_computer/src/internal/lazy/derived_block/sum_cum.rs b/crates/brk_computer/src/internal/lazy/derived_block/sum_cum.rs index cb2d36cfa..bb6d58289 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/sum_cum.rs +++ b/crates/brk_computer/src/internal/lazy/derived_block/sum_cum.rs @@ -7,7 +7,7 @@ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; use crate::internal::{ - ComputedVecValue, DerivedComputedBlockSumCum, DerivedDateSumCum, LazyDateSumCum, LazySumCum, + ComputedVecValue, ComputedDerivedBlockSumCum, LazyPeriodsSumCum, LazyDateSumCum, LazySumCum, NumericValue, SumCum, }; @@ -37,7 +37,7 @@ where name: &str, version: Version, dateindex: &SumCum, - periods: &DerivedDateSumCum, + periods: &LazyPeriodsSumCum, difficultyepoch: &LazySumCum, ) -> Self { let v = version + VERSION; @@ -56,7 +56,7 @@ where pub fn from_derived_computed>( name: &str, version: Version, - source: &DerivedComputedBlockSumCum, + source: &ComputedDerivedBlockSumCum, ) -> Self where S1T: NumericValue, diff --git a/crates/brk_computer/src/internal/lazy/transform/binary_last.rs b/crates/brk_computer/src/internal/lazy/transform/binary_last.rs index dbe2592bf..3efec0f74 100644 --- a/crates/brk_computer/src/internal/lazy/transform/binary_last.rs +++ b/crates/brk_computer/src/internal/lazy/transform/binary_last.rs @@ -10,14 +10,14 @@ use crate::internal::{ComputedVecValue, LazyLast}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(wrap = "last")] -pub struct LazyTransform2Last(pub LazyVecFrom2) +pub struct LazyBinaryTransformLast(pub LazyVecFrom2) where I: VecIndex, T: ComputedVecValue + JsonSchema, S1T: ComputedVecValue, S2T: ComputedVecValue; -impl LazyTransform2Last +impl LazyBinaryTransformLast where I: VecIndex, T: ComputedVecValue + JsonSchema + 'static, diff --git a/crates/brk_computer/src/internal/lazy/transform/binary_sum.rs b/crates/brk_computer/src/internal/lazy/transform/binary_sum.rs index c32284e31..aa6675aa9 100644 --- a/crates/brk_computer/src/internal/lazy/transform/binary_sum.rs +++ b/crates/brk_computer/src/internal/lazy/transform/binary_sum.rs @@ -12,14 +12,14 @@ const VERSION: Version = Version::ZERO; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(wrap = "sum")] -pub struct LazyTransform2Sum(pub LazyVecFrom2) +pub struct LazyBinaryTransformSum(pub LazyVecFrom2) where I: VecIndex, T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, S2T: ComputedVecValue; -impl LazyTransform2Sum +impl LazyBinaryTransformSum where I: VecIndex, T: ComputedVecValue + JsonSchema + 'static, diff --git a/crates/brk_computer/src/internal/lazy/transform/binary_sum_cum.rs b/crates/brk_computer/src/internal/lazy/transform/binary_sum_cum.rs index 48a1beb86..f3c1a28c2 100644 --- a/crates/brk_computer/src/internal/lazy/transform/binary_sum_cum.rs +++ b/crates/brk_computer/src/internal/lazy/transform/binary_sum_cum.rs @@ -10,7 +10,7 @@ use vecdb::{ use crate::internal::{ComputedVecValue, LazyFull, LastVec, SumCum}; #[derive(Clone, Traversable)] -pub struct LazyTransform2SumCum +pub struct LazyBinaryTransformSumCum where I: VecIndex, T: ComputedVecValue + JsonSchema, @@ -21,7 +21,7 @@ where pub cumulative: LazyVecFrom2, } -impl LazyTransform2SumCum +impl LazyBinaryTransformSumCum where I: VecIndex, T: ComputedVecValue + JsonSchema + 'static, diff --git a/crates/brk_computer/src/internal/specialized/value/date/derived_last.rs b/crates/brk_computer/src/internal/specialized/value/date/derived_last.rs index 5a5857257..c47131764 100644 --- a/crates/brk_computer/src/internal/specialized/value/date/derived_last.rs +++ b/crates/brk_computer/src/internal/specialized/value/date/derived_last.rs @@ -7,22 +7,22 @@ use vecdb::{Database, Exit, IterableBoxedVec}; use crate::{ ComputeIndexes, indexes, - internal::{ComputedDateLast, DerivedDateLast, LazyDateLast, SatsToBitcoin}, + internal::{ComputedDateLast, LazyPeriodsLast, LazyDateLast, SatsToBitcoin}, price, traits::ComputeFromBitcoin, utils::OptionExt, }; #[derive(Clone, Traversable)] -pub struct ValueDerivedDateLast { - pub sats: DerivedDateLast, +pub struct ValueLazyPeriodsLast { + pub sats: LazyPeriodsLast, pub bitcoin: LazyDateLast, pub dollars: Option>, } const VERSION: Version = Version::ZERO; -impl ValueDerivedDateLast { +impl ValueLazyPeriodsLast { pub fn from_source( db: &Database, name: &str, @@ -31,7 +31,7 @@ impl ValueDerivedDateLast { compute_dollars: bool, indexes: &indexes::Vecs, ) -> Result { - let sats = DerivedDateLast::from_source(name, version + VERSION, source.clone(), indexes); + let sats = LazyPeriodsLast::from_source(name, version + VERSION, source.clone(), indexes); let bitcoin = LazyDateLast::from_derived::( &format!("{name}_btc"), diff --git a/crates/brk_computer/src/internal/specialized/value/date/last.rs b/crates/brk_computer/src/internal/specialized/value/date/last.rs index c807737bc..2e55eadfe 100644 --- a/crates/brk_computer/src/internal/specialized/value/date/last.rs +++ b/crates/brk_computer/src/internal/specialized/value/date/last.rs @@ -8,7 +8,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes, price}; -use super::ValueDerivedDateLast; +use super::ValueLazyPeriodsLast; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] @@ -17,7 +17,7 @@ pub struct ValueDateLast { pub sats_dateindex: EagerVec>, #[deref] #[deref_mut] - pub rest: ValueDerivedDateLast, + pub rest: ValueLazyPeriodsLast, } const VERSION: Version = Version::ZERO; @@ -32,7 +32,7 @@ impl ValueDateLast { ) -> Result { let sats_dateindex = EagerVec::forced_import(db, name, version + VERSION)?; - let rest = ValueDerivedDateLast::from_source( + let rest = ValueLazyPeriodsLast::from_source( db, name, sats_dateindex.boxed_clone(), diff --git a/crates/brk_computer/src/internal/specialized/value/derived_block/sum_cum.rs b/crates/brk_computer/src/internal/specialized/value/derived_block/sum_cum.rs index fe8900235..ef09c1932 100644 --- a/crates/brk_computer/src/internal/specialized/value/derived_block/sum_cum.rs +++ b/crates/brk_computer/src/internal/specialized/value/derived_block/sum_cum.rs @@ -8,7 +8,7 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec, use crate::{ ComputeIndexes, indexes, internal::{ - ClosePriceTimesSats, DerivedComputedBlockSumCum, LazyBlockSumCum, LazyComputedBlockSumCum, + ClosePriceTimesSats, ComputedDerivedBlockSumCum, LazyBlockSumCum, LazyComputedBlockSumCum, SatsToBitcoin, }, price, @@ -17,7 +17,7 @@ use crate::{ /// Value wrapper for derived SumCum (derives from external height source). #[derive(Clone, Traversable)] pub struct DerivedValueBlockSumCum { - pub sats: DerivedComputedBlockSumCum, + pub sats: ComputedDerivedBlockSumCum, pub bitcoin: LazyBlockSumCum, pub dollars: Option, Sats>>, } @@ -35,7 +35,7 @@ impl DerivedValueBlockSumCum { ) -> Result { let v = version + VERSION; - let sats = DerivedComputedBlockSumCum::forced_import( + let sats = ComputedDerivedBlockSumCum::forced_import( db, name, sats_source.boxed_clone(), diff --git a/crates/brk_computer/src/internal/specialized/value/tx/dollars.rs b/crates/brk_computer/src/internal/specialized/value/tx/dollars.rs index 4aa8527dd..8465295b1 100644 --- a/crates/brk_computer/src/internal/specialized/value/tx/dollars.rs +++ b/crates/brk_computer/src/internal/specialized/value/tx/dollars.rs @@ -11,7 +11,7 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, LazyVecFrom3 use crate::{ ComputeIndexes, indexes, - internal::{DerivedDateFull, Full, LazyFull, Stats}, + internal::{LazyPeriodsFull, Full, LazyFull, Stats}, }; /// Lazy dollars at TxIndex: `sats * price[height]` @@ -29,7 +29,7 @@ pub struct DollarsTxFull { pub dateindex: Stats, #[deref] #[deref_mut] - pub dates: DerivedDateFull, + pub dates: LazyPeriodsFull, } const VERSION: Version = Version::ZERO; @@ -63,7 +63,7 @@ impl DollarsTxFull { indexes.difficultyepoch.identity.boxed_clone(), ); - let dates = DerivedDateFull::from_sources( + let dates = LazyPeriodsFull::from_sources( name, v, dateindex.average.0.boxed_clone(), diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index e29891e00..22df26370 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -517,12 +517,13 @@ * @property {number} [timeout] - Request timeout in milliseconds */ -const _isBrowser = typeof window !== 'undefined' && 'caches' in window; -const _runIdle = (/** @type {VoidFunction} */ fn) => (globalThis.requestIdleCallback ?? setTimeout)(fn); +const _isBrowser = typeof window !== "undefined" && "caches" in window; +const _runIdle = (/** @type {VoidFunction} */ fn) => + (globalThis.requestIdleCallback ?? setTimeout)(fn); /** @type {Promise} */ const _cachePromise = _isBrowser - ? caches.open('__BRK_CLIENT__').catch(() => null) + ? caches.open("__BRK_CLIENT__").catch(() => null) : Promise.resolve(null); /** @@ -535,7 +536,7 @@ class BrkError extends Error { */ constructor(message, status) { super(message); - this.name = 'BrkError'; + this.name = "BrkError"; this.status = status; } } @@ -584,12 +585,14 @@ function _endpoint(client, name, index) { get: (onUpdate) => client.get(p, onUpdate), range: (from, to, onUpdate) => { const params = new URLSearchParams(); - if (from !== undefined) params.set('from', String(from)); - if (to !== undefined) params.set('to', String(to)); + if (from !== undefined) params.set("from", String(from)); + if (to !== undefined) params.set("to", String(to)); const query = params.toString(); return client.get(query ? `${p}?${query}` : p, onUpdate); }, - get path() { return p; }, + get path() { + return p; + }, }; } @@ -601,7 +604,7 @@ class BrkClientBase { * @param {BrkClientOptions|string} options */ constructor(options) { - const isString = typeof options === 'string'; + const isString = typeof options === "string"; this.baseUrl = isString ? options : options.baseUrl; this.timeout = isString ? 5000 : (options.timeout ?? 5000); } @@ -614,7 +617,9 @@ class BrkClientBase { * @returns {Promise} */ async get(path, onUpdate) { - const base = this.baseUrl.endsWith('/') ? this.baseUrl.slice(0, -1) : this.baseUrl; + const base = this.baseUrl.endsWith("/") + ? this.baseUrl.slice(0, -1) + : this.baseUrl; const url = `${base}${path}`; const cache = await _cachePromise; const cachedRes = await cache?.match(url); @@ -623,13 +628,16 @@ class BrkClientBase { if (cachedJson) onUpdate?.(cachedJson); if (!globalThis.navigator?.onLine) { if (cachedJson) return cachedJson; - throw new BrkError('Offline and no cached data available'); + throw new BrkError("Offline and no cached data available"); } try { - const res = await fetch(url, { signal: AbortSignal.timeout(this.timeout) }); + const res = await fetch(url, { + signal: AbortSignal.timeout(this.timeout), + }); if (!res.ok) throw new BrkError(`HTTP ${res.status}`, res.status); - if (cachedRes?.headers.get('ETag') === res.headers.get('ETag')) return cachedJson; + if (cachedRes?.headers.get("ETag") === res.headers.get("ETag")) + return cachedJson; const cloned = res.clone(); const json = await res.json(); @@ -649,8 +657,7 @@ class BrkClientBase { * @param {string} s - Metric suffix * @returns {string} */ -const _m = (acc, s) => acc ? `${acc}_${s}` : s; - +const _m = (acc, s) => (acc ? `${acc}_${s}` : s); // Index accessor factory functions @@ -670,24 +677,52 @@ function createMetricPattern1(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get difficultyepoch() { return _endpoint(client, name, 'difficultyepoch'); }, - get height() { return _endpoint(client, name, 'height'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get difficultyepoch() { + return _endpoint(client, name, "difficultyepoch"); + }, + get height() { + return _endpoint(client, name, "height"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['dateindex', 'decadeindex', 'difficultyepoch', 'height', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "dateindex", + "decadeindex", + "difficultyepoch", + "height", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -707,23 +742,48 @@ function createMetricPattern2(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get difficultyepoch() { return _endpoint(client, name, 'difficultyepoch'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get difficultyepoch() { + return _endpoint(client, name, "difficultyepoch"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['dateindex', 'decadeindex', 'difficultyepoch', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "dateindex", + "decadeindex", + "difficultyepoch", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -743,23 +803,48 @@ function createMetricPattern3(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get height() { return _endpoint(client, name, 'height'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get height() { + return _endpoint(client, name, "height"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['dateindex', 'decadeindex', 'height', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "dateindex", + "decadeindex", + "height", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -779,22 +864,44 @@ function createMetricPattern4(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['dateindex', 'decadeindex', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "dateindex", + "decadeindex", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -814,21 +921,40 @@ function createMetricPattern5(client, name) { return { name, by: { - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['decadeindex', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "decadeindex", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -848,17 +974,21 @@ function createMetricPattern6(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get height() { return _endpoint(client, name, 'height'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get height() { + return _endpoint(client, name, "height"); + }, }, indexes() { - return ['dateindex', 'height']; + return ["dateindex", "height"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -878,16 +1008,18 @@ function createMetricPattern7(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, }, indexes() { - return ['dateindex']; + return ["dateindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -907,16 +1039,18 @@ function createMetricPattern8(client, name) { return { name, by: { - get decadeindex() { return _endpoint(client, name, 'decadeindex'); } + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, }, indexes() { - return ['decadeindex']; + return ["decadeindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -936,16 +1070,18 @@ function createMetricPattern9(client, name) { return { name, by: { - get difficultyepoch() { return _endpoint(client, name, 'difficultyepoch'); } + get difficultyepoch() { + return _endpoint(client, name, "difficultyepoch"); + }, }, indexes() { - return ['difficultyepoch']; + return ["difficultyepoch"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -965,16 +1101,18 @@ function createMetricPattern10(client, name) { return { name, by: { - get emptyoutputindex() { return _endpoint(client, name, 'emptyoutputindex'); } + get emptyoutputindex() { + return _endpoint(client, name, "emptyoutputindex"); + }, }, indexes() { - return ['emptyoutputindex']; + return ["emptyoutputindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -994,16 +1132,18 @@ function createMetricPattern11(client, name) { return { name, by: { - get halvingepoch() { return _endpoint(client, name, 'halvingepoch'); } + get halvingepoch() { + return _endpoint(client, name, "halvingepoch"); + }, }, indexes() { - return ['halvingepoch']; + return ["halvingepoch"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1023,16 +1163,18 @@ function createMetricPattern12(client, name) { return { name, by: { - get height() { return _endpoint(client, name, 'height'); } + get height() { + return _endpoint(client, name, "height"); + }, }, indexes() { - return ['height']; + return ["height"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1052,16 +1194,18 @@ function createMetricPattern13(client, name) { return { name, by: { - get txinindex() { return _endpoint(client, name, 'txinindex'); } + get txinindex() { + return _endpoint(client, name, "txinindex"); + }, }, indexes() { - return ['txinindex']; + return ["txinindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1081,16 +1225,18 @@ function createMetricPattern14(client, name) { return { name, by: { - get monthindex() { return _endpoint(client, name, 'monthindex'); } + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, }, indexes() { - return ['monthindex']; + return ["monthindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1110,16 +1256,18 @@ function createMetricPattern15(client, name) { return { name, by: { - get opreturnindex() { return _endpoint(client, name, 'opreturnindex'); } + get opreturnindex() { + return _endpoint(client, name, "opreturnindex"); + }, }, indexes() { - return ['opreturnindex']; + return ["opreturnindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1139,16 +1287,18 @@ function createMetricPattern16(client, name) { return { name, by: { - get txoutindex() { return _endpoint(client, name, 'txoutindex'); } + get txoutindex() { + return _endpoint(client, name, "txoutindex"); + }, }, indexes() { - return ['txoutindex']; + return ["txoutindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1168,16 +1318,18 @@ function createMetricPattern17(client, name) { return { name, by: { - get p2aaddressindex() { return _endpoint(client, name, 'p2aaddressindex'); } + get p2aaddressindex() { + return _endpoint(client, name, "p2aaddressindex"); + }, }, indexes() { - return ['p2aaddressindex']; + return ["p2aaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1197,16 +1349,18 @@ function createMetricPattern18(client, name) { return { name, by: { - get p2msoutputindex() { return _endpoint(client, name, 'p2msoutputindex'); } + get p2msoutputindex() { + return _endpoint(client, name, "p2msoutputindex"); + }, }, indexes() { - return ['p2msoutputindex']; + return ["p2msoutputindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1226,16 +1380,18 @@ function createMetricPattern19(client, name) { return { name, by: { - get p2pk33addressindex() { return _endpoint(client, name, 'p2pk33addressindex'); } + get p2pk33addressindex() { + return _endpoint(client, name, "p2pk33addressindex"); + }, }, indexes() { - return ['p2pk33addressindex']; + return ["p2pk33addressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1255,16 +1411,18 @@ function createMetricPattern20(client, name) { return { name, by: { - get p2pk65addressindex() { return _endpoint(client, name, 'p2pk65addressindex'); } + get p2pk65addressindex() { + return _endpoint(client, name, "p2pk65addressindex"); + }, }, indexes() { - return ['p2pk65addressindex']; + return ["p2pk65addressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1284,16 +1442,18 @@ function createMetricPattern21(client, name) { return { name, by: { - get p2pkhaddressindex() { return _endpoint(client, name, 'p2pkhaddressindex'); } + get p2pkhaddressindex() { + return _endpoint(client, name, "p2pkhaddressindex"); + }, }, indexes() { - return ['p2pkhaddressindex']; + return ["p2pkhaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1313,16 +1473,18 @@ function createMetricPattern22(client, name) { return { name, by: { - get p2shaddressindex() { return _endpoint(client, name, 'p2shaddressindex'); } + get p2shaddressindex() { + return _endpoint(client, name, "p2shaddressindex"); + }, }, indexes() { - return ['p2shaddressindex']; + return ["p2shaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1342,16 +1504,18 @@ function createMetricPattern23(client, name) { return { name, by: { - get p2traddressindex() { return _endpoint(client, name, 'p2traddressindex'); } + get p2traddressindex() { + return _endpoint(client, name, "p2traddressindex"); + }, }, indexes() { - return ['p2traddressindex']; + return ["p2traddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1371,16 +1535,18 @@ function createMetricPattern24(client, name) { return { name, by: { - get p2wpkhaddressindex() { return _endpoint(client, name, 'p2wpkhaddressindex'); } + get p2wpkhaddressindex() { + return _endpoint(client, name, "p2wpkhaddressindex"); + }, }, indexes() { - return ['p2wpkhaddressindex']; + return ["p2wpkhaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1400,16 +1566,18 @@ function createMetricPattern25(client, name) { return { name, by: { - get p2wshaddressindex() { return _endpoint(client, name, 'p2wshaddressindex'); } + get p2wshaddressindex() { + return _endpoint(client, name, "p2wshaddressindex"); + }, }, indexes() { - return ['p2wshaddressindex']; + return ["p2wshaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1429,16 +1597,18 @@ function createMetricPattern26(client, name) { return { name, by: { - get quarterindex() { return _endpoint(client, name, 'quarterindex'); } + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, }, indexes() { - return ['quarterindex']; + return ["quarterindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1458,16 +1628,18 @@ function createMetricPattern27(client, name) { return { name, by: { - get semesterindex() { return _endpoint(client, name, 'semesterindex'); } + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, }, indexes() { - return ['semesterindex']; + return ["semesterindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1487,16 +1659,18 @@ function createMetricPattern28(client, name) { return { name, by: { - get txindex() { return _endpoint(client, name, 'txindex'); } + get txindex() { + return _endpoint(client, name, "txindex"); + }, }, indexes() { - return ['txindex']; + return ["txindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1516,16 +1690,18 @@ function createMetricPattern29(client, name) { return { name, by: { - get unknownoutputindex() { return _endpoint(client, name, 'unknownoutputindex'); } + get unknownoutputindex() { + return _endpoint(client, name, "unknownoutputindex"); + }, }, indexes() { - return ['unknownoutputindex']; + return ["unknownoutputindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1545,16 +1721,18 @@ function createMetricPattern30(client, name) { return { name, by: { - get weekindex() { return _endpoint(client, name, 'weekindex'); } + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, }, indexes() { - return ['weekindex']; + return ["weekindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1574,16 +1752,18 @@ function createMetricPattern31(client, name) { return { name, by: { - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['yearindex']; + return ["yearindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1603,16 +1783,18 @@ function createMetricPattern32(client, name) { return { name, by: { - get loadedaddressindex() { return _endpoint(client, name, 'loadedaddressindex'); } + get loadedaddressindex() { + return _endpoint(client, name, "loadedaddressindex"); + }, }, indexes() { - return ['loadedaddressindex']; + return ["loadedaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1632,16 +1814,18 @@ function createMetricPattern33(client, name) { return { name, by: { - get emptyaddressindex() { return _endpoint(client, name, 'emptyaddressindex'); } + get emptyaddressindex() { + return _endpoint(client, name, "emptyaddressindex"); + }, }, indexes() { - return ['emptyaddressindex']; + return ["emptyaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1691,38 +1875,98 @@ function createMetricPattern33(client, name) { */ function createRealizedPattern3(client, acc) { return { - 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')), - negRealizedLoss: createBlockCountPattern(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createBlockCountPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlCumulative30dDelta: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), - netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), - netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern4(client, _m(acc, 'realized_cap_30d_delta')), - realizedCapRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), - realizedLoss: createBlockCountPattern(client, _m(acc, 'realized_loss')), - realizedLossRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createMetricPattern1(client, _m(acc, 'realized_price')), - 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: createMetricPattern7(client, _m(acc, 'realized_profit_to_loss_ratio')), - realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - 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')), + 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")), + negRealizedLoss: createBlockCountPattern( + client, + _m(acc, "neg_realized_loss"), + ), + netRealizedPnl: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl"), + ), + netRealizedPnlCumulative30dDelta: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta"), + ), + netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap"), + ), + netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap"), + ), + netRealizedPnlRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl_rel_to_realized_cap"), + ), + realizedCap: createMetricPattern1(client, _m(acc, "realized_cap")), + realizedCap30dDelta: createMetricPattern4( + client, + _m(acc, "realized_cap_30d_delta"), + ), + realizedCapRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "realized_cap_rel_to_own_market_cap"), + ), + realizedLoss: createBlockCountPattern(client, _m(acc, "realized_loss")), + realizedLossRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_loss_rel_to_realized_cap"), + ), + realizedPrice: createMetricPattern1(client, _m(acc, "realized_price")), + 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: createMetricPattern7( + client, + _m(acc, "realized_profit_to_loss_ratio"), + ), + realizedValue: createMetricPattern1(client, _m(acc, "realized_value")), + 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")), }; } @@ -1768,36 +2012,90 @@ function createRealizedPattern3(client, acc) { */ function createRealizedPattern4(client, acc) { return { - 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')), - negRealizedLoss: createBlockCountPattern(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createBlockCountPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlCumulative30dDelta: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), - netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), - netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern4(client, _m(acc, 'realized_cap_30d_delta')), - realizedLoss: createBlockCountPattern(client, _m(acc, 'realized_loss')), - realizedLossRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createMetricPattern1(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRealizedPriceExtraPattern(client, _m(acc, 'realized_price')), - 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: 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')), + 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")), + negRealizedLoss: createBlockCountPattern( + client, + _m(acc, "neg_realized_loss"), + ), + netRealizedPnl: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl"), + ), + netRealizedPnlCumulative30dDelta: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta"), + ), + netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap"), + ), + netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap"), + ), + netRealizedPnlRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl_rel_to_realized_cap"), + ), + realizedCap: createMetricPattern1(client, _m(acc, "realized_cap")), + realizedCap30dDelta: createMetricPattern4( + client, + _m(acc, "realized_cap_30d_delta"), + ), + realizedLoss: createBlockCountPattern(client, _m(acc, "realized_loss")), + realizedLossRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_loss_rel_to_realized_cap"), + ), + realizedPrice: createMetricPattern1(client, _m(acc, "realized_price")), + realizedPriceExtra: createRealizedPriceExtraPattern( + client, + _m(acc, "realized_price"), + ), + 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: 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")), }; } @@ -1841,34 +2139,34 @@ function createRealizedPattern4(client, acc) { */ function createRatio1ySdPattern(client, acc) { return { - _0sdUsd: createMetricPattern4(client, _m(acc, '0sd_usd')), - m05sd: createMetricPattern4(client, _m(acc, 'm0_5sd')), - m05sdUsd: createMetricPattern4(client, _m(acc, 'm0_5sd_usd')), - m15sd: createMetricPattern4(client, _m(acc, 'm1_5sd')), - m15sdUsd: createMetricPattern4(client, _m(acc, 'm1_5sd_usd')), - m1sd: createMetricPattern4(client, _m(acc, 'm1sd')), - m1sdUsd: createMetricPattern4(client, _m(acc, 'm1sd_usd')), - m25sd: createMetricPattern4(client, _m(acc, 'm2_5sd')), - m25sdUsd: createMetricPattern4(client, _m(acc, 'm2_5sd_usd')), - m2sd: createMetricPattern4(client, _m(acc, 'm2sd')), - m2sdUsd: createMetricPattern4(client, _m(acc, 'm2sd_usd')), - m3sd: createMetricPattern4(client, _m(acc, 'm3sd')), - m3sdUsd: createMetricPattern4(client, _m(acc, 'm3sd_usd')), - p05sd: createMetricPattern4(client, _m(acc, 'p0_5sd')), - p05sdUsd: createMetricPattern4(client, _m(acc, 'p0_5sd_usd')), - p15sd: createMetricPattern4(client, _m(acc, 'p1_5sd')), - p15sdUsd: createMetricPattern4(client, _m(acc, 'p1_5sd_usd')), - p1sd: createMetricPattern4(client, _m(acc, 'p1sd')), - p1sdUsd: createMetricPattern4(client, _m(acc, 'p1sd_usd')), - p25sd: createMetricPattern4(client, _m(acc, 'p2_5sd')), - p25sdUsd: createMetricPattern4(client, _m(acc, 'p2_5sd_usd')), - p2sd: createMetricPattern4(client, _m(acc, 'p2sd')), - p2sdUsd: createMetricPattern4(client, _m(acc, 'p2sd_usd')), - p3sd: createMetricPattern4(client, _m(acc, 'p3sd')), - p3sdUsd: createMetricPattern4(client, _m(acc, 'p3sd_usd')), - sd: createMetricPattern4(client, _m(acc, 'sd')), - sma: createMetricPattern4(client, _m(acc, 'sma')), - zscore: createMetricPattern4(client, _m(acc, 'zscore')), + _0sdUsd: createMetricPattern4(client, _m(acc, "0sd_usd")), + m05sd: createMetricPattern4(client, _m(acc, "m0_5sd")), + m05sdUsd: createMetricPattern4(client, _m(acc, "m0_5sd_usd")), + m15sd: createMetricPattern4(client, _m(acc, "m1_5sd")), + m15sdUsd: createMetricPattern4(client, _m(acc, "m1_5sd_usd")), + m1sd: createMetricPattern4(client, _m(acc, "m1sd")), + m1sdUsd: createMetricPattern4(client, _m(acc, "m1sd_usd")), + m25sd: createMetricPattern4(client, _m(acc, "m2_5sd")), + m25sdUsd: createMetricPattern4(client, _m(acc, "m2_5sd_usd")), + m2sd: createMetricPattern4(client, _m(acc, "m2sd")), + m2sdUsd: createMetricPattern4(client, _m(acc, "m2sd_usd")), + m3sd: createMetricPattern4(client, _m(acc, "m3sd")), + m3sdUsd: createMetricPattern4(client, _m(acc, "m3sd_usd")), + p05sd: createMetricPattern4(client, _m(acc, "p0_5sd")), + p05sdUsd: createMetricPattern4(client, _m(acc, "p0_5sd_usd")), + p15sd: createMetricPattern4(client, _m(acc, "p1_5sd")), + p15sdUsd: createMetricPattern4(client, _m(acc, "p1_5sd_usd")), + p1sd: createMetricPattern4(client, _m(acc, "p1sd")), + p1sdUsd: createMetricPattern4(client, _m(acc, "p1sd_usd")), + p25sd: createMetricPattern4(client, _m(acc, "p2_5sd")), + p25sdUsd: createMetricPattern4(client, _m(acc, "p2_5sd_usd")), + p2sd: createMetricPattern4(client, _m(acc, "p2sd")), + p2sdUsd: createMetricPattern4(client, _m(acc, "p2sd_usd")), + p3sd: createMetricPattern4(client, _m(acc, "p3sd")), + p3sdUsd: createMetricPattern4(client, _m(acc, "p3sd_usd")), + sd: createMetricPattern4(client, _m(acc, "sd")), + sma: createMetricPattern4(client, _m(acc, "sma")), + zscore: createMetricPattern4(client, _m(acc, "zscore")), }; } @@ -1911,33 +2209,81 @@ function createRatio1ySdPattern(client, acc) { */ function createRealizedPattern2(client, acc) { return { - mvrv: createMetricPattern4(client, _m(acc, 'mvrv')), - negRealizedLoss: createBlockCountPattern(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createBlockCountPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlCumulative30dDelta: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), - netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), - netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern4(client, _m(acc, 'realized_cap_30d_delta')), - realizedCapRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), - realizedLoss: createBlockCountPattern(client, _m(acc, 'realized_loss')), - realizedLossRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createMetricPattern1(client, _m(acc, 'realized_price')), - 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: createMetricPattern7(client, _m(acc, 'realized_profit_to_loss_ratio')), - realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - 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')), + mvrv: createMetricPattern4(client, _m(acc, "mvrv")), + negRealizedLoss: createBlockCountPattern( + client, + _m(acc, "neg_realized_loss"), + ), + netRealizedPnl: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl"), + ), + netRealizedPnlCumulative30dDelta: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta"), + ), + netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap"), + ), + netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap"), + ), + netRealizedPnlRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl_rel_to_realized_cap"), + ), + realizedCap: createMetricPattern1(client, _m(acc, "realized_cap")), + realizedCap30dDelta: createMetricPattern4( + client, + _m(acc, "realized_cap_30d_delta"), + ), + realizedCapRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "realized_cap_rel_to_own_market_cap"), + ), + realizedLoss: createBlockCountPattern(client, _m(acc, "realized_loss")), + realizedLossRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_loss_rel_to_realized_cap"), + ), + realizedPrice: createMetricPattern1(client, _m(acc, "realized_price")), + 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: createMetricPattern7( + client, + _m(acc, "realized_profit_to_loss_ratio"), + ), + realizedValue: createMetricPattern1(client, _m(acc, "realized_value")), + 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")), }; } @@ -1978,31 +2324,73 @@ function createRealizedPattern2(client, acc) { */ function createRealizedPattern(client, acc) { return { - mvrv: createMetricPattern4(client, _m(acc, 'mvrv')), - negRealizedLoss: createBlockCountPattern(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createBlockCountPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlCumulative30dDelta: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), - netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), - netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern4(client, _m(acc, 'realized_cap_30d_delta')), - realizedLoss: createBlockCountPattern(client, _m(acc, 'realized_loss')), - realizedLossRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createMetricPattern1(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRealizedPriceExtraPattern(client, _m(acc, 'realized_price')), - 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: 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')), + mvrv: createMetricPattern4(client, _m(acc, "mvrv")), + negRealizedLoss: createBlockCountPattern( + client, + _m(acc, "neg_realized_loss"), + ), + netRealizedPnl: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl"), + ), + netRealizedPnlCumulative30dDelta: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta"), + ), + netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap"), + ), + netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap"), + ), + netRealizedPnlRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl_rel_to_realized_cap"), + ), + realizedCap: createMetricPattern1(client, _m(acc, "realized_cap")), + realizedCap30dDelta: createMetricPattern4( + client, + _m(acc, "realized_cap_30d_delta"), + ), + realizedLoss: createBlockCountPattern(client, _m(acc, "realized_loss")), + realizedLossRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_loss_rel_to_realized_cap"), + ), + realizedPrice: createMetricPattern1(client, _m(acc, "realized_price")), + realizedPriceExtra: createRealizedPriceExtraPattern( + client, + _m(acc, "realized_price"), + ), + 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: 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")), }; } @@ -2039,25 +2427,25 @@ function createRealizedPattern(client, acc) { function createPrice111dSmaPattern(client, acc) { return { price: createMetricPattern4(client, acc), - ratio: createMetricPattern4(client, _m(acc, 'ratio')), - ratio1mSma: createMetricPattern4(client, _m(acc, 'ratio_1m_sma')), - ratio1wSma: createMetricPattern4(client, _m(acc, 'ratio_1w_sma')), - ratio1ySd: createRatio1ySdPattern(client, _m(acc, 'ratio_1y')), - ratio2ySd: createRatio1ySdPattern(client, _m(acc, 'ratio_2y')), - ratio4ySd: createRatio1ySdPattern(client, _m(acc, 'ratio_4y')), - ratioPct1: createMetricPattern4(client, _m(acc, 'ratio_pct1')), - ratioPct1Usd: createMetricPattern4(client, _m(acc, 'ratio_pct1_usd')), - ratioPct2: createMetricPattern4(client, _m(acc, 'ratio_pct2')), - ratioPct2Usd: createMetricPattern4(client, _m(acc, 'ratio_pct2_usd')), - ratioPct5: createMetricPattern4(client, _m(acc, 'ratio_pct5')), - ratioPct5Usd: createMetricPattern4(client, _m(acc, 'ratio_pct5_usd')), - ratioPct95: createMetricPattern4(client, _m(acc, 'ratio_pct95')), - ratioPct95Usd: createMetricPattern4(client, _m(acc, 'ratio_pct95_usd')), - ratioPct98: createMetricPattern4(client, _m(acc, 'ratio_pct98')), - ratioPct98Usd: createMetricPattern4(client, _m(acc, 'ratio_pct98_usd')), - ratioPct99: createMetricPattern4(client, _m(acc, 'ratio_pct99')), - ratioPct99Usd: createMetricPattern4(client, _m(acc, 'ratio_pct99_usd')), - ratioSd: createRatio1ySdPattern(client, _m(acc, 'ratio')), + ratio: createMetricPattern4(client, _m(acc, "ratio")), + ratio1mSma: createMetricPattern4(client, _m(acc, "ratio_1m_sma")), + ratio1wSma: createMetricPattern4(client, _m(acc, "ratio_1w_sma")), + ratio1ySd: createRatio1ySdPattern(client, _m(acc, "ratio_1y")), + ratio2ySd: createRatio1ySdPattern(client, _m(acc, "ratio_2y")), + ratio4ySd: createRatio1ySdPattern(client, _m(acc, "ratio_4y")), + ratioPct1: createMetricPattern4(client, _m(acc, "ratio_pct1")), + ratioPct1Usd: createMetricPattern4(client, _m(acc, "ratio_pct1_usd")), + ratioPct2: createMetricPattern4(client, _m(acc, "ratio_pct2")), + ratioPct2Usd: createMetricPattern4(client, _m(acc, "ratio_pct2_usd")), + ratioPct5: createMetricPattern4(client, _m(acc, "ratio_pct5")), + ratioPct5Usd: createMetricPattern4(client, _m(acc, "ratio_pct5_usd")), + ratioPct95: createMetricPattern4(client, _m(acc, "ratio_pct95")), + ratioPct95Usd: createMetricPattern4(client, _m(acc, "ratio_pct95_usd")), + ratioPct98: createMetricPattern4(client, _m(acc, "ratio_pct98")), + ratioPct98Usd: createMetricPattern4(client, _m(acc, "ratio_pct98_usd")), + ratioPct99: createMetricPattern4(client, _m(acc, "ratio_pct99")), + ratioPct99Usd: createMetricPattern4(client, _m(acc, "ratio_pct99_usd")), + ratioSd: createRatio1ySdPattern(client, _m(acc, "ratio")), }; } @@ -2093,23 +2481,23 @@ function createPrice111dSmaPattern(client, acc) { function createActivePriceRatioPattern(client, acc) { return { ratio: createMetricPattern4(client, acc), - ratio1mSma: createMetricPattern4(client, _m(acc, '1m_sma')), - ratio1wSma: createMetricPattern4(client, _m(acc, '1w_sma')), - ratio1ySd: createRatio1ySdPattern(client, _m(acc, '1y')), - ratio2ySd: createRatio1ySdPattern(client, _m(acc, '2y')), - ratio4ySd: createRatio1ySdPattern(client, _m(acc, '4y')), - ratioPct1: createMetricPattern4(client, _m(acc, 'pct1')), - ratioPct1Usd: createMetricPattern4(client, _m(acc, 'pct1_usd')), - ratioPct2: createMetricPattern4(client, _m(acc, 'pct2')), - ratioPct2Usd: createMetricPattern4(client, _m(acc, 'pct2_usd')), - ratioPct5: createMetricPattern4(client, _m(acc, 'pct5')), - ratioPct5Usd: createMetricPattern4(client, _m(acc, 'pct5_usd')), - ratioPct95: createMetricPattern4(client, _m(acc, 'pct95')), - ratioPct95Usd: createMetricPattern4(client, _m(acc, 'pct95_usd')), - ratioPct98: createMetricPattern4(client, _m(acc, 'pct98')), - ratioPct98Usd: createMetricPattern4(client, _m(acc, 'pct98_usd')), - ratioPct99: createMetricPattern4(client, _m(acc, 'pct99')), - ratioPct99Usd: createMetricPattern4(client, _m(acc, 'pct99_usd')), + ratio1mSma: createMetricPattern4(client, _m(acc, "1m_sma")), + ratio1wSma: createMetricPattern4(client, _m(acc, "1w_sma")), + ratio1ySd: createRatio1ySdPattern(client, _m(acc, "1y")), + ratio2ySd: createRatio1ySdPattern(client, _m(acc, "2y")), + ratio4ySd: createRatio1ySdPattern(client, _m(acc, "4y")), + ratioPct1: createMetricPattern4(client, _m(acc, "pct1")), + ratioPct1Usd: createMetricPattern4(client, _m(acc, "pct1_usd")), + ratioPct2: createMetricPattern4(client, _m(acc, "pct2")), + ratioPct2Usd: createMetricPattern4(client, _m(acc, "pct2_usd")), + ratioPct5: createMetricPattern4(client, _m(acc, "pct5")), + ratioPct5Usd: createMetricPattern4(client, _m(acc, "pct5_usd")), + ratioPct95: createMetricPattern4(client, _m(acc, "pct95")), + ratioPct95Usd: createMetricPattern4(client, _m(acc, "pct95_usd")), + ratioPct98: createMetricPattern4(client, _m(acc, "pct98")), + ratioPct98Usd: createMetricPattern4(client, _m(acc, "pct98_usd")), + ratioPct99: createMetricPattern4(client, _m(acc, "pct99")), + ratioPct99Usd: createMetricPattern4(client, _m(acc, "pct99_usd")), ratioSd: createRatio1ySdPattern(client, acc), }; } @@ -2145,25 +2533,25 @@ function createActivePriceRatioPattern(client, acc) { */ function createPercentilesPattern2(client, acc) { return { - costBasisPct05: createMetricPattern4(client, _m(acc, 'pct05')), - costBasisPct10: createMetricPattern4(client, _m(acc, 'pct10')), - costBasisPct15: createMetricPattern4(client, _m(acc, 'pct15')), - costBasisPct20: createMetricPattern4(client, _m(acc, 'pct20')), - costBasisPct25: createMetricPattern4(client, _m(acc, 'pct25')), - costBasisPct30: createMetricPattern4(client, _m(acc, 'pct30')), - costBasisPct35: createMetricPattern4(client, _m(acc, 'pct35')), - costBasisPct40: createMetricPattern4(client, _m(acc, 'pct40')), - costBasisPct45: createMetricPattern4(client, _m(acc, 'pct45')), - costBasisPct50: createMetricPattern4(client, _m(acc, 'pct50')), - costBasisPct55: createMetricPattern4(client, _m(acc, 'pct55')), - costBasisPct60: createMetricPattern4(client, _m(acc, 'pct60')), - costBasisPct65: createMetricPattern4(client, _m(acc, 'pct65')), - costBasisPct70: createMetricPattern4(client, _m(acc, 'pct70')), - costBasisPct75: createMetricPattern4(client, _m(acc, 'pct75')), - costBasisPct80: createMetricPattern4(client, _m(acc, 'pct80')), - costBasisPct85: createMetricPattern4(client, _m(acc, 'pct85')), - costBasisPct90: createMetricPattern4(client, _m(acc, 'pct90')), - costBasisPct95: createMetricPattern4(client, _m(acc, 'pct95')), + costBasisPct05: createMetricPattern4(client, _m(acc, "pct05")), + costBasisPct10: createMetricPattern4(client, _m(acc, "pct10")), + costBasisPct15: createMetricPattern4(client, _m(acc, "pct15")), + costBasisPct20: createMetricPattern4(client, _m(acc, "pct20")), + costBasisPct25: createMetricPattern4(client, _m(acc, "pct25")), + costBasisPct30: createMetricPattern4(client, _m(acc, "pct30")), + costBasisPct35: createMetricPattern4(client, _m(acc, "pct35")), + costBasisPct40: createMetricPattern4(client, _m(acc, "pct40")), + costBasisPct45: createMetricPattern4(client, _m(acc, "pct45")), + costBasisPct50: createMetricPattern4(client, _m(acc, "pct50")), + costBasisPct55: createMetricPattern4(client, _m(acc, "pct55")), + costBasisPct60: createMetricPattern4(client, _m(acc, "pct60")), + costBasisPct65: createMetricPattern4(client, _m(acc, "pct65")), + costBasisPct70: createMetricPattern4(client, _m(acc, "pct70")), + costBasisPct75: createMetricPattern4(client, _m(acc, "pct75")), + costBasisPct80: createMetricPattern4(client, _m(acc, "pct80")), + costBasisPct85: createMetricPattern4(client, _m(acc, "pct85")), + costBasisPct90: createMetricPattern4(client, _m(acc, "pct90")), + costBasisPct95: createMetricPattern4(client, _m(acc, "pct95")), }; } @@ -2197,24 +2585,75 @@ function createPercentilesPattern2(client, acc) { */ function createRelativePattern5(client, acc) { return { - 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: 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')), + 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: 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"), + ), }; } @@ -2244,20 +2683,20 @@ function createRelativePattern5(client, acc) { */ function createAaopoolPattern(client, acc) { return { - _1mBlocksMined: createMetricPattern1(client, _m(acc, '1m_blocks_mined')), - _1mDominance: createMetricPattern1(client, _m(acc, '1m_dominance')), - _1wBlocksMined: createMetricPattern1(client, _m(acc, '1w_blocks_mined')), - _1wDominance: createMetricPattern1(client, _m(acc, '1w_dominance')), - _1yBlocksMined: createMetricPattern1(client, _m(acc, '1y_blocks_mined')), - _1yDominance: createMetricPattern1(client, _m(acc, '1y_dominance')), - _24hBlocksMined: createMetricPattern1(client, _m(acc, '24h_blocks_mined')), - _24hDominance: createMetricPattern1(client, _m(acc, '24h_dominance')), - blocksMined: createBlockCountPattern(client, _m(acc, 'blocks_mined')), - coinbase: createUnclaimedRewardsPattern(client, _m(acc, 'coinbase')), - daysSinceBlock: createMetricPattern4(client, _m(acc, 'days_since_block')), - dominance: createMetricPattern1(client, _m(acc, 'dominance')), - fee: createUnclaimedRewardsPattern(client, _m(acc, 'fee')), - subsidy: createUnclaimedRewardsPattern(client, _m(acc, 'subsidy')), + _1mBlocksMined: createMetricPattern1(client, _m(acc, "1m_blocks_mined")), + _1mDominance: createMetricPattern1(client, _m(acc, "1m_dominance")), + _1wBlocksMined: createMetricPattern1(client, _m(acc, "1w_blocks_mined")), + _1wDominance: createMetricPattern1(client, _m(acc, "1w_dominance")), + _1yBlocksMined: createMetricPattern1(client, _m(acc, "1y_blocks_mined")), + _1yDominance: createMetricPattern1(client, _m(acc, "1y_dominance")), + _24hBlocksMined: createMetricPattern1(client, _m(acc, "24h_blocks_mined")), + _24hDominance: createMetricPattern1(client, _m(acc, "24h_dominance")), + blocksMined: createBlockCountPattern(client, _m(acc, "blocks_mined")), + coinbase: createUnclaimedRewardsPattern(client, _m(acc, "coinbase")), + daysSinceBlock: createMetricPattern4(client, _m(acc, "days_since_block")), + dominance: createMetricPattern1(client, _m(acc, "dominance")), + fee: createUnclaimedRewardsPattern(client, _m(acc, "fee")), + subsidy: createUnclaimedRewardsPattern(client, _m(acc, "subsidy")), }; } @@ -2288,19 +2727,19 @@ function createAaopoolPattern(client, acc) { */ function createPriceAgoPattern(client, acc) { return { - _10y: createMetricPattern4(client, _m(acc, '10y_ago')), - _1d: createMetricPattern4(client, _m(acc, '1d_ago')), - _1m: createMetricPattern4(client, _m(acc, '1m_ago')), - _1w: createMetricPattern4(client, _m(acc, '1w_ago')), - _1y: createMetricPattern4(client, _m(acc, '1y_ago')), - _2y: createMetricPattern4(client, _m(acc, '2y_ago')), - _3m: createMetricPattern4(client, _m(acc, '3m_ago')), - _3y: createMetricPattern4(client, _m(acc, '3y_ago')), - _4y: createMetricPattern4(client, _m(acc, '4y_ago')), - _5y: createMetricPattern4(client, _m(acc, '5y_ago')), - _6m: createMetricPattern4(client, _m(acc, '6m_ago')), - _6y: createMetricPattern4(client, _m(acc, '6y_ago')), - _8y: createMetricPattern4(client, _m(acc, '8y_ago')), + _10y: createMetricPattern4(client, _m(acc, "10y_ago")), + _1d: createMetricPattern4(client, _m(acc, "1d_ago")), + _1m: createMetricPattern4(client, _m(acc, "1m_ago")), + _1w: createMetricPattern4(client, _m(acc, "1w_ago")), + _1y: createMetricPattern4(client, _m(acc, "1y_ago")), + _2y: createMetricPattern4(client, _m(acc, "2y_ago")), + _3m: createMetricPattern4(client, _m(acc, "3m_ago")), + _3y: createMetricPattern4(client, _m(acc, "3y_ago")), + _4y: createMetricPattern4(client, _m(acc, "4y_ago")), + _5y: createMetricPattern4(client, _m(acc, "5y_ago")), + _6m: createMetricPattern4(client, _m(acc, "6m_ago")), + _6y: createMetricPattern4(client, _m(acc, "6y_ago")), + _8y: createMetricPattern4(client, _m(acc, "8y_ago")), }; } @@ -2328,18 +2767,18 @@ function createPriceAgoPattern(client, acc) { */ function createPeriodLumpSumStackPattern(client, acc) { return { - _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')), + _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"), }; } @@ -2369,18 +2808,18 @@ function createPeriodLumpSumStackPattern(client, acc) { */ function createPeriodAveragePricePattern(client, acc) { return { - _10y: createMetricPattern4(client, (acc ? `10y_${acc}` : '10y')), - _1m: createMetricPattern4(client, (acc ? `1m_${acc}` : '1m')), - _1w: createMetricPattern4(client, (acc ? `1w_${acc}` : '1w')), - _1y: createMetricPattern4(client, (acc ? `1y_${acc}` : '1y')), - _2y: createMetricPattern4(client, (acc ? `2y_${acc}` : '2y')), - _3m: createMetricPattern4(client, (acc ? `3m_${acc}` : '3m')), - _3y: createMetricPattern4(client, (acc ? `3y_${acc}` : '3y')), - _4y: createMetricPattern4(client, (acc ? `4y_${acc}` : '4y')), - _5y: createMetricPattern4(client, (acc ? `5y_${acc}` : '5y')), - _6m: createMetricPattern4(client, (acc ? `6m_${acc}` : '6m')), - _6y: createMetricPattern4(client, (acc ? `6y_${acc}` : '6y')), - _8y: createMetricPattern4(client, (acc ? `8y_${acc}` : '8y')), + _10y: createMetricPattern4(client, acc ? `10y_${acc}` : "10y"), + _1m: createMetricPattern4(client, acc ? `1m_${acc}` : "1m"), + _1w: createMetricPattern4(client, acc ? `1w_${acc}` : "1w"), + _1y: createMetricPattern4(client, acc ? `1y_${acc}` : "1y"), + _2y: createMetricPattern4(client, acc ? `2y_${acc}` : "2y"), + _3m: createMetricPattern4(client, acc ? `3m_${acc}` : "3m"), + _3y: createMetricPattern4(client, acc ? `3y_${acc}` : "3y"), + _4y: createMetricPattern4(client, acc ? `4y_${acc}` : "4y"), + _5y: createMetricPattern4(client, acc ? `5y_${acc}` : "5y"), + _6m: createMetricPattern4(client, acc ? `6m_${acc}` : "6m"), + _6y: createMetricPattern4(client, acc ? `6y_${acc}` : "6y"), + _8y: createMetricPattern4(client, acc ? `8y_${acc}` : "8y"), }; } @@ -2409,52 +2848,17 @@ function createPeriodAveragePricePattern(client, acc) { */ function createClassAveragePricePattern(client, acc) { return { - _2015: createMetricPattern4(client, _m(acc, '2015_average_price')), - _2016: createMetricPattern4(client, _m(acc, '2016_average_price')), - _2017: createMetricPattern4(client, _m(acc, '2017_average_price')), - _2018: createMetricPattern4(client, _m(acc, '2018_average_price')), - _2019: createMetricPattern4(client, _m(acc, '2019_average_price')), - _2020: createMetricPattern4(client, _m(acc, '2020_average_price')), - _2021: createMetricPattern4(client, _m(acc, '2021_average_price')), - _2022: createMetricPattern4(client, _m(acc, '2022_average_price')), - _2023: createMetricPattern4(client, _m(acc, '2023_average_price')), - _2024: createMetricPattern4(client, _m(acc, '2024_average_price')), - _2025: createMetricPattern4(client, _m(acc, '2025_average_price')), - }; -} - -/** - * @typedef {Object} RelativePattern - * @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 {MetricPattern1} unrealizedLossRelToMarketCap - * @property {MetricPattern1} unrealizedProfitRelToMarketCap - */ - -/** - * Create a RelativePattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {RelativePattern} - */ -function createRelativePattern(client, acc) { - return { - 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: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), - unrealizedProfitRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), + _2015: createMetricPattern4(client, _m(acc, "2015_average_price")), + _2016: createMetricPattern4(client, _m(acc, "2016_average_price")), + _2017: createMetricPattern4(client, _m(acc, "2017_average_price")), + _2018: createMetricPattern4(client, _m(acc, "2018_average_price")), + _2019: createMetricPattern4(client, _m(acc, "2019_average_price")), + _2020: createMetricPattern4(client, _m(acc, "2020_average_price")), + _2021: createMetricPattern4(client, _m(acc, "2021_average_price")), + _2022: createMetricPattern4(client, _m(acc, "2022_average_price")), + _2023: createMetricPattern4(client, _m(acc, "2023_average_price")), + _2024: createMetricPattern4(client, _m(acc, "2024_average_price")), + _2025: createMetricPattern4(client, _m(acc, "2025_average_price")), }; } @@ -2480,16 +2884,108 @@ function createRelativePattern(client, acc) { */ 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')), + 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"), + ), + }; +} + +/** + * @typedef {Object} RelativePattern + * @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 {MetricPattern1} unrealizedLossRelToMarketCap + * @property {MetricPattern1} unrealizedProfitRelToMarketCap + */ + +/** + * Create a RelativePattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RelativePattern} + */ +function createRelativePattern(client, acc) { + return { + 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: createMetricPattern1( + client, + _m(acc, "unrealized_loss_rel_to_market_cap"), + ), + unrealizedProfitRelToMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_profit_rel_to_market_cap"), + ), }; } @@ -2514,15 +3010,65 @@ function createRelativePattern2(client, acc) { */ function createAddrCountPattern(client, acc) { return { - all: createMetricPattern1(client, (acc ? `addr_${acc}` : 'addr')), - p2a: createMetricPattern1(client, (acc ? `p2a_addr_${acc}` : 'p2a_addr')), - p2pk33: createMetricPattern1(client, (acc ? `p2pk33_addr_${acc}` : 'p2pk33_addr')), - p2pk65: createMetricPattern1(client, (acc ? `p2pk65_addr_${acc}` : 'p2pk65_addr')), - p2pkh: createMetricPattern1(client, (acc ? `p2pkh_addr_${acc}` : 'p2pkh_addr')), - p2sh: createMetricPattern1(client, (acc ? `p2sh_addr_${acc}` : 'p2sh_addr')), - p2tr: createMetricPattern1(client, (acc ? `p2tr_addr_${acc}` : 'p2tr_addr')), - p2wpkh: createMetricPattern1(client, (acc ? `p2wpkh_addr_${acc}` : 'p2wpkh_addr')), - p2wsh: createMetricPattern1(client, (acc ? `p2wsh_addr_${acc}` : 'p2wsh_addr')), + all: createMetricPattern1(client, acc ? `addr_${acc}` : "addr"), + p2a: createMetricPattern1(client, acc ? `p2a_addr_${acc}` : "p2a_addr"), + p2pk33: createMetricPattern1( + client, + acc ? `p2pk33_addr_${acc}` : "p2pk33_addr", + ), + p2pk65: createMetricPattern1( + client, + acc ? `p2pk65_addr_${acc}` : "p2pk65_addr", + ), + p2pkh: createMetricPattern1( + client, + acc ? `p2pkh_addr_${acc}` : "p2pkh_addr", + ), + p2sh: createMetricPattern1(client, acc ? `p2sh_addr_${acc}` : "p2sh_addr"), + p2tr: createMetricPattern1(client, acc ? `p2tr_addr_${acc}` : "p2tr_addr"), + p2wpkh: createMetricPattern1( + client, + acc ? `p2wpkh_addr_${acc}` : "p2wpkh_addr", + ), + p2wsh: createMetricPattern1( + client, + acc ? `p2wsh_addr_${acc}` : "p2wsh_addr", + ), + }; +} + +/** + * @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), }; } @@ -2561,41 +3107,6 @@ function createOhlcPattern(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), - }; -} - /** * @typedef {Object} _0satsPattern * @property {ActivityPattern2} activity @@ -2617,12 +3128,41 @@ function createFeeRatePattern(client, acc) { function create_0satsPattern(client, acc) { return { activity: createActivityPattern2(client, acc), - addrCount: createMetricPattern1(client, _m(acc, 'addr_count')), + 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, _m(acc, 'supply')), + supply: createSupplyPattern2(client, _m(acc, "supply")), + unrealized: createUnrealizedPattern(client, acc), + }; +} + +/** + * @typedef {Object} _0satsPattern2 + * @property {ActivityPattern2} activity + * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern} realized + * @property {RelativePattern4} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized + */ + +/** + * Create a _0satsPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_0satsPattern2} + */ +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, _m(acc, "supply")), unrealized: createUnrealizedPattern(client, acc), }; } @@ -2646,13 +3186,31 @@ function create_0satsPattern(client, acc) { */ 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')), + 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"), + ), }; } @@ -2680,94 +3238,7 @@ function create_100btcPattern(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), - }; -} - -/** - * @typedef {Object} PeriodCagrPattern - * @property {MetricPattern4} _10y - * @property {MetricPattern4} _2y - * @property {MetricPattern4} _3y - * @property {MetricPattern4} _4y - * @property {MetricPattern4} _5y - * @property {MetricPattern4} _6y - * @property {MetricPattern4} _8y - */ - -/** - * Create a PeriodCagrPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {PeriodCagrPattern} - */ -function createPeriodCagrPattern(client, acc) { - return { - _10y: createMetricPattern4(client, (acc ? `10y_${acc}` : '10y')), - _2y: createMetricPattern4(client, (acc ? `2y_${acc}` : '2y')), - _3y: createMetricPattern4(client, (acc ? `3y_${acc}` : '3y')), - _4y: createMetricPattern4(client, (acc ? `4y_${acc}` : '4y')), - _5y: createMetricPattern4(client, (acc ? `5y_${acc}` : '5y')), - _6y: createMetricPattern4(client, (acc ? `6y_${acc}` : '6y')), - _8y: createMetricPattern4(client, (acc ? `8y_${acc}` : '8y')), - }; -} - -/** - * @typedef {Object} _0satsPattern2 - * @property {ActivityPattern2} activity - * @property {CostBasisPattern} costBasis - * @property {OutputsPattern} outputs - * @property {RealizedPattern} realized - * @property {RelativePattern4} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _0satsPattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_0satsPattern2} - */ -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, _m(acc, 'supply')), + supply: createSupplyPattern2(client, _m(acc, "supply")), unrealized: createUnrealizedPattern(client, acc), }; } @@ -2796,16 +3267,74 @@ function create_10yTo12yPattern(client, acc) { outputs: createOutputsPattern(client, acc), realized: createRealizedPattern2(client, acc), relative: createRelativePattern2(client, acc), - supply: createSupplyPattern2(client, _m(acc, 'supply')), + 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), + }; +} + +/** + * @typedef {Object} PeriodCagrPattern + * @property {MetricPattern4} _10y + * @property {MetricPattern4} _2y + * @property {MetricPattern4} _3y + * @property {MetricPattern4} _4y + * @property {MetricPattern4} _5y + * @property {MetricPattern4} _6y + * @property {MetricPattern4} _8y + */ + +/** + * Create a PeriodCagrPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {PeriodCagrPattern} + */ +function createPeriodCagrPattern(client, acc) { + return { + _10y: createMetricPattern4(client, acc ? `10y_${acc}` : "10y"), + _2y: createMetricPattern4(client, acc ? `2y_${acc}` : "2y"), + _3y: createMetricPattern4(client, acc ? `3y_${acc}` : "3y"), + _4y: createMetricPattern4(client, acc ? `4y_${acc}` : "4y"), + _5y: createMetricPattern4(client, acc ? `5y_${acc}` : "5y"), + _6y: createMetricPattern4(client, acc ? `6y_${acc}` : "6y"), + _8y: createMetricPattern4(client, acc ? `8y_${acc}` : "8y"), + }; +} + /** * @template T * @typedef {Object} BitcoinPattern * @property {MetricPattern2} average - * @property {MetricPattern1} cumulative + * @property {MetricPattern2} cumulative * @property {MetricPattern12} height * @property {MetricPattern2} max * @property {MetricPattern2} min @@ -2822,25 +3351,25 @@ function create_10yTo12yPattern(client, acc) { */ function createBitcoinPattern(client, acc) { return { - average: createMetricPattern2(client, _m(acc, 'average')), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + average: createMetricPattern2(client, _m(acc, "average")), + cumulative: createMetricPattern2(client, _m(acc, "cumulative")), height: createMetricPattern12(client, acc), - max: createMetricPattern2(client, _m(acc, 'max')), - min: createMetricPattern2(client, _m(acc, 'min')), + max: createMetricPattern2(client, _m(acc, "max")), + min: createMetricPattern2(client, _m(acc, "min")), percentiles: createPercentilesPattern(client, acc), - sum: createMetricPattern2(client, _m(acc, 'sum')), + sum: createMetricPattern2(client, _m(acc, "sum")), }; } /** * @template T * @typedef {Object} SizePattern - * @property {MetricPattern2} average + * @property {MetricPattern1} average * @property {MetricPattern1} cumulative - * @property {MetricPattern2} max - * @property {MetricPattern2} min + * @property {MetricPattern1} max + * @property {MetricPattern1} min * @property {PercentilesPattern} percentiles - * @property {MetricPattern2} sum + * @property {MetricPattern1} sum */ /** @@ -2852,12 +3381,12 @@ function createBitcoinPattern(client, acc) { */ function createSizePattern(client, acc) { return { - average: createMetricPattern2(client, _m(acc, 'average')), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - max: createMetricPattern2(client, _m(acc, 'max')), - min: createMetricPattern2(client, _m(acc, 'min')), + average: createMetricPattern1(client, _m(acc, "average")), + cumulative: createMetricPattern1(client, _m(acc, "cumulative")), + max: createMetricPattern1(client, _m(acc, "max")), + min: createMetricPattern1(client, _m(acc, "min")), percentiles: createPercentilesPattern(client, acc), - sum: createMetricPattern2(client, _m(acc, 'sum')), + sum: createMetricPattern1(client, _m(acc, "sum")), }; } @@ -2878,11 +3407,23 @@ function createSizePattern(client, acc) { */ function createActivityPattern2(client, acc) { return { - coinblocksDestroyed: createBlockCountPattern(client, _m(acc, 'coinblocks_destroyed')), - coindaysDestroyed: createBlockCountPattern(client, _m(acc, 'coindays_destroyed')), - satblocksDestroyed: createMetricPattern12(client, _m(acc, 'satblocks_destroyed')), - satdaysDestroyed: createMetricPattern12(client, _m(acc, 'satdays_destroyed')), - sent: createUnclaimedRewardsPattern(client, _m(acc, 'sent')), + coinblocksDestroyed: createBlockCountPattern( + client, + _m(acc, "coinblocks_destroyed"), + ), + coindaysDestroyed: createBlockCountPattern( + client, + _m(acc, "coindays_destroyed"), + ), + satblocksDestroyed: createMetricPattern12( + client, + _m(acc, "satblocks_destroyed"), + ), + satdaysDestroyed: createMetricPattern12( + client, + _m(acc, "satdays_destroyed"), + ), + sent: createUnclaimedRewardsPattern(client, _m(acc, "sent")), }; } @@ -2905,11 +3446,11 @@ function createActivityPattern2(client, acc) { */ function createPercentilesPattern(client, acc) { return { - 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')), + 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")), }; } @@ -2929,35 +3470,10 @@ function createPercentilesPattern(client, acc) { */ 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} SplitPattern2 - * @property {MetricPattern1} close - * @property {HighPattern} high - * @property {HighPattern} low - * @property {MetricPattern1} open - */ - -/** - * Create a SplitPattern2 pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {SplitPattern2} - */ -function createSplitPattern2(client, acc) { - return { - close: createMetricPattern1(client, _m(acc, 'close')), - high: createHighPattern(client, _m(acc, 'high')), - low: createHighPattern(client, _m(acc, 'low')), - open: createMetricPattern1(client, _m(acc, 'open')), + 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")), }; } @@ -2980,9 +3496,34 @@ function createSplitPattern2(client, acc) { function createHighPattern(client, acc) { return { dateindex: createMetricPattern7(client, acc), - difficultyepoch: createMetricPattern9(client, _m(acc, 'max')), + difficultyepoch: createMetricPattern9(client, _m(acc, "max")), height: createMetricPattern12(client, acc), - rest: createMetricPattern5(client, _m(acc, 'max')), + rest: createMetricPattern5(client, _m(acc, "max")), + }; +} + +/** + * @template T + * @typedef {Object} SplitPattern2 + * @property {MetricPattern1} close + * @property {HighPattern} high + * @property {HighPattern} low + * @property {MetricPattern1} open + */ + +/** + * Create a SplitPattern2 pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {SplitPattern2} + */ +function createSplitPattern2(client, acc) { + return { + close: createMetricPattern1(client, _m(acc, "close")), + high: createHighPattern(client, _m(acc, "high")), + low: createHighPattern(client, _m(acc, "low")), + open: createMetricPattern1(client, _m(acc, "open")), }; } @@ -3001,75 +3542,12 @@ function createHighPattern(client, acc) { */ function create_24hCoinbaseSumPattern(client, acc) { return { - bitcoin: createMetricPattern12(client, _m(acc, 'btc')), - dollars: createMetricPattern12(client, _m(acc, 'usd')), + bitcoin: createMetricPattern12(client, _m(acc, "btc")), + dollars: createMetricPattern12(client, _m(acc, "usd")), sats: createMetricPattern12(client, acc), }; } -/** - * @typedef {Object} SegwitAdoptionPattern - * @property {MetricPattern2} cumulative - * @property {MetricPattern12} height - * @property {MetricPattern2} sum - */ - -/** - * Create a SegwitAdoptionPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {SegwitAdoptionPattern} - */ -function createSegwitAdoptionPattern(client, acc) { - return { - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - height: createMetricPattern12(client, acc), - sum: createMetricPattern2(client, _m(acc, 'sum')), - }; -} - -/** - * @typedef {Object} CostBasisPattern2 - * @property {MetricPattern1} max - * @property {MetricPattern1} min - * @property {PercentilesPattern2} percentiles - */ - -/** - * Create a CostBasisPattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {CostBasisPattern2} - */ -function createCostBasisPattern2(client, acc) { - return { - max: createMetricPattern1(client, _m(acc, 'max_cost_basis')), - min: createMetricPattern1(client, _m(acc, 'min_cost_basis')), - percentiles: createPercentilesPattern2(client, _m(acc, 'cost_basis')), - }; -} - -/** - * @typedef {Object} UnclaimedRewardsPattern - * @property {BlockCountPattern} bitcoin - * @property {BlockCountPattern} dollars - * @property {BlockCountPattern} sats - */ - -/** - * Create a UnclaimedRewardsPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {UnclaimedRewardsPattern} - */ -function createUnclaimedRewardsPattern(client, acc) { - return { - bitcoin: createBlockCountPattern(client, _m(acc, 'btc')), - dollars: createBlockCountPattern(client, _m(acc, 'usd')), - sats: createBlockCountPattern(client, acc), - }; -} - /** * @typedef {Object} CoinbasePattern * @property {BitcoinPattern} bitcoin @@ -3085,85 +3563,72 @@ function createUnclaimedRewardsPattern(client, acc) { */ function createCoinbasePattern(client, acc) { return { - bitcoin: createBitcoinPattern(client, _m(acc, 'btc')), - dollars: createBitcoinPattern(client, _m(acc, 'usd')), + bitcoin: createBitcoinPattern(client, _m(acc, "btc")), + dollars: createBitcoinPattern(client, _m(acc, "usd")), sats: createBitcoinPattern(client, acc), }; } /** - * @typedef {Object} RelativePattern4 - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply + * @typedef {Object} UnclaimedRewardsPattern + * @property {BlockCountPattern} bitcoin + * @property {BlockCountPattern} dollars + * @property {BlockCountPattern} sats */ /** - * Create a RelativePattern4 pattern node + * Create a UnclaimedRewardsPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {RelativePattern4} + * @returns {UnclaimedRewardsPattern} */ -function createRelativePattern4(client, acc) { +function createUnclaimedRewardsPattern(client, acc) { return { - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'loss_rel_to_own_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'profit_rel_to_own_supply')), + bitcoin: createBlockCountPattern(client, _m(acc, "btc")), + dollars: createBlockCountPattern(client, _m(acc, "usd")), + sats: createBlockCountPattern(client, acc), }; } /** - * @typedef {Object} _1dReturns1mSdPattern - * @property {MetricPattern4} sd - * @property {MetricPattern4} sma - */ - -/** - * Create a _1dReturns1mSdPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_1dReturns1mSdPattern} - */ -function create_1dReturns1mSdPattern(client, acc) { - return { - sd: createMetricPattern4(client, _m(acc, 'sd')), - sma: createMetricPattern4(client, _m(acc, 'sma')), - }; -} - -/** - * @typedef {Object} CostBasisPattern + * @typedef {Object} CostBasisPattern2 * @property {MetricPattern1} max * @property {MetricPattern1} min + * @property {PercentilesPattern2} percentiles */ /** - * Create a CostBasisPattern pattern node + * Create a CostBasisPattern2 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {CostBasisPattern} + * @returns {CostBasisPattern2} */ -function createCostBasisPattern(client, acc) { +function createCostBasisPattern2(client, acc) { return { - max: createMetricPattern1(client, _m(acc, 'max_cost_basis')), - min: createMetricPattern1(client, _m(acc, 'min_cost_basis')), + max: createMetricPattern1(client, _m(acc, "max_cost_basis")), + min: createMetricPattern1(client, _m(acc, "min_cost_basis")), + percentiles: createPercentilesPattern2(client, _m(acc, "cost_basis")), }; } /** - * @typedef {Object} SupplyPattern2 - * @property {_24hCoinbaseSumPattern} halved - * @property {_24hCoinbaseSumPattern} total + * @typedef {Object} SegwitAdoptionPattern + * @property {MetricPattern2} cumulative + * @property {MetricPattern12} height + * @property {MetricPattern2} sum */ /** - * Create a SupplyPattern2 pattern node + * Create a SegwitAdoptionPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {SupplyPattern2} + * @returns {SegwitAdoptionPattern} */ -function createSupplyPattern2(client, acc) { +function createSegwitAdoptionPattern(client, acc) { return { - halved: create_24hCoinbaseSumPattern(client, _m(acc, 'half')), - total: create_24hCoinbaseSumPattern(client, acc), + cumulative: createMetricPattern2(client, _m(acc, "cumulative")), + height: createMetricPattern12(client, acc), + sum: createMetricPattern2(client, _m(acc, "sum")), }; } @@ -3181,8 +3646,90 @@ function createSupplyPattern2(client, acc) { */ function createSatsPattern(client, acc) { return { - ohlc: createOhlcPattern(client, _m(acc, 'ohlc_sats')), - split: createSplitPattern2(client, _m(acc, 'sats')), + ohlc: createOhlcPattern(client, _m(acc, "ohlc_sats")), + split: createSplitPattern2(client, _m(acc, "sats")), + }; +} + +/** + * @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} 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} _1dReturns1mSdPattern + * @property {MetricPattern4} sd + * @property {MetricPattern4} sma + */ + +/** + * Create a _1dReturns1mSdPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1dReturns1mSdPattern} + */ +function create_1dReturns1mSdPattern(client, acc) { + return { + sd: createMetricPattern4(client, _m(acc, "sd")), + sma: createMetricPattern4(client, _m(acc, "sma")), + }; +} + +/** + * @typedef {Object} RelativePattern4 + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply + */ + +/** + * Create a RelativePattern4 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RelativePattern4} + */ +function createRelativePattern4(client, acc) { + return { + supplyInLossRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "loss_rel_to_own_supply"), + ), + supplyInProfitRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "profit_rel_to_own_supply"), + ), }; } @@ -3202,28 +3749,11 @@ function createSatsPattern(client, acc) { */ function createBlockCountPattern(client, acc) { return { - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + cumulative: createMetricPattern1(client, _m(acc, "cumulative")), sum: createMetricPattern1(client, acc), }; } -/** - * @typedef {Object} RealizedPriceExtraPattern - * @property {MetricPattern4} ratio - */ - -/** - * Create a RealizedPriceExtraPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {RealizedPriceExtraPattern} - */ -function createRealizedPriceExtraPattern(client, acc) { - return { - ratio: createMetricPattern4(client, _m(acc, 'ratio')), - }; -} - /** * @typedef {Object} OutputsPattern * @property {MetricPattern1} utxoCount @@ -3237,14 +3767,31 @@ function createRealizedPriceExtraPattern(client, acc) { */ function createOutputsPattern(client, acc) { return { - utxoCount: createMetricPattern1(client, _m(acc, 'utxo_count')), + utxoCount: createMetricPattern1(client, _m(acc, "utxo_count")), + }; +} + +/** + * @typedef {Object} RealizedPriceExtraPattern + * @property {MetricPattern4} ratio + */ + +/** + * Create a RealizedPriceExtraPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RealizedPriceExtraPattern} + */ +function createRealizedPriceExtraPattern(client, acc) { + return { + ratio: createMetricPattern4(client, _m(acc, "ratio")), }; } /** * @template T * @typedef {Object} EmptyPattern - * @property {MetricPattern18} identity + * @property {MetricPattern25} identity */ /** @@ -3256,7 +3803,7 @@ function createOutputsPattern(client, acc) { */ function createEmptyPattern(client, acc) { return { - identity: createMetricPattern18(client, acc), + identity: createMetricPattern25(client, acc), }; } @@ -4494,868 +5041,868 @@ class BrkClient extends BrkClientBase { "weekindex", "yearindex", "loadedaddressindex", - "emptyaddressindex" + "emptyaddressindex", ]); POOL_ID_TO_POOL_NAME = /** @type {const} */ ({ - "unknown": "Unknown", - "blockfills": "BlockFills", - "ultimuspool": "ULTIMUSPOOL", - "terrapool": "Terra Pool", - "luxor": "Luxor", - "onethash": "1THash", - "btccom": "BTC.com", - "bitfarms": "Bitfarms", - "huobipool": "Huobi.pool", - "wayicn": "WAYI.CN", - "canoepool": "CanoePool", - "btctop": "BTC.TOP", - "bitcoincom": "Bitcoin.com", - "pool175btc": "175btc", - "gbminers": "GBMiners", - "axbt": "A-XBT", - "asicminer": "ASICMiner", - "bitminter": "BitMinter", - "bitcoinrussia": "BitcoinRussia", - "btcserv": "BTCServ", - "simplecoinus": "simplecoin.us", - "btcguild": "BTC Guild", - "eligius": "Eligius", - "ozcoin": "OzCoin", - "eclipsemc": "EclipseMC", - "maxbtc": "MaxBTC", - "triplemining": "TripleMining", - "coinlab": "CoinLab", - "pool50btc": "50BTC", - "ghashio": "GHash.IO", - "stminingcorp": "ST Mining Corp", - "bitparking": "Bitparking", - "mmpool": "mmpool", - "polmine": "Polmine", - "kncminer": "KnCMiner", - "bitalo": "Bitalo", - "f2pool": "F2Pool", - "hhtt": "HHTT", - "megabigpower": "MegaBigPower", - "mtred": "Mt Red", - "nmcbit": "NMCbit", - "yourbtcnet": "Yourbtc.net", - "givemecoins": "Give Me Coins", - "braiinspool": "Braiins Pool", - "antpool": "AntPool", - "multicoinco": "MultiCoin.co", - "bcpoolio": "bcpool.io", - "cointerra": "Cointerra", - "kanopool": "KanoPool", - "solock": "Solo CK", - "ckpool": "CKPool", - "nicehash": "NiceHash", - "bitclub": "BitClub", - "bitcoinaffiliatenetwork": "Bitcoin Affiliate Network", - "btcc": "BTCC", - "bwpool": "BWPool", - "exxbw": "EXX&BW", - "bitsolo": "Bitsolo", - "bitfury": "BitFury", - "twentyoneinc": "21 Inc.", - "digitalbtc": "digitalBTC", - "eightbaochi": "8baochi", - "mybtccoinpool": "myBTCcoin Pool", - "tbdice": "TBDice", - "hashpool": "HASHPOOL", - "nexious": "Nexious", - "bravomining": "Bravo Mining", - "hotpool": "HotPool", - "okexpool": "OKExPool", - "bcmonster": "BCMonster", - "onehash": "1Hash", - "bixin": "Bixin", - "tatmaspool": "TATMAS Pool", - "viabtc": "ViaBTC", - "connectbtc": "ConnectBTC", - "batpool": "BATPOOL", - "waterhole": "Waterhole", - "dcexploration": "DCExploration", - "dcex": "DCEX", - "btpool": "BTPOOL", - "fiftyeightcoin": "58COIN", - "bitcoinindia": "Bitcoin India", - "shawnp0wers": "shawnp0wers", - "phashio": "PHash.IO", - "rigpool": "RigPool", - "haozhuzhu": "HAOZHUZHU", - "sevenpool": "7pool", - "miningkings": "MiningKings", - "hashbx": "HashBX", - "dpool": "DPOOL", - "rawpool": "Rawpool", - "haominer": "haominer", - "helix": "Helix", - "bitcoinukraine": "Bitcoin-Ukraine", - "poolin": "Poolin", - "secretsuperstar": "SecretSuperstar", - "tigerpoolnet": "tigerpool.net", - "sigmapoolcom": "Sigmapool.com", - "okpooltop": "okpool.top", - "hummerpool": "Hummerpool", - "tangpool": "Tangpool", - "bytepool": "BytePool", - "spiderpool": "SpiderPool", - "novablock": "NovaBlock", - "miningcity": "MiningCity", - "binancepool": "Binance Pool", - "minerium": "Minerium", - "lubiancom": "Lubian.com", - "okkong": "OKKONG", - "aaopool": "AAO Pool", - "emcdpool": "EMCDPool", - "foundryusa": "Foundry USA", - "sbicrypto": "SBI Crypto", - "arkpool": "ArkPool", - "purebtccom": "PureBTC.COM", - "marapool": "MARA Pool", - "kucoinpool": "KuCoinPool", - "entrustcharitypool": "Entrust Charity Pool", - "okminer": "OKMINER", - "titan": "Titan", - "pegapool": "PEGA Pool", - "btcnuggets": "BTC Nuggets", - "cloudhashing": "CloudHashing", - "digitalxmintsy": "digitalX Mintsy", - "telco214": "Telco 214", - "btcpoolparty": "BTC Pool Party", - "multipool": "Multipool", - "transactioncoinmining": "transactioncoinmining", - "btcdig": "BTCDig", - "trickysbtcpool": "Tricky's BTC Pool", - "btcmp": "BTCMP", - "eobot": "Eobot", - "unomp": "UNOMP", - "patels": "Patels", - "gogreenlight": "GoGreenLight", - "ekanembtc": "EkanemBTC", - "canoe": "CANOE", - "tiger": "tiger", - "onem1x": "1M1X", - "zulupool": "Zulupool", - "secpool": "SECPOOL", - "ocean": "OCEAN", - "whitepool": "WhitePool", - "wk057": "wk057", - "futurebitapollosolo": "FutureBit Apollo Solo", - "carbonnegative": "Carbon Negative", - "portlandhodl": "Portland.HODL", - "phoenix": "Phoenix", - "neopool": "Neopool", - "maxipool": "MaxiPool", - "bitfufupool": "BitFuFuPool", - "luckypool": "luckyPool", - "miningdutch": "Mining-Dutch", - "publicpool": "Public Pool", - "miningsquared": "Mining Squared", - "innopolistech": "Innopolis Tech", - "btclab": "BTCLab", - "parasite": "Parasite" + unknown: "Unknown", + blockfills: "BlockFills", + ultimuspool: "ULTIMUSPOOL", + terrapool: "Terra Pool", + luxor: "Luxor", + onethash: "1THash", + btccom: "BTC.com", + bitfarms: "Bitfarms", + huobipool: "Huobi.pool", + wayicn: "WAYI.CN", + canoepool: "CanoePool", + btctop: "BTC.TOP", + bitcoincom: "Bitcoin.com", + pool175btc: "175btc", + gbminers: "GBMiners", + axbt: "A-XBT", + asicminer: "ASICMiner", + bitminter: "BitMinter", + bitcoinrussia: "BitcoinRussia", + btcserv: "BTCServ", + simplecoinus: "simplecoin.us", + btcguild: "BTC Guild", + eligius: "Eligius", + ozcoin: "OzCoin", + eclipsemc: "EclipseMC", + maxbtc: "MaxBTC", + triplemining: "TripleMining", + coinlab: "CoinLab", + pool50btc: "50BTC", + ghashio: "GHash.IO", + stminingcorp: "ST Mining Corp", + bitparking: "Bitparking", + mmpool: "mmpool", + polmine: "Polmine", + kncminer: "KnCMiner", + bitalo: "Bitalo", + f2pool: "F2Pool", + hhtt: "HHTT", + megabigpower: "MegaBigPower", + mtred: "Mt Red", + nmcbit: "NMCbit", + yourbtcnet: "Yourbtc.net", + givemecoins: "Give Me Coins", + braiinspool: "Braiins Pool", + antpool: "AntPool", + multicoinco: "MultiCoin.co", + bcpoolio: "bcpool.io", + cointerra: "Cointerra", + kanopool: "KanoPool", + solock: "Solo CK", + ckpool: "CKPool", + nicehash: "NiceHash", + bitclub: "BitClub", + bitcoinaffiliatenetwork: "Bitcoin Affiliate Network", + btcc: "BTCC", + bwpool: "BWPool", + exxbw: "EXX&BW", + bitsolo: "Bitsolo", + bitfury: "BitFury", + twentyoneinc: "21 Inc.", + digitalbtc: "digitalBTC", + eightbaochi: "8baochi", + mybtccoinpool: "myBTCcoin Pool", + tbdice: "TBDice", + hashpool: "HASHPOOL", + nexious: "Nexious", + bravomining: "Bravo Mining", + hotpool: "HotPool", + okexpool: "OKExPool", + bcmonster: "BCMonster", + onehash: "1Hash", + bixin: "Bixin", + tatmaspool: "TATMAS Pool", + viabtc: "ViaBTC", + connectbtc: "ConnectBTC", + batpool: "BATPOOL", + waterhole: "Waterhole", + dcexploration: "DCExploration", + dcex: "DCEX", + btpool: "BTPOOL", + fiftyeightcoin: "58COIN", + bitcoinindia: "Bitcoin India", + shawnp0wers: "shawnp0wers", + phashio: "PHash.IO", + rigpool: "RigPool", + haozhuzhu: "HAOZHUZHU", + sevenpool: "7pool", + miningkings: "MiningKings", + hashbx: "HashBX", + dpool: "DPOOL", + rawpool: "Rawpool", + haominer: "haominer", + helix: "Helix", + bitcoinukraine: "Bitcoin-Ukraine", + poolin: "Poolin", + secretsuperstar: "SecretSuperstar", + tigerpoolnet: "tigerpool.net", + sigmapoolcom: "Sigmapool.com", + okpooltop: "okpool.top", + hummerpool: "Hummerpool", + tangpool: "Tangpool", + bytepool: "BytePool", + spiderpool: "SpiderPool", + novablock: "NovaBlock", + miningcity: "MiningCity", + binancepool: "Binance Pool", + minerium: "Minerium", + lubiancom: "Lubian.com", + okkong: "OKKONG", + aaopool: "AAO Pool", + emcdpool: "EMCDPool", + foundryusa: "Foundry USA", + sbicrypto: "SBI Crypto", + arkpool: "ArkPool", + purebtccom: "PureBTC.COM", + marapool: "MARA Pool", + kucoinpool: "KuCoinPool", + entrustcharitypool: "Entrust Charity Pool", + okminer: "OKMINER", + titan: "Titan", + pegapool: "PEGA Pool", + btcnuggets: "BTC Nuggets", + cloudhashing: "CloudHashing", + digitalxmintsy: "digitalX Mintsy", + telco214: "Telco 214", + btcpoolparty: "BTC Pool Party", + multipool: "Multipool", + transactioncoinmining: "transactioncoinmining", + btcdig: "BTCDig", + trickysbtcpool: "Tricky's BTC Pool", + btcmp: "BTCMP", + eobot: "Eobot", + unomp: "UNOMP", + patels: "Patels", + gogreenlight: "GoGreenLight", + ekanembtc: "EkanemBTC", + canoe: "CANOE", + tiger: "tiger", + onem1x: "1M1X", + zulupool: "Zulupool", + secpool: "SECPOOL", + ocean: "OCEAN", + whitepool: "WhitePool", + wk057: "wk057", + futurebitapollosolo: "FutureBit Apollo Solo", + carbonnegative: "Carbon Negative", + portlandhodl: "Portland.HODL", + phoenix: "Phoenix", + neopool: "Neopool", + maxipool: "MaxiPool", + bitfufupool: "BitFuFuPool", + luckypool: "luckyPool", + miningdutch: "Mining-Dutch", + publicpool: "Public Pool", + miningsquared: "Mining Squared", + innopolistech: "Innopolis Tech", + btclab: "BTCLab", + parasite: "Parasite", }); TERM_NAMES = /** @type {const} */ ({ - "long": { - "id": "lth", - "long": "Long Term Holders", - "short": "LTH" + long: { + id: "lth", + long: "Long Term Holders", + short: "LTH", + }, + short: { + id: "sth", + long: "Short Term Holders", + short: "STH", }, - "short": { - "id": "sth", - "long": "Short Term Holders", - "short": "STH" - } }); EPOCH_NAMES = /** @type {const} */ ({ - "_0": { - "id": "epoch_0", - "long": "Epoch 0", - "short": "Epoch 0" + _0: { + id: "epoch_0", + long: "Epoch 0", + short: "Epoch 0", }, - "_1": { - "id": "epoch_1", - "long": "Epoch 1", - "short": "Epoch 1" + _1: { + id: "epoch_1", + long: "Epoch 1", + short: "Epoch 1", }, - "_2": { - "id": "epoch_2", - "long": "Epoch 2", - "short": "Epoch 2" + _2: { + id: "epoch_2", + long: "Epoch 2", + short: "Epoch 2", }, - "_3": { - "id": "epoch_3", - "long": "Epoch 3", - "short": "Epoch 3" + _3: { + id: "epoch_3", + long: "Epoch 3", + short: "Epoch 3", + }, + _4: { + id: "epoch_4", + long: "Epoch 4", + short: "Epoch 4", }, - "_4": { - "id": "epoch_4", - "long": "Epoch 4", - "short": "Epoch 4" - } }); YEAR_NAMES = /** @type {const} */ ({ - "_2009": { - "id": "year_2009", - "long": "Year 2009", - "short": "2009" + _2009: { + id: "year_2009", + long: "Year 2009", + short: "2009", }, - "_2010": { - "id": "year_2010", - "long": "Year 2010", - "short": "2010" + _2010: { + id: "year_2010", + long: "Year 2010", + short: "2010", }, - "_2011": { - "id": "year_2011", - "long": "Year 2011", - "short": "2011" + _2011: { + id: "year_2011", + long: "Year 2011", + short: "2011", }, - "_2012": { - "id": "year_2012", - "long": "Year 2012", - "short": "2012" + _2012: { + id: "year_2012", + long: "Year 2012", + short: "2012", }, - "_2013": { - "id": "year_2013", - "long": "Year 2013", - "short": "2013" + _2013: { + id: "year_2013", + long: "Year 2013", + short: "2013", }, - "_2014": { - "id": "year_2014", - "long": "Year 2014", - "short": "2014" + _2014: { + id: "year_2014", + long: "Year 2014", + short: "2014", }, - "_2015": { - "id": "year_2015", - "long": "Year 2015", - "short": "2015" + _2015: { + id: "year_2015", + long: "Year 2015", + short: "2015", }, - "_2016": { - "id": "year_2016", - "long": "Year 2016", - "short": "2016" + _2016: { + id: "year_2016", + long: "Year 2016", + short: "2016", }, - "_2017": { - "id": "year_2017", - "long": "Year 2017", - "short": "2017" + _2017: { + id: "year_2017", + long: "Year 2017", + short: "2017", }, - "_2018": { - "id": "year_2018", - "long": "Year 2018", - "short": "2018" + _2018: { + id: "year_2018", + long: "Year 2018", + short: "2018", }, - "_2019": { - "id": "year_2019", - "long": "Year 2019", - "short": "2019" + _2019: { + id: "year_2019", + long: "Year 2019", + short: "2019", }, - "_2020": { - "id": "year_2020", - "long": "Year 2020", - "short": "2020" + _2020: { + id: "year_2020", + long: "Year 2020", + short: "2020", }, - "_2021": { - "id": "year_2021", - "long": "Year 2021", - "short": "2021" + _2021: { + id: "year_2021", + long: "Year 2021", + short: "2021", }, - "_2022": { - "id": "year_2022", - "long": "Year 2022", - "short": "2022" + _2022: { + id: "year_2022", + long: "Year 2022", + short: "2022", }, - "_2023": { - "id": "year_2023", - "long": "Year 2023", - "short": "2023" + _2023: { + id: "year_2023", + long: "Year 2023", + short: "2023", }, - "_2024": { - "id": "year_2024", - "long": "Year 2024", - "short": "2024" + _2024: { + id: "year_2024", + long: "Year 2024", + short: "2024", }, - "_2025": { - "id": "year_2025", - "long": "Year 2025", - "short": "2025" + _2025: { + id: "year_2025", + long: "Year 2025", + short: "2025", + }, + _2026: { + id: "year_2026", + long: "Year 2026", + short: "2026", }, - "_2026": { - "id": "year_2026", - "long": "Year 2026", - "short": "2026" - } }); SPENDABLE_TYPE_NAMES = /** @type {const} */ ({ - "empty": { - "id": "empty_outputs", - "long": "Empty Output", - "short": "Empty" + empty: { + id: "empty_outputs", + long: "Empty Output", + short: "Empty", }, - "p2a": { - "id": "p2a", - "long": "Pay to Anchor", - "short": "P2A" + p2a: { + id: "p2a", + long: "Pay to Anchor", + short: "P2A", }, - "p2ms": { - "id": "p2ms", - "long": "Pay to Multisig", - "short": "P2MS" + p2ms: { + id: "p2ms", + long: "Pay to Multisig", + short: "P2MS", }, - "p2pk33": { - "id": "p2pk33", - "long": "Pay to Public Key (33 bytes)", - "short": "P2PK33" + p2pk33: { + id: "p2pk33", + long: "Pay to Public Key (33 bytes)", + short: "P2PK33", }, - "p2pk65": { - "id": "p2pk65", - "long": "Pay to Public Key (65 bytes)", - "short": "P2PK65" + p2pk65: { + id: "p2pk65", + long: "Pay to Public Key (65 bytes)", + short: "P2PK65", }, - "p2pkh": { - "id": "p2pkh", - "long": "Pay to Public Key Hash", - "short": "P2PKH" + p2pkh: { + id: "p2pkh", + long: "Pay to Public Key Hash", + short: "P2PKH", }, - "p2sh": { - "id": "p2sh", - "long": "Pay to Script Hash", - "short": "P2SH" + p2sh: { + id: "p2sh", + long: "Pay to Script Hash", + short: "P2SH", }, - "p2tr": { - "id": "p2tr", - "long": "Pay to Taproot", - "short": "P2TR" + p2tr: { + id: "p2tr", + long: "Pay to Taproot", + short: "P2TR", }, - "p2wpkh": { - "id": "p2wpkh", - "long": "Pay to Witness Public Key Hash", - "short": "P2WPKH" + p2wpkh: { + id: "p2wpkh", + long: "Pay to Witness Public Key Hash", + short: "P2WPKH", }, - "p2wsh": { - "id": "p2wsh", - "long": "Pay to Witness Script Hash", - "short": "P2WSH" + p2wsh: { + id: "p2wsh", + long: "Pay to Witness Script Hash", + short: "P2WSH", + }, + unknown: { + id: "unknown_outputs", + long: "Unknown Output Type", + short: "Unknown", }, - "unknown": { - "id": "unknown_outputs", - "long": "Unknown Output Type", - "short": "Unknown" - } }); AGE_RANGE_NAMES = /** @type {const} */ ({ - "_10yTo12y": { - "id": "at_least_10y_up_to_12y_old", - "long": "10 to 12 Years Old", - "short": "10y-12y" + _10yTo12y: { + id: "at_least_10y_up_to_12y_old", + long: "10 to 12 Years Old", + short: "10y-12y", }, - "_12yTo15y": { - "id": "at_least_12y_up_to_15y_old", - "long": "12 to 15 Years Old", - "short": "12y-15y" + _12yTo15y: { + id: "at_least_12y_up_to_15y_old", + long: "12 to 15 Years Old", + short: "12y-15y", }, - "_1dTo1w": { - "id": "at_least_1d_up_to_1w_old", - "long": "1 Day to 1 Week Old", - "short": "1d-1w" + _1dTo1w: { + id: "at_least_1d_up_to_1w_old", + long: "1 Day to 1 Week Old", + short: "1d-1w", }, - "_1hTo1d": { - "id": "at_least_1h_up_to_1d_old", - "long": "1 Hour to 1 Day Old", - "short": "1h-1d" + _1hTo1d: { + id: "at_least_1h_up_to_1d_old", + long: "1 Hour to 1 Day Old", + short: "1h-1d", }, - "_1mTo2m": { - "id": "at_least_1m_up_to_2m_old", - "long": "1 to 2 Months Old", - "short": "1m-2m" + _1mTo2m: { + id: "at_least_1m_up_to_2m_old", + long: "1 to 2 Months Old", + short: "1m-2m", }, - "_1wTo1m": { - "id": "at_least_1w_up_to_1m_old", - "long": "1 Week to 1 Month Old", - "short": "1w-1m" + _1wTo1m: { + id: "at_least_1w_up_to_1m_old", + long: "1 Week to 1 Month Old", + short: "1w-1m", }, - "_1yTo2y": { - "id": "at_least_1y_up_to_2y_old", - "long": "1 to 2 Years Old", - "short": "1y-2y" + _1yTo2y: { + id: "at_least_1y_up_to_2y_old", + long: "1 to 2 Years Old", + short: "1y-2y", }, - "_2mTo3m": { - "id": "at_least_2m_up_to_3m_old", - "long": "2 to 3 Months Old", - "short": "2m-3m" + _2mTo3m: { + id: "at_least_2m_up_to_3m_old", + long: "2 to 3 Months Old", + short: "2m-3m", }, - "_2yTo3y": { - "id": "at_least_2y_up_to_3y_old", - "long": "2 to 3 Years Old", - "short": "2y-3y" + _2yTo3y: { + id: "at_least_2y_up_to_3y_old", + long: "2 to 3 Years Old", + short: "2y-3y", }, - "_3mTo4m": { - "id": "at_least_3m_up_to_4m_old", - "long": "3 to 4 Months Old", - "short": "3m-4m" + _3mTo4m: { + id: "at_least_3m_up_to_4m_old", + long: "3 to 4 Months Old", + short: "3m-4m", }, - "_3yTo4y": { - "id": "at_least_3y_up_to_4y_old", - "long": "3 to 4 Years Old", - "short": "3y-4y" + _3yTo4y: { + id: "at_least_3y_up_to_4y_old", + long: "3 to 4 Years Old", + short: "3y-4y", }, - "_4mTo5m": { - "id": "at_least_4m_up_to_5m_old", - "long": "4 to 5 Months Old", - "short": "4m-5m" + _4mTo5m: { + id: "at_least_4m_up_to_5m_old", + long: "4 to 5 Months Old", + short: "4m-5m", }, - "_4yTo5y": { - "id": "at_least_4y_up_to_5y_old", - "long": "4 to 5 Years Old", - "short": "4y-5y" + _4yTo5y: { + id: "at_least_4y_up_to_5y_old", + long: "4 to 5 Years Old", + short: "4y-5y", }, - "_5mTo6m": { - "id": "at_least_5m_up_to_6m_old", - "long": "5 to 6 Months Old", - "short": "5m-6m" + _5mTo6m: { + id: "at_least_5m_up_to_6m_old", + long: "5 to 6 Months Old", + short: "5m-6m", }, - "_5yTo6y": { - "id": "at_least_5y_up_to_6y_old", - "long": "5 to 6 Years Old", - "short": "5y-6y" + _5yTo6y: { + id: "at_least_5y_up_to_6y_old", + long: "5 to 6 Years Old", + short: "5y-6y", }, - "_6mTo1y": { - "id": "at_least_6m_up_to_1y_old", - "long": "6 Months to 1 Year Old", - "short": "6m-1y" + _6mTo1y: { + id: "at_least_6m_up_to_1y_old", + long: "6 Months to 1 Year Old", + short: "6m-1y", }, - "_6yTo7y": { - "id": "at_least_6y_up_to_7y_old", - "long": "6 to 7 Years Old", - "short": "6y-7y" + _6yTo7y: { + id: "at_least_6y_up_to_7y_old", + long: "6 to 7 Years Old", + short: "6y-7y", }, - "_7yTo8y": { - "id": "at_least_7y_up_to_8y_old", - "long": "7 to 8 Years Old", - "short": "7y-8y" + _7yTo8y: { + id: "at_least_7y_up_to_8y_old", + long: "7 to 8 Years Old", + short: "7y-8y", }, - "_8yTo10y": { - "id": "at_least_8y_up_to_10y_old", - "long": "8 to 10 Years Old", - "short": "8y-10y" + _8yTo10y: { + id: "at_least_8y_up_to_10y_old", + long: "8 to 10 Years Old", + short: "8y-10y", }, - "from15y": { - "id": "at_least_15y_old", - "long": "15+ Years Old", - "short": "15y+" + from15y: { + id: "at_least_15y_old", + long: "15+ Years Old", + short: "15y+", + }, + upTo1h: { + id: "up_to_1h_old", + long: "Up to 1 Hour Old", + short: "<1h", }, - "upTo1h": { - "id": "up_to_1h_old", - "long": "Up to 1 Hour Old", - "short": "<1h" - } }); MAX_AGE_NAMES = /** @type {const} */ ({ - "_10y": { - "id": "up_to_10y_old", - "long": "Up to 10 Years Old", - "short": "<10y" + _10y: { + id: "up_to_10y_old", + long: "Up to 10 Years Old", + short: "<10y", }, - "_12y": { - "id": "up_to_12y_old", - "long": "Up to 12 Years Old", - "short": "<12y" + _12y: { + id: "up_to_12y_old", + long: "Up to 12 Years Old", + short: "<12y", }, - "_15y": { - "id": "up_to_15y_old", - "long": "Up to 15 Years Old", - "short": "<15y" + _15y: { + id: "up_to_15y_old", + long: "Up to 15 Years Old", + short: "<15y", }, - "_1m": { - "id": "up_to_1m_old", - "long": "Up to 1 Month Old", - "short": "<1m" + _1m: { + id: "up_to_1m_old", + long: "Up to 1 Month Old", + short: "<1m", }, - "_1w": { - "id": "up_to_1w_old", - "long": "Up to 1 Week Old", - "short": "<1w" + _1w: { + id: "up_to_1w_old", + long: "Up to 1 Week Old", + short: "<1w", }, - "_1y": { - "id": "up_to_1y_old", - "long": "Up to 1 Year Old", - "short": "<1y" + _1y: { + id: "up_to_1y_old", + long: "Up to 1 Year Old", + short: "<1y", }, - "_2m": { - "id": "up_to_2m_old", - "long": "Up to 2 Months Old", - "short": "<2m" + _2m: { + id: "up_to_2m_old", + long: "Up to 2 Months Old", + short: "<2m", }, - "_2y": { - "id": "up_to_2y_old", - "long": "Up to 2 Years Old", - "short": "<2y" + _2y: { + id: "up_to_2y_old", + long: "Up to 2 Years Old", + short: "<2y", }, - "_3m": { - "id": "up_to_3m_old", - "long": "Up to 3 Months Old", - "short": "<3m" + _3m: { + id: "up_to_3m_old", + long: "Up to 3 Months Old", + short: "<3m", }, - "_3y": { - "id": "up_to_3y_old", - "long": "Up to 3 Years Old", - "short": "<3y" + _3y: { + id: "up_to_3y_old", + long: "Up to 3 Years Old", + short: "<3y", }, - "_4m": { - "id": "up_to_4m_old", - "long": "Up to 4 Months Old", - "short": "<4m" + _4m: { + id: "up_to_4m_old", + long: "Up to 4 Months Old", + short: "<4m", }, - "_4y": { - "id": "up_to_4y_old", - "long": "Up to 4 Years Old", - "short": "<4y" + _4y: { + id: "up_to_4y_old", + long: "Up to 4 Years Old", + short: "<4y", }, - "_5m": { - "id": "up_to_5m_old", - "long": "Up to 5 Months Old", - "short": "<5m" + _5m: { + id: "up_to_5m_old", + long: "Up to 5 Months Old", + short: "<5m", }, - "_5y": { - "id": "up_to_5y_old", - "long": "Up to 5 Years Old", - "short": "<5y" + _5y: { + id: "up_to_5y_old", + long: "Up to 5 Years Old", + short: "<5y", }, - "_6m": { - "id": "up_to_6m_old", - "long": "Up to 6 Months Old", - "short": "<6m" + _6m: { + id: "up_to_6m_old", + long: "Up to 6 Months Old", + short: "<6m", }, - "_6y": { - "id": "up_to_6y_old", - "long": "Up to 6 Years Old", - "short": "<6y" + _6y: { + id: "up_to_6y_old", + long: "Up to 6 Years Old", + short: "<6y", }, - "_7y": { - "id": "up_to_7y_old", - "long": "Up to 7 Years Old", - "short": "<7y" + _7y: { + id: "up_to_7y_old", + long: "Up to 7 Years Old", + short: "<7y", + }, + _8y: { + id: "up_to_8y_old", + long: "Up to 8 Years Old", + short: "<8y", }, - "_8y": { - "id": "up_to_8y_old", - "long": "Up to 8 Years Old", - "short": "<8y" - } }); MIN_AGE_NAMES = /** @type {const} */ ({ - "_10y": { - "id": "at_least_10y_old", - "long": "At Least 10 Years Old", - "short": "10y+" + _10y: { + id: "at_least_10y_old", + long: "At Least 10 Years Old", + short: "10y+", }, - "_12y": { - "id": "at_least_12y_old", - "long": "At Least 12 Years Old", - "short": "12y+" + _12y: { + id: "at_least_12y_old", + long: "At Least 12 Years Old", + short: "12y+", }, - "_1d": { - "id": "at_least_1d_old", - "long": "At Least 1 Day Old", - "short": "1d+" + _1d: { + id: "at_least_1d_old", + long: "At Least 1 Day Old", + short: "1d+", }, - "_1m": { - "id": "at_least_1m_old", - "long": "At Least 1 Month Old", - "short": "1m+" + _1m: { + id: "at_least_1m_old", + long: "At Least 1 Month Old", + short: "1m+", }, - "_1w": { - "id": "at_least_1w_old", - "long": "At Least 1 Week Old", - "short": "1w+" + _1w: { + id: "at_least_1w_old", + long: "At Least 1 Week Old", + short: "1w+", }, - "_1y": { - "id": "at_least_1y_old", - "long": "At Least 1 Year Old", - "short": "1y+" + _1y: { + id: "at_least_1y_old", + long: "At Least 1 Year Old", + short: "1y+", }, - "_2m": { - "id": "at_least_2m_old", - "long": "At Least 2 Months Old", - "short": "2m+" + _2m: { + id: "at_least_2m_old", + long: "At Least 2 Months Old", + short: "2m+", }, - "_2y": { - "id": "at_least_2y_old", - "long": "At Least 2 Years Old", - "short": "2y+" + _2y: { + id: "at_least_2y_old", + long: "At Least 2 Years Old", + short: "2y+", }, - "_3m": { - "id": "at_least_3m_old", - "long": "At Least 3 Months Old", - "short": "3m+" + _3m: { + id: "at_least_3m_old", + long: "At Least 3 Months Old", + short: "3m+", }, - "_3y": { - "id": "at_least_3y_old", - "long": "At Least 3 Years Old", - "short": "3y+" + _3y: { + id: "at_least_3y_old", + long: "At Least 3 Years Old", + short: "3y+", }, - "_4m": { - "id": "at_least_4m_old", - "long": "At Least 4 Months Old", - "short": "4m+" + _4m: { + id: "at_least_4m_old", + long: "At Least 4 Months Old", + short: "4m+", }, - "_4y": { - "id": "at_least_4y_old", - "long": "At Least 4 Years Old", - "short": "4y+" + _4y: { + id: "at_least_4y_old", + long: "At Least 4 Years Old", + short: "4y+", }, - "_5m": { - "id": "at_least_5m_old", - "long": "At Least 5 Months Old", - "short": "5m+" + _5m: { + id: "at_least_5m_old", + long: "At Least 5 Months Old", + short: "5m+", }, - "_5y": { - "id": "at_least_5y_old", - "long": "At Least 5 Years Old", - "short": "5y+" + _5y: { + id: "at_least_5y_old", + long: "At Least 5 Years Old", + short: "5y+", }, - "_6m": { - "id": "at_least_6m_old", - "long": "At Least 6 Months Old", - "short": "6m+" + _6m: { + id: "at_least_6m_old", + long: "At Least 6 Months Old", + short: "6m+", }, - "_6y": { - "id": "at_least_6y_old", - "long": "At Least 6 Years Old", - "short": "6y+" + _6y: { + id: "at_least_6y_old", + long: "At Least 6 Years Old", + short: "6y+", }, - "_7y": { - "id": "at_least_7y_old", - "long": "At Least 7 Years Old", - "short": "7y+" + _7y: { + id: "at_least_7y_old", + long: "At Least 7 Years Old", + short: "7y+", + }, + _8y: { + id: "at_least_8y_old", + long: "At Least 8 Years Old", + short: "8y+", }, - "_8y": { - "id": "at_least_8y_old", - "long": "At Least 8 Years Old", - "short": "8y+" - } }); AMOUNT_RANGE_NAMES = /** @type {const} */ ({ - "_0sats": { - "id": "with_0sats", - "long": "0 Sats", - "short": "0 sats" + _0sats: { + id: "with_0sats", + long: "0 Sats", + short: "0 sats", }, - "_100btcTo1kBtc": { - "id": "above_100btc_under_1k_btc", - "long": "100 to 1K BTC", - "short": "100-1k BTC" + _100btcTo1kBtc: { + id: "above_100btc_under_1k_btc", + long: "100 to 1K BTC", + short: "100-1k BTC", }, - "_100kBtcOrMore": { - "id": "above_100k_btc", - "long": "100K+ BTC", - "short": "100k+ BTC" + _100kBtcOrMore: { + id: "above_100k_btc", + long: "100K+ BTC", + short: "100k+ BTC", }, - "_100kSatsTo1mSats": { - "id": "above_100k_sats_under_1m_sats", - "long": "100K to 1M Sats", - "short": "100k-1M sats" + _100kSatsTo1mSats: { + id: "above_100k_sats_under_1m_sats", + long: "100K to 1M Sats", + short: "100k-1M sats", }, - "_100satsTo1kSats": { - "id": "above_100sats_under_1k_sats", - "long": "100 to 1K Sats", - "short": "100-1k sats" + _100satsTo1kSats: { + id: "above_100sats_under_1k_sats", + long: "100 to 1K Sats", + short: "100-1k sats", }, - "_10btcTo100btc": { - "id": "above_10btc_under_100btc", - "long": "10 to 100 BTC", - "short": "10-100 BTC" + _10btcTo100btc: { + id: "above_10btc_under_100btc", + long: "10 to 100 BTC", + short: "10-100 BTC", }, - "_10kBtcTo100kBtc": { - "id": "above_10k_btc_under_100k_btc", - "long": "10K to 100K BTC", - "short": "10k-100k BTC" + _10kBtcTo100kBtc: { + id: "above_10k_btc_under_100k_btc", + long: "10K to 100K BTC", + short: "10k-100k BTC", }, - "_10kSatsTo100kSats": { - "id": "above_10k_sats_under_100k_sats", - "long": "10K to 100K Sats", - "short": "10k-100k sats" + _10kSatsTo100kSats: { + id: "above_10k_sats_under_100k_sats", + long: "10K to 100K Sats", + short: "10k-100k sats", }, - "_10mSatsTo1btc": { - "id": "above_10m_sats_under_1btc", - "long": "0.1 to 1 BTC", - "short": "0.1-1 BTC" + _10mSatsTo1btc: { + id: "above_10m_sats_under_1btc", + long: "0.1 to 1 BTC", + short: "0.1-1 BTC", }, - "_10satsTo100sats": { - "id": "above_10sats_under_100sats", - "long": "10 to 100 Sats", - "short": "10-100 sats" + _10satsTo100sats: { + id: "above_10sats_under_100sats", + long: "10 to 100 Sats", + short: "10-100 sats", }, - "_1btcTo10btc": { - "id": "above_1btc_under_10btc", - "long": "1 to 10 BTC", - "short": "1-10 BTC" + _1btcTo10btc: { + id: "above_1btc_under_10btc", + long: "1 to 10 BTC", + short: "1-10 BTC", }, - "_1kBtcTo10kBtc": { - "id": "above_1k_btc_under_10k_btc", - "long": "1K to 10K BTC", - "short": "1k-10k BTC" + _1kBtcTo10kBtc: { + id: "above_1k_btc_under_10k_btc", + long: "1K to 10K BTC", + short: "1k-10k BTC", }, - "_1kSatsTo10kSats": { - "id": "above_1k_sats_under_10k_sats", - "long": "1K to 10K Sats", - "short": "1k-10k sats" + _1kSatsTo10kSats: { + id: "above_1k_sats_under_10k_sats", + long: "1K to 10K Sats", + short: "1k-10k sats", }, - "_1mSatsTo10mSats": { - "id": "above_1m_sats_under_10m_sats", - "long": "1M to 10M Sats", - "short": "1M-10M sats" + _1mSatsTo10mSats: { + id: "above_1m_sats_under_10m_sats", + long: "1M to 10M Sats", + short: "1M-10M sats", + }, + _1satTo10sats: { + id: "above_1sat_under_10sats", + long: "1 to 10 Sats", + short: "1-10 sats", }, - "_1satTo10sats": { - "id": "above_1sat_under_10sats", - "long": "1 to 10 Sats", - "short": "1-10 sats" - } }); GE_AMOUNT_NAMES = /** @type {const} */ ({ - "_100btc": { - "id": "above_100btc", - "long": "Above 100 BTC", - "short": "100+ BTC" + _100btc: { + id: "above_100btc", + long: "Above 100 BTC", + short: "100+ BTC", }, - "_100kSats": { - "id": "above_100k_sats", - "long": "Above 100K Sats", - "short": "100k+ sats" + _100kSats: { + id: "above_100k_sats", + long: "Above 100K Sats", + short: "100k+ sats", }, - "_100sats": { - "id": "above_100sats", - "long": "Above 100 Sats", - "short": "100+ sats" + _100sats: { + id: "above_100sats", + long: "Above 100 Sats", + short: "100+ sats", }, - "_10btc": { - "id": "above_10btc", - "long": "Above 10 BTC", - "short": "10+ BTC" + _10btc: { + id: "above_10btc", + long: "Above 10 BTC", + short: "10+ BTC", }, - "_10kBtc": { - "id": "above_10k_btc", - "long": "Above 10K BTC", - "short": "10k+ BTC" + _10kBtc: { + id: "above_10k_btc", + long: "Above 10K BTC", + short: "10k+ BTC", }, - "_10kSats": { - "id": "above_10k_sats", - "long": "Above 10K Sats", - "short": "10k+ sats" + _10kSats: { + id: "above_10k_sats", + long: "Above 10K Sats", + short: "10k+ sats", }, - "_10mSats": { - "id": "above_10m_sats", - "long": "Above 0.1 BTC", - "short": "0.1+ BTC" + _10mSats: { + id: "above_10m_sats", + long: "Above 0.1 BTC", + short: "0.1+ BTC", }, - "_10sats": { - "id": "above_10sats", - "long": "Above 10 Sats", - "short": "10+ sats" + _10sats: { + id: "above_10sats", + long: "Above 10 Sats", + short: "10+ sats", }, - "_1btc": { - "id": "above_1btc", - "long": "Above 1 BTC", - "short": "1+ BTC" + _1btc: { + id: "above_1btc", + long: "Above 1 BTC", + short: "1+ BTC", }, - "_1kBtc": { - "id": "above_1k_btc", - "long": "Above 1K BTC", - "short": "1k+ BTC" + _1kBtc: { + id: "above_1k_btc", + long: "Above 1K BTC", + short: "1k+ BTC", }, - "_1kSats": { - "id": "above_1k_sats", - "long": "Above 1K Sats", - "short": "1k+ sats" + _1kSats: { + id: "above_1k_sats", + long: "Above 1K Sats", + short: "1k+ sats", }, - "_1mSats": { - "id": "above_1m_sats", - "long": "Above 1M Sats", - "short": "1M+ sats" + _1mSats: { + id: "above_1m_sats", + long: "Above 1M Sats", + short: "1M+ sats", + }, + _1sat: { + id: "above_1sat", + long: "Above 1 Sat", + short: "1+ sats", }, - "_1sat": { - "id": "above_1sat", - "long": "Above 1 Sat", - "short": "1+ sats" - } }); LT_AMOUNT_NAMES = /** @type {const} */ ({ - "_100btc": { - "id": "under_100btc", - "long": "Under 100 BTC", - "short": "<100 BTC" + _100btc: { + id: "under_100btc", + long: "Under 100 BTC", + short: "<100 BTC", }, - "_100kBtc": { - "id": "under_100k_btc", - "long": "Under 100K BTC", - "short": "<100k BTC" + _100kBtc: { + id: "under_100k_btc", + long: "Under 100K BTC", + short: "<100k BTC", }, - "_100kSats": { - "id": "under_100k_sats", - "long": "Under 100K Sats", - "short": "<100k sats" + _100kSats: { + id: "under_100k_sats", + long: "Under 100K Sats", + short: "<100k sats", }, - "_100sats": { - "id": "under_100sats", - "long": "Under 100 Sats", - "short": "<100 sats" + _100sats: { + id: "under_100sats", + long: "Under 100 Sats", + short: "<100 sats", }, - "_10btc": { - "id": "under_10btc", - "long": "Under 10 BTC", - "short": "<10 BTC" + _10btc: { + id: "under_10btc", + long: "Under 10 BTC", + short: "<10 BTC", }, - "_10kBtc": { - "id": "under_10k_btc", - "long": "Under 10K BTC", - "short": "<10k BTC" + _10kBtc: { + id: "under_10k_btc", + long: "Under 10K BTC", + short: "<10k BTC", }, - "_10kSats": { - "id": "under_10k_sats", - "long": "Under 10K Sats", - "short": "<10k sats" + _10kSats: { + id: "under_10k_sats", + long: "Under 10K Sats", + short: "<10k sats", }, - "_10mSats": { - "id": "under_10m_sats", - "long": "Under 0.1 BTC", - "short": "<0.1 BTC" + _10mSats: { + id: "under_10m_sats", + long: "Under 0.1 BTC", + short: "<0.1 BTC", }, - "_10sats": { - "id": "under_10sats", - "long": "Under 10 Sats", - "short": "<10 sats" + _10sats: { + id: "under_10sats", + long: "Under 10 Sats", + short: "<10 sats", }, - "_1btc": { - "id": "under_1btc", - "long": "Under 1 BTC", - "short": "<1 BTC" + _1btc: { + id: "under_1btc", + long: "Under 1 BTC", + short: "<1 BTC", }, - "_1kBtc": { - "id": "under_1k_btc", - "long": "Under 1K BTC", - "short": "<1k BTC" + _1kBtc: { + id: "under_1k_btc", + long: "Under 1K BTC", + short: "<1k BTC", }, - "_1kSats": { - "id": "under_1k_sats", - "long": "Under 1K Sats", - "short": "<1k sats" + _1kSats: { + id: "under_1k_sats", + long: "Under 1K Sats", + short: "<1k sats", + }, + _1mSats: { + id: "under_1m_sats", + long: "Under 1M Sats", + short: "<1M sats", }, - "_1mSats": { - "id": "under_1m_sats", - "long": "Under 1M Sats", - "short": "<1M sats" - } }); /** @@ -5364,7 +5911,7 @@ class BrkClient extends BrkClientBase { constructor(options) { super(options); /** @type {CatalogTree} */ - this.tree = this._buildTree(''); + this.tree = this._buildTree(""); } /** @@ -5375,939 +5922,1266 @@ class BrkClient extends BrkClientBase { _buildTree(basePath) { return { addresses: { - 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') + 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: createMetricPattern12(this, 'blockhash'), + blockhash: createMetricPattern12(this, "blockhash"), count: { - _1mBlockCount: createMetricPattern1(this, '1m_block_count'), - _1mStart: createMetricPattern12(this, '1m_start'), - _1wBlockCount: createMetricPattern1(this, '1w_block_count'), - _1wStart: createMetricPattern12(this, '1w_start'), - _1yBlockCount: createMetricPattern1(this, '1y_block_count'), - _1yStart: createMetricPattern12(this, '1y_start'), - _24hBlockCount: createMetricPattern1(this, '24h_block_count'), - _24hStart: createMetricPattern12(this, '24h_start'), - blockCount: createBlockCountPattern(this, 'block_count'), - blockCountTarget: createMetricPattern4(this, 'block_count_target') + _1mBlockCount: createMetricPattern1(this, "1m_block_count"), + _1mStart: createMetricPattern12(this, "1m_start"), + _1wBlockCount: createMetricPattern1(this, "1w_block_count"), + _1wStart: createMetricPattern12(this, "1w_start"), + _1yBlockCount: createMetricPattern1(this, "1y_block_count"), + _1yStart: createMetricPattern12(this, "1y_start"), + _24hBlockCount: createMetricPattern1(this, "24h_block_count"), + _24hStart: createMetricPattern12(this, "24h_start"), + blockCount: createBlockCountPattern(this, "block_count"), + blockCountTarget: createMetricPattern4(this, "block_count_target"), }, difficulty: { - base: createMetricPattern12(this, 'difficulty'), - blocksBeforeNextDifficultyAdjustment: createMetricPattern1(this, 'blocks_before_next_difficulty_adjustment'), - daysBeforeNextDifficultyAdjustment: createMetricPattern1(this, 'days_before_next_difficulty_adjustment'), - epoch: createMetricPattern4(this, 'difficultyepoch') + base: createMetricPattern12(this, "difficulty"), + blocksBeforeNextDifficultyAdjustment: createMetricPattern1( + this, + "blocks_before_next_difficulty_adjustment", + ), + daysBeforeNextDifficultyAdjustment: createMetricPattern1( + this, + "days_before_next_difficulty_adjustment", + ), + epoch: createMetricPattern4(this, "difficultyepoch"), }, halving: { - blocksBeforeNextHalving: createMetricPattern1(this, 'blocks_before_next_halving'), - daysBeforeNextHalving: createMetricPattern1(this, 'days_before_next_halving'), - epoch: createMetricPattern4(this, 'halvingepoch') + blocksBeforeNextHalving: createMetricPattern1( + this, + "blocks_before_next_halving", + ), + daysBeforeNextHalving: createMetricPattern1( + this, + "days_before_next_halving", + ), + 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') + 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"), }, mining: { - difficulty: createMetricPattern2(this, 'difficulty'), - difficultyAdjustment: createMetricPattern1(this, 'difficulty_adjustment'), - difficultyAsHash: createMetricPattern1(this, 'difficulty_as_hash'), - hashPricePhs: createMetricPattern1(this, 'hash_price_phs'), - hashPricePhsMin: createMetricPattern1(this, 'hash_price_phs_min'), - hashPriceRebound: createMetricPattern1(this, 'hash_price_rebound'), - hashPriceThs: createMetricPattern1(this, 'hash_price_ths'), - hashPriceThsMin: createMetricPattern1(this, 'hash_price_ths_min'), - hashRate: createMetricPattern1(this, 'hash_rate'), - hashRate1mSma: createMetricPattern4(this, 'hash_rate_1m_sma'), - hashRate1wSma: createMetricPattern4(this, 'hash_rate_1w_sma'), - hashRate1ySma: createMetricPattern4(this, 'hash_rate_1y_sma'), - hashRate2mSma: createMetricPattern4(this, 'hash_rate_2m_sma'), - hashValuePhs: createMetricPattern1(this, 'hash_value_phs'), - hashValuePhsMin: createMetricPattern1(this, 'hash_value_phs_min'), - hashValueRebound: createMetricPattern1(this, 'hash_value_rebound'), - hashValueThs: createMetricPattern1(this, 'hash_value_ths'), - hashValueThsMin: createMetricPattern1(this, 'hash_value_ths_min') + difficulty: createMetricPattern2(this, "difficulty"), + difficultyAdjustment: createMetricPattern1( + this, + "difficulty_adjustment", + ), + difficultyAsHash: createMetricPattern1(this, "difficulty_as_hash"), + hashPricePhs: createMetricPattern1(this, "hash_price_phs"), + hashPricePhsMin: createMetricPattern1(this, "hash_price_phs_min"), + hashPriceRebound: createMetricPattern1(this, "hash_price_rebound"), + hashPriceThs: createMetricPattern1(this, "hash_price_ths"), + hashPriceThsMin: createMetricPattern1(this, "hash_price_ths_min"), + hashRate: createMetricPattern1(this, "hash_rate"), + hashRate1mSma: createMetricPattern4(this, "hash_rate_1m_sma"), + hashRate1wSma: createMetricPattern4(this, "hash_rate_1w_sma"), + hashRate1ySma: createMetricPattern4(this, "hash_rate_1y_sma"), + hashRate2mSma: createMetricPattern4(this, "hash_rate_2m_sma"), + hashValuePhs: createMetricPattern1(this, "hash_value_phs"), + hashValuePhsMin: createMetricPattern1(this, "hash_value_phs_min"), + hashValueRebound: createMetricPattern1(this, "hash_value_rebound"), + hashValueThs: createMetricPattern1(this, "hash_value_ths"), + hashValueThsMin: createMetricPattern1(this, "hash_value_ths_min"), }, rewards: { - _24hCoinbaseSum: create_24hCoinbaseSumPattern(this, '24h_coinbase_sum'), - coinbase: createCoinbasePattern(this, 'coinbase'), - feeDominance: createMetricPattern7(this, 'fee_dominance'), - subsidy: createCoinbasePattern(this, 'subsidy'), - subsidyDominance: createMetricPattern7(this, 'subsidy_dominance'), - subsidyUsd1ySma: createMetricPattern4(this, 'subsidy_usd_1y_sma'), - unclaimedRewards: createUnclaimedRewardsPattern(this, 'unclaimed_rewards') + _24hCoinbaseSum: create_24hCoinbaseSumPattern( + this, + "24h_coinbase_sum", + ), + coinbase: createCoinbasePattern(this, "coinbase"), + feeDominance: createMetricPattern7(this, "fee_dominance"), + subsidy: createCoinbasePattern(this, "subsidy"), + subsidyDominance: createMetricPattern7(this, "subsidy_dominance"), + subsidyUsd1ySma: createMetricPattern4(this, "subsidy_usd_1y_sma"), + unclaimedRewards: createUnclaimedRewardsPattern( + this, + "unclaimed_rewards", + ), }, size: { - size: createSizePattern(this, 'block_size'), + 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') - } + 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: createMetricPattern12(this, 'date'), - dateFixed: createMetricPattern12(this, 'date_fixed'), - timestamp: createMetricPattern2(this, 'timestamp'), - timestampFixed: createMetricPattern12(this, 'timestamp_fixed') + date: createMetricPattern12(this, "date"), + dateFixed: createMetricPattern12(this, "date_fixed"), + timestamp: createMetricPattern2(this, "timestamp"), + timestampFixed: createMetricPattern12(this, "timestamp_fixed"), }, - timestamp: createMetricPattern12(this, 'timestamp'), - totalSize: createMetricPattern12(this, 'total_size'), + timestamp: createMetricPattern12(this, "timestamp"), + totalSize: createMetricPattern12(this, "total_size"), weight: { - base: createMetricPattern12(this, 'weight'), - fullness: createBitcoinPattern(this, 'block_fullness'), - weight: createSizePattern(this, 'block_weight') - } + base: createMetricPattern12(this, "weight"), + fullness: createBitcoinPattern(this, "block_fullness"), + weight: createSizePattern(this, "block_weight"), + }, }, cointime: { activity: { - activityToVaultednessRatio: createMetricPattern1(this, 'activity_to_vaultedness_ratio'), - coinblocksCreated: createBlockCountPattern(this, 'coinblocks_created'), - coinblocksStored: createBlockCountPattern(this, 'coinblocks_stored'), - liveliness: createMetricPattern1(this, 'liveliness'), - vaultedness: createMetricPattern1(this, 'vaultedness') + activityToVaultednessRatio: createMetricPattern1( + this, + "activity_to_vaultedness_ratio", + ), + coinblocksCreated: createBlockCountPattern( + this, + "coinblocks_created", + ), + coinblocksStored: createBlockCountPattern(this, "coinblocks_stored"), + liveliness: createMetricPattern1(this, "liveliness"), + vaultedness: createMetricPattern1(this, "vaultedness"), }, adjusted: { - cointimeAdjInflationRate: createMetricPattern4(this, 'cointime_adj_inflation_rate'), - cointimeAdjTxBtcVelocity: createMetricPattern4(this, 'cointime_adj_tx_btc_velocity'), - cointimeAdjTxUsdVelocity: createMetricPattern4(this, 'cointime_adj_tx_usd_velocity') + cointimeAdjInflationRate: createMetricPattern4( + this, + "cointime_adj_inflation_rate", + ), + cointimeAdjTxBtcVelocity: createMetricPattern4( + this, + "cointime_adj_tx_btc_velocity", + ), + cointimeAdjTxUsdVelocity: createMetricPattern4( + this, + "cointime_adj_tx_usd_velocity", + ), }, cap: { - activeCap: createMetricPattern1(this, 'active_cap'), - cointimeCap: createMetricPattern1(this, 'cointime_cap'), - investorCap: createMetricPattern1(this, 'investor_cap'), - thermoCap: createMetricPattern1(this, 'thermo_cap'), - vaultedCap: createMetricPattern1(this, 'vaulted_cap') + activeCap: createMetricPattern1(this, "active_cap"), + cointimeCap: createMetricPattern1(this, "cointime_cap"), + investorCap: createMetricPattern1(this, "investor_cap"), + thermoCap: createMetricPattern1(this, "thermo_cap"), + vaultedCap: createMetricPattern1(this, "vaulted_cap"), }, pricing: { - activePrice: createMetricPattern1(this, 'active_price'), - activePriceRatio: createActivePriceRatioPattern(this, 'active_price_ratio'), - cointimePrice: createMetricPattern1(this, 'cointime_price'), - cointimePriceRatio: createActivePriceRatioPattern(this, 'cointime_price_ratio'), - trueMarketMean: createMetricPattern1(this, 'true_market_mean'), - trueMarketMeanRatio: createActivePriceRatioPattern(this, 'true_market_mean_ratio'), - vaultedPrice: createMetricPattern1(this, 'vaulted_price'), - vaultedPriceRatio: createActivePriceRatioPattern(this, 'vaulted_price_ratio') + activePrice: createMetricPattern1(this, "active_price"), + activePriceRatio: createActivePriceRatioPattern( + this, + "active_price_ratio", + ), + cointimePrice: createMetricPattern1(this, "cointime_price"), + cointimePriceRatio: createActivePriceRatioPattern( + this, + "cointime_price_ratio", + ), + trueMarketMean: createMetricPattern1(this, "true_market_mean"), + trueMarketMeanRatio: createActivePriceRatioPattern( + this, + "true_market_mean_ratio", + ), + vaultedPrice: createMetricPattern1(this, "vaulted_price"), + vaultedPriceRatio: createActivePriceRatioPattern( + this, + "vaulted_price_ratio", + ), }, supply: { - activeSupply: create_24hCoinbaseSumPattern(this, 'active_supply'), - vaultedSupply: create_24hCoinbaseSumPattern(this, 'vaulted_supply') + activeSupply: create_24hCoinbaseSumPattern(this, "active_supply"), + vaultedSupply: create_24hCoinbaseSumPattern(this, "vaulted_supply"), }, value: { - cointimeValueCreated: createBlockCountPattern(this, 'cointime_value_created'), - cointimeValueDestroyed: createBlockCountPattern(this, 'cointime_value_destroyed'), - cointimeValueStored: createBlockCountPattern(this, 'cointime_value_stored') - } + cointimeValueCreated: createBlockCountPattern( + this, + "cointime_value_created", + ), + cointimeValueDestroyed: createBlockCountPattern( + this, + "cointime_value_destroyed", + ), + cointimeValueStored: createBlockCountPattern( + this, + "cointime_value_stored", + ), + }, }, constants: { - constant0: createMetricPattern3(this, 'constant_0'), - constant1: createMetricPattern3(this, 'constant_1'), - constant100: createMetricPattern3(this, 'constant_100'), - constant2: createMetricPattern3(this, 'constant_2'), - constant20: createMetricPattern3(this, 'constant_20'), - constant3: createMetricPattern3(this, 'constant_3'), - constant30: createMetricPattern3(this, 'constant_30'), - constant382: createMetricPattern3(this, 'constant_38_2'), - constant4: createMetricPattern3(this, 'constant_4'), - constant50: createMetricPattern3(this, 'constant_50'), - constant600: createMetricPattern3(this, 'constant_600'), - constant618: createMetricPattern3(this, 'constant_61_8'), - constant70: createMetricPattern3(this, 'constant_70'), - constant80: createMetricPattern3(this, 'constant_80'), - constantMinus1: createMetricPattern3(this, 'constant_minus_1'), - constantMinus2: createMetricPattern3(this, 'constant_minus_2'), - constantMinus3: createMetricPattern3(this, 'constant_minus_3'), - constantMinus4: createMetricPattern3(this, 'constant_minus_4') + constant0: createMetricPattern3(this, "constant_0"), + constant1: createMetricPattern3(this, "constant_1"), + constant100: createMetricPattern3(this, "constant_100"), + constant2: createMetricPattern3(this, "constant_2"), + constant20: createMetricPattern3(this, "constant_20"), + constant3: createMetricPattern3(this, "constant_3"), + constant30: createMetricPattern3(this, "constant_30"), + constant382: createMetricPattern3(this, "constant_38_2"), + constant4: createMetricPattern3(this, "constant_4"), + constant50: createMetricPattern3(this, "constant_50"), + constant600: createMetricPattern3(this, "constant_600"), + constant618: createMetricPattern3(this, "constant_61_8"), + constant70: createMetricPattern3(this, "constant_70"), + constant80: createMetricPattern3(this, "constant_80"), + constantMinus1: createMetricPattern3(this, "constant_minus_1"), + constantMinus2: createMetricPattern3(this, "constant_minus_2"), + constantMinus3: createMetricPattern3(this, "constant_minus_3"), + constantMinus4: createMetricPattern3(this, "constant_minus_4"), }, distribution: { - addrCount: createAddrCountPattern(this, 'addr_count'), + addrCount: createAddrCountPattern(this, "addr_count"), addressCohorts: { amountRange: { - _0sats: create_0satsPattern(this, 'addrs_with_0sats'), - _100btcTo1kBtc: create_0satsPattern(this, 'addrs_above_100btc_under_1k_btc'), - _100kBtcOrMore: create_0satsPattern(this, 'addrs_above_100k_btc'), - _100kSatsTo1mSats: create_0satsPattern(this, 'addrs_above_100k_sats_under_1m_sats'), - _100satsTo1kSats: create_0satsPattern(this, 'addrs_above_100sats_under_1k_sats'), - _10btcTo100btc: create_0satsPattern(this, 'addrs_above_10btc_under_100btc'), - _10kBtcTo100kBtc: create_0satsPattern(this, 'addrs_above_10k_btc_under_100k_btc'), - _10kSatsTo100kSats: create_0satsPattern(this, 'addrs_above_10k_sats_under_100k_sats'), - _10mSatsTo1btc: create_0satsPattern(this, 'addrs_above_10m_sats_under_1btc'), - _10satsTo100sats: create_0satsPattern(this, 'addrs_above_10sats_under_100sats'), - _1btcTo10btc: create_0satsPattern(this, 'addrs_above_1btc_under_10btc'), - _1kBtcTo10kBtc: create_0satsPattern(this, 'addrs_above_1k_btc_under_10k_btc'), - _1kSatsTo10kSats: create_0satsPattern(this, 'addrs_above_1k_sats_under_10k_sats'), - _1mSatsTo10mSats: create_0satsPattern(this, 'addrs_above_1m_sats_under_10m_sats'), - _1satTo10sats: create_0satsPattern(this, 'addrs_above_1sat_under_10sats') + _0sats: create_0satsPattern(this, "addrs_with_0sats"), + _100btcTo1kBtc: create_0satsPattern( + this, + "addrs_above_100btc_under_1k_btc", + ), + _100kBtcOrMore: create_0satsPattern(this, "addrs_above_100k_btc"), + _100kSatsTo1mSats: create_0satsPattern( + this, + "addrs_above_100k_sats_under_1m_sats", + ), + _100satsTo1kSats: create_0satsPattern( + this, + "addrs_above_100sats_under_1k_sats", + ), + _10btcTo100btc: create_0satsPattern( + this, + "addrs_above_10btc_under_100btc", + ), + _10kBtcTo100kBtc: create_0satsPattern( + this, + "addrs_above_10k_btc_under_100k_btc", + ), + _10kSatsTo100kSats: create_0satsPattern( + this, + "addrs_above_10k_sats_under_100k_sats", + ), + _10mSatsTo1btc: create_0satsPattern( + this, + "addrs_above_10m_sats_under_1btc", + ), + _10satsTo100sats: create_0satsPattern( + this, + "addrs_above_10sats_under_100sats", + ), + _1btcTo10btc: create_0satsPattern( + this, + "addrs_above_1btc_under_10btc", + ), + _1kBtcTo10kBtc: create_0satsPattern( + this, + "addrs_above_1k_btc_under_10k_btc", + ), + _1kSatsTo10kSats: create_0satsPattern( + this, + "addrs_above_1k_sats_under_10k_sats", + ), + _1mSatsTo10mSats: create_0satsPattern( + this, + "addrs_above_1m_sats_under_10m_sats", + ), + _1satTo10sats: create_0satsPattern( + this, + "addrs_above_1sat_under_10sats", + ), }, geAmount: { - _100btc: create_0satsPattern(this, 'addrs_above_100btc'), - _100kSats: create_0satsPattern(this, 'addrs_above_100k_sats'), - _100sats: create_0satsPattern(this, 'addrs_above_100sats'), - _10btc: create_0satsPattern(this, 'addrs_above_10btc'), - _10kBtc: create_0satsPattern(this, 'addrs_above_10k_btc'), - _10kSats: create_0satsPattern(this, 'addrs_above_10k_sats'), - _10mSats: create_0satsPattern(this, 'addrs_above_10m_sats'), - _10sats: create_0satsPattern(this, 'addrs_above_10sats'), - _1btc: create_0satsPattern(this, 'addrs_above_1btc'), - _1kBtc: create_0satsPattern(this, 'addrs_above_1k_btc'), - _1kSats: create_0satsPattern(this, 'addrs_above_1k_sats'), - _1mSats: create_0satsPattern(this, 'addrs_above_1m_sats'), - _1sat: create_0satsPattern(this, 'addrs_above_1sat') + _100btc: create_0satsPattern(this, "addrs_above_100btc"), + _100kSats: create_0satsPattern(this, "addrs_above_100k_sats"), + _100sats: create_0satsPattern(this, "addrs_above_100sats"), + _10btc: create_0satsPattern(this, "addrs_above_10btc"), + _10kBtc: create_0satsPattern(this, "addrs_above_10k_btc"), + _10kSats: create_0satsPattern(this, "addrs_above_10k_sats"), + _10mSats: create_0satsPattern(this, "addrs_above_10m_sats"), + _10sats: create_0satsPattern(this, "addrs_above_10sats"), + _1btc: create_0satsPattern(this, "addrs_above_1btc"), + _1kBtc: create_0satsPattern(this, "addrs_above_1k_btc"), + _1kSats: create_0satsPattern(this, "addrs_above_1k_sats"), + _1mSats: create_0satsPattern(this, "addrs_above_1m_sats"), + _1sat: create_0satsPattern(this, "addrs_above_1sat"), }, ltAmount: { - _100btc: create_0satsPattern(this, 'addrs_under_100btc'), - _100kBtc: create_0satsPattern(this, 'addrs_under_100k_btc'), - _100kSats: create_0satsPattern(this, 'addrs_under_100k_sats'), - _100sats: create_0satsPattern(this, 'addrs_under_100sats'), - _10btc: create_0satsPattern(this, 'addrs_under_10btc'), - _10kBtc: create_0satsPattern(this, 'addrs_under_10k_btc'), - _10kSats: create_0satsPattern(this, 'addrs_under_10k_sats'), - _10mSats: create_0satsPattern(this, 'addrs_under_10m_sats'), - _10sats: create_0satsPattern(this, 'addrs_under_10sats'), - _1btc: create_0satsPattern(this, 'addrs_under_1btc'), - _1kBtc: create_0satsPattern(this, 'addrs_under_1k_btc'), - _1kSats: create_0satsPattern(this, 'addrs_under_1k_sats'), - _1mSats: create_0satsPattern(this, 'addrs_under_1m_sats') - } + _100btc: create_0satsPattern(this, "addrs_under_100btc"), + _100kBtc: create_0satsPattern(this, "addrs_under_100k_btc"), + _100kSats: create_0satsPattern(this, "addrs_under_100k_sats"), + _100sats: create_0satsPattern(this, "addrs_under_100sats"), + _10btc: create_0satsPattern(this, "addrs_under_10btc"), + _10kBtc: create_0satsPattern(this, "addrs_under_10k_btc"), + _10kSats: create_0satsPattern(this, "addrs_under_10k_sats"), + _10mSats: create_0satsPattern(this, "addrs_under_10m_sats"), + _10sats: create_0satsPattern(this, "addrs_under_10sats"), + _1btc: create_0satsPattern(this, "addrs_under_1btc"), + _1kBtc: create_0satsPattern(this, "addrs_under_1k_btc"), + _1kSats: create_0satsPattern(this, "addrs_under_1k_sats"), + _1mSats: create_0satsPattern(this, "addrs_under_1m_sats"), + }, }, addressesData: { - empty: createMetricPattern33(this, 'emptyaddressdata'), - loaded: createMetricPattern32(this, 'loadedaddressdata') + empty: createMetricPattern33(this, "emptyaddressdata"), + loaded: createMetricPattern32(this, "loadedaddressdata"), }, anyAddressIndexes: { - 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') + 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: createMetricPattern12(this, 'chain'), - emptyAddrCount: createAddrCountPattern(this, 'empty_addr_count'), - emptyaddressindex: createMetricPattern33(this, 'emptyaddressindex'), - loadedaddressindex: createMetricPattern32(this, 'loadedaddressindex'), + chainState: createMetricPattern12(this, "chain"), + emptyAddrCount: createAddrCountPattern(this, "empty_addr_count"), + emptyaddressindex: createMetricPattern33(this, "emptyaddressindex"), + loadedaddressindex: createMetricPattern32(this, "loadedaddressindex"), utxoCohorts: { ageRange: { - _10yTo12y: create_10yTo12yPattern(this, 'utxos_at_least_10y_up_to_12y_old'), - _12yTo15y: create_10yTo12yPattern(this, 'utxos_at_least_12y_up_to_15y_old'), - _1dTo1w: create_10yTo12yPattern(this, 'utxos_at_least_1d_up_to_1w_old'), - _1hTo1d: create_10yTo12yPattern(this, 'utxos_at_least_1h_up_to_1d_old'), - _1mTo2m: create_10yTo12yPattern(this, 'utxos_at_least_1m_up_to_2m_old'), - _1wTo1m: create_10yTo12yPattern(this, 'utxos_at_least_1w_up_to_1m_old'), - _1yTo2y: create_10yTo12yPattern(this, 'utxos_at_least_1y_up_to_2y_old'), - _2mTo3m: create_10yTo12yPattern(this, 'utxos_at_least_2m_up_to_3m_old'), - _2yTo3y: create_10yTo12yPattern(this, 'utxos_at_least_2y_up_to_3y_old'), - _3mTo4m: create_10yTo12yPattern(this, 'utxos_at_least_3m_up_to_4m_old'), - _3yTo4y: create_10yTo12yPattern(this, 'utxos_at_least_3y_up_to_4y_old'), - _4mTo5m: create_10yTo12yPattern(this, 'utxos_at_least_4m_up_to_5m_old'), - _4yTo5y: create_10yTo12yPattern(this, 'utxos_at_least_4y_up_to_5y_old'), - _5mTo6m: create_10yTo12yPattern(this, 'utxos_at_least_5m_up_to_6m_old'), - _5yTo6y: create_10yTo12yPattern(this, 'utxos_at_least_5y_up_to_6y_old'), - _6mTo1y: create_10yTo12yPattern(this, 'utxos_at_least_6m_up_to_1y_old'), - _6yTo7y: create_10yTo12yPattern(this, 'utxos_at_least_6y_up_to_7y_old'), - _7yTo8y: create_10yTo12yPattern(this, 'utxos_at_least_7y_up_to_8y_old'), - _8yTo10y: create_10yTo12yPattern(this, 'utxos_at_least_8y_up_to_10y_old'), - from15y: create_10yTo12yPattern(this, 'utxos_at_least_15y_old'), - upTo1h: create_10yTo12yPattern(this, 'utxos_up_to_1h_old') + _10yTo12y: create_10yTo12yPattern( + this, + "utxos_at_least_10y_up_to_12y_old", + ), + _12yTo15y: create_10yTo12yPattern( + this, + "utxos_at_least_12y_up_to_15y_old", + ), + _1dTo1w: create_10yTo12yPattern( + this, + "utxos_at_least_1d_up_to_1w_old", + ), + _1hTo1d: create_10yTo12yPattern( + this, + "utxos_at_least_1h_up_to_1d_old", + ), + _1mTo2m: create_10yTo12yPattern( + this, + "utxos_at_least_1m_up_to_2m_old", + ), + _1wTo1m: create_10yTo12yPattern( + this, + "utxos_at_least_1w_up_to_1m_old", + ), + _1yTo2y: create_10yTo12yPattern( + this, + "utxos_at_least_1y_up_to_2y_old", + ), + _2mTo3m: create_10yTo12yPattern( + this, + "utxos_at_least_2m_up_to_3m_old", + ), + _2yTo3y: create_10yTo12yPattern( + this, + "utxos_at_least_2y_up_to_3y_old", + ), + _3mTo4m: create_10yTo12yPattern( + this, + "utxos_at_least_3m_up_to_4m_old", + ), + _3yTo4y: create_10yTo12yPattern( + this, + "utxos_at_least_3y_up_to_4y_old", + ), + _4mTo5m: create_10yTo12yPattern( + this, + "utxos_at_least_4m_up_to_5m_old", + ), + _4yTo5y: create_10yTo12yPattern( + this, + "utxos_at_least_4y_up_to_5y_old", + ), + _5mTo6m: create_10yTo12yPattern( + this, + "utxos_at_least_5m_up_to_6m_old", + ), + _5yTo6y: create_10yTo12yPattern( + this, + "utxos_at_least_5y_up_to_6y_old", + ), + _6mTo1y: create_10yTo12yPattern( + this, + "utxos_at_least_6m_up_to_1y_old", + ), + _6yTo7y: create_10yTo12yPattern( + this, + "utxos_at_least_6y_up_to_7y_old", + ), + _7yTo8y: create_10yTo12yPattern( + this, + "utxos_at_least_7y_up_to_8y_old", + ), + _8yTo10y: create_10yTo12yPattern( + this, + "utxos_at_least_8y_up_to_10y_old", + ), + from15y: create_10yTo12yPattern(this, "utxos_at_least_15y_old"), + upTo1h: create_10yTo12yPattern(this, "utxos_up_to_1h_old"), }, all: { - activity: createActivityPattern2(this, ''), - costBasis: createCostBasisPattern2(this, ''), - outputs: createOutputsPattern(this, 'utxo_count'), - realized: createRealizedPattern3(this, ''), + activity: createActivityPattern2(this, ""), + costBasis: createCostBasisPattern2(this, ""), + outputs: createOutputsPattern(this, "utxo_count"), + realized: createRealizedPattern3(this, ""), relative: { - 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') + 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'), - unrealized: createUnrealizedPattern(this, '') + supply: createSupplyPattern2(this, "supply"), + unrealized: createUnrealizedPattern(this, ""), }, amountRange: { - _0sats: create_0satsPattern2(this, 'utxos_with_0sats'), - _100btcTo1kBtc: create_0satsPattern2(this, 'utxos_above_100btc_under_1k_btc'), - _100kBtcOrMore: create_0satsPattern2(this, 'utxos_above_100k_btc'), - _100kSatsTo1mSats: create_0satsPattern2(this, 'utxos_above_100k_sats_under_1m_sats'), - _100satsTo1kSats: create_0satsPattern2(this, 'utxos_above_100sats_under_1k_sats'), - _10btcTo100btc: create_0satsPattern2(this, 'utxos_above_10btc_under_100btc'), - _10kBtcTo100kBtc: create_0satsPattern2(this, 'utxos_above_10k_btc_under_100k_btc'), - _10kSatsTo100kSats: create_0satsPattern2(this, 'utxos_above_10k_sats_under_100k_sats'), - _10mSatsTo1btc: create_0satsPattern2(this, 'utxos_above_10m_sats_under_1btc'), - _10satsTo100sats: create_0satsPattern2(this, 'utxos_above_10sats_under_100sats'), - _1btcTo10btc: create_0satsPattern2(this, 'utxos_above_1btc_under_10btc'), - _1kBtcTo10kBtc: create_0satsPattern2(this, 'utxos_above_1k_btc_under_10k_btc'), - _1kSatsTo10kSats: create_0satsPattern2(this, 'utxos_above_1k_sats_under_10k_sats'), - _1mSatsTo10mSats: create_0satsPattern2(this, 'utxos_above_1m_sats_under_10m_sats'), - _1satTo10sats: create_0satsPattern2(this, 'utxos_above_1sat_under_10sats') + _0sats: create_0satsPattern2(this, "utxos_with_0sats"), + _100btcTo1kBtc: create_0satsPattern2( + this, + "utxos_above_100btc_under_1k_btc", + ), + _100kBtcOrMore: create_0satsPattern2(this, "utxos_above_100k_btc"), + _100kSatsTo1mSats: create_0satsPattern2( + this, + "utxos_above_100k_sats_under_1m_sats", + ), + _100satsTo1kSats: create_0satsPattern2( + this, + "utxos_above_100sats_under_1k_sats", + ), + _10btcTo100btc: create_0satsPattern2( + this, + "utxos_above_10btc_under_100btc", + ), + _10kBtcTo100kBtc: create_0satsPattern2( + this, + "utxos_above_10k_btc_under_100k_btc", + ), + _10kSatsTo100kSats: create_0satsPattern2( + this, + "utxos_above_10k_sats_under_100k_sats", + ), + _10mSatsTo1btc: create_0satsPattern2( + this, + "utxos_above_10m_sats_under_1btc", + ), + _10satsTo100sats: create_0satsPattern2( + this, + "utxos_above_10sats_under_100sats", + ), + _1btcTo10btc: create_0satsPattern2( + this, + "utxos_above_1btc_under_10btc", + ), + _1kBtcTo10kBtc: create_0satsPattern2( + this, + "utxos_above_1k_btc_under_10k_btc", + ), + _1kSatsTo10kSats: create_0satsPattern2( + this, + "utxos_above_1k_sats_under_10k_sats", + ), + _1mSatsTo10mSats: create_0satsPattern2( + this, + "utxos_above_1m_sats_under_10m_sats", + ), + _1satTo10sats: create_0satsPattern2( + this, + "utxos_above_1sat_under_10sats", + ), }, epoch: { - _0: create_0satsPattern2(this, 'epoch_0'), - _1: create_0satsPattern2(this, 'epoch_1'), - _2: create_0satsPattern2(this, 'epoch_2'), - _3: create_0satsPattern2(this, 'epoch_3'), - _4: create_0satsPattern2(this, 'epoch_4') + _0: create_0satsPattern2(this, "epoch_0"), + _1: create_0satsPattern2(this, "epoch_1"), + _2: create_0satsPattern2(this, "epoch_2"), + _3: create_0satsPattern2(this, "epoch_3"), + _4: create_0satsPattern2(this, "epoch_4"), }, geAmount: { - _100btc: create_100btcPattern(this, 'utxos_above_100btc'), - _100kSats: create_100btcPattern(this, 'utxos_above_100k_sats'), - _100sats: create_100btcPattern(this, 'utxos_above_100sats'), - _10btc: create_100btcPattern(this, 'utxos_above_10btc'), - _10kBtc: create_100btcPattern(this, 'utxos_above_10k_btc'), - _10kSats: create_100btcPattern(this, 'utxos_above_10k_sats'), - _10mSats: create_100btcPattern(this, 'utxos_above_10m_sats'), - _10sats: create_100btcPattern(this, 'utxos_above_10sats'), - _1btc: create_100btcPattern(this, 'utxos_above_1btc'), - _1kBtc: create_100btcPattern(this, 'utxos_above_1k_btc'), - _1kSats: create_100btcPattern(this, 'utxos_above_1k_sats'), - _1mSats: create_100btcPattern(this, 'utxos_above_1m_sats'), - _1sat: create_100btcPattern(this, 'utxos_above_1sat') + _100btc: create_100btcPattern(this, "utxos_above_100btc"), + _100kSats: create_100btcPattern(this, "utxos_above_100k_sats"), + _100sats: create_100btcPattern(this, "utxos_above_100sats"), + _10btc: create_100btcPattern(this, "utxos_above_10btc"), + _10kBtc: create_100btcPattern(this, "utxos_above_10k_btc"), + _10kSats: create_100btcPattern(this, "utxos_above_10k_sats"), + _10mSats: create_100btcPattern(this, "utxos_above_10m_sats"), + _10sats: create_100btcPattern(this, "utxos_above_10sats"), + _1btc: create_100btcPattern(this, "utxos_above_1btc"), + _1kBtc: create_100btcPattern(this, "utxos_above_1k_btc"), + _1kSats: create_100btcPattern(this, "utxos_above_1k_sats"), + _1mSats: create_100btcPattern(this, "utxos_above_1m_sats"), + _1sat: create_100btcPattern(this, "utxos_above_1sat"), }, ltAmount: { - _100btc: create_100btcPattern(this, 'utxos_under_100btc'), - _100kBtc: create_100btcPattern(this, 'utxos_under_100k_btc'), - _100kSats: create_100btcPattern(this, 'utxos_under_100k_sats'), - _100sats: create_100btcPattern(this, 'utxos_under_100sats'), - _10btc: create_100btcPattern(this, 'utxos_under_10btc'), - _10kBtc: create_100btcPattern(this, 'utxos_under_10k_btc'), - _10kSats: create_100btcPattern(this, 'utxos_under_10k_sats'), - _10mSats: create_100btcPattern(this, 'utxos_under_10m_sats'), - _10sats: create_100btcPattern(this, 'utxos_under_10sats'), - _1btc: create_100btcPattern(this, 'utxos_under_1btc'), - _1kBtc: create_100btcPattern(this, 'utxos_under_1k_btc'), - _1kSats: create_100btcPattern(this, 'utxos_under_1k_sats'), - _1mSats: create_100btcPattern(this, 'utxos_under_1m_sats') + _100btc: create_100btcPattern(this, "utxos_under_100btc"), + _100kBtc: create_100btcPattern(this, "utxos_under_100k_btc"), + _100kSats: create_100btcPattern(this, "utxos_under_100k_sats"), + _100sats: create_100btcPattern(this, "utxos_under_100sats"), + _10btc: create_100btcPattern(this, "utxos_under_10btc"), + _10kBtc: create_100btcPattern(this, "utxos_under_10k_btc"), + _10kSats: create_100btcPattern(this, "utxos_under_10k_sats"), + _10mSats: create_100btcPattern(this, "utxos_under_10m_sats"), + _10sats: create_100btcPattern(this, "utxos_under_10sats"), + _1btc: create_100btcPattern(this, "utxos_under_1btc"), + _1kBtc: create_100btcPattern(this, "utxos_under_1k_btc"), + _1kSats: create_100btcPattern(this, "utxos_under_1k_sats"), + _1mSats: create_100btcPattern(this, "utxos_under_1m_sats"), }, maxAge: { - _10y: create_10yPattern(this, 'utxos_up_to_10y_old'), - _12y: create_10yPattern(this, 'utxos_up_to_12y_old'), - _15y: create_10yPattern(this, 'utxos_up_to_15y_old'), - _1m: create_10yPattern(this, 'utxos_up_to_1m_old'), - _1w: create_10yPattern(this, 'utxos_up_to_1w_old'), - _1y: create_10yPattern(this, 'utxos_up_to_1y_old'), - _2m: create_10yPattern(this, 'utxos_up_to_2m_old'), - _2y: create_10yPattern(this, 'utxos_up_to_2y_old'), - _3m: create_10yPattern(this, 'utxos_up_to_3m_old'), - _3y: create_10yPattern(this, 'utxos_up_to_3y_old'), - _4m: create_10yPattern(this, 'utxos_up_to_4m_old'), - _4y: create_10yPattern(this, 'utxos_up_to_4y_old'), - _5m: create_10yPattern(this, 'utxos_up_to_5m_old'), - _5y: create_10yPattern(this, 'utxos_up_to_5y_old'), - _6m: create_10yPattern(this, 'utxos_up_to_6m_old'), - _6y: create_10yPattern(this, 'utxos_up_to_6y_old'), - _7y: create_10yPattern(this, 'utxos_up_to_7y_old'), - _8y: create_10yPattern(this, 'utxos_up_to_8y_old') + _10y: create_10yPattern(this, "utxos_up_to_10y_old"), + _12y: create_10yPattern(this, "utxos_up_to_12y_old"), + _15y: create_10yPattern(this, "utxos_up_to_15y_old"), + _1m: create_10yPattern(this, "utxos_up_to_1m_old"), + _1w: create_10yPattern(this, "utxos_up_to_1w_old"), + _1y: create_10yPattern(this, "utxos_up_to_1y_old"), + _2m: create_10yPattern(this, "utxos_up_to_2m_old"), + _2y: create_10yPattern(this, "utxos_up_to_2y_old"), + _3m: create_10yPattern(this, "utxos_up_to_3m_old"), + _3y: create_10yPattern(this, "utxos_up_to_3y_old"), + _4m: create_10yPattern(this, "utxos_up_to_4m_old"), + _4y: create_10yPattern(this, "utxos_up_to_4y_old"), + _5m: create_10yPattern(this, "utxos_up_to_5m_old"), + _5y: create_10yPattern(this, "utxos_up_to_5y_old"), + _6m: create_10yPattern(this, "utxos_up_to_6m_old"), + _6y: create_10yPattern(this, "utxos_up_to_6y_old"), + _7y: create_10yPattern(this, "utxos_up_to_7y_old"), + _8y: create_10yPattern(this, "utxos_up_to_8y_old"), }, minAge: { - _10y: create_100btcPattern(this, 'utxos_at_least_10y_old'), - _12y: create_100btcPattern(this, 'utxos_at_least_12y_old'), - _1d: create_100btcPattern(this, 'utxos_at_least_1d_old'), - _1m: create_100btcPattern(this, 'utxos_at_least_1m_old'), - _1w: create_100btcPattern(this, 'utxos_at_least_1w_old'), - _1y: create_100btcPattern(this, 'utxos_at_least_1y_old'), - _2m: create_100btcPattern(this, 'utxos_at_least_2m_old'), - _2y: create_100btcPattern(this, 'utxos_at_least_2y_old'), - _3m: create_100btcPattern(this, 'utxos_at_least_3m_old'), - _3y: create_100btcPattern(this, 'utxos_at_least_3y_old'), - _4m: create_100btcPattern(this, 'utxos_at_least_4m_old'), - _4y: create_100btcPattern(this, 'utxos_at_least_4y_old'), - _5m: create_100btcPattern(this, 'utxos_at_least_5m_old'), - _5y: create_100btcPattern(this, 'utxos_at_least_5y_old'), - _6m: create_100btcPattern(this, 'utxos_at_least_6m_old'), - _6y: create_100btcPattern(this, 'utxos_at_least_6y_old'), - _7y: create_100btcPattern(this, 'utxos_at_least_7y_old'), - _8y: create_100btcPattern(this, 'utxos_at_least_8y_old') + _10y: create_100btcPattern(this, "utxos_at_least_10y_old"), + _12y: create_100btcPattern(this, "utxos_at_least_12y_old"), + _1d: create_100btcPattern(this, "utxos_at_least_1d_old"), + _1m: create_100btcPattern(this, "utxos_at_least_1m_old"), + _1w: create_100btcPattern(this, "utxos_at_least_1w_old"), + _1y: create_100btcPattern(this, "utxos_at_least_1y_old"), + _2m: create_100btcPattern(this, "utxos_at_least_2m_old"), + _2y: create_100btcPattern(this, "utxos_at_least_2y_old"), + _3m: create_100btcPattern(this, "utxos_at_least_3m_old"), + _3y: create_100btcPattern(this, "utxos_at_least_3y_old"), + _4m: create_100btcPattern(this, "utxos_at_least_4m_old"), + _4y: create_100btcPattern(this, "utxos_at_least_4y_old"), + _5m: create_100btcPattern(this, "utxos_at_least_5m_old"), + _5y: create_100btcPattern(this, "utxos_at_least_5y_old"), + _6m: create_100btcPattern(this, "utxos_at_least_6m_old"), + _6y: create_100btcPattern(this, "utxos_at_least_6y_old"), + _7y: create_100btcPattern(this, "utxos_at_least_7y_old"), + _8y: create_100btcPattern(this, "utxos_at_least_8y_old"), }, term: { 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'), - unrealized: createUnrealizedPattern(this, 'lth') + 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"), + 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'), - unrealized: createUnrealizedPattern(this, 'sth') - } + 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"), + unrealized: createUnrealizedPattern(this, "sth"), + }, }, type: { - empty: create_0satsPattern2(this, 'empty_outputs'), - p2a: create_0satsPattern2(this, 'p2a'), - p2ms: create_0satsPattern2(this, 'p2ms'), - p2pk33: create_0satsPattern2(this, 'p2pk33'), - p2pk65: create_0satsPattern2(this, 'p2pk65'), - p2pkh: create_0satsPattern2(this, 'p2pkh'), - p2sh: create_0satsPattern2(this, 'p2sh'), - p2tr: create_0satsPattern2(this, 'p2tr'), - p2wpkh: create_0satsPattern2(this, 'p2wpkh'), - p2wsh: create_0satsPattern2(this, 'p2wsh'), - unknown: create_0satsPattern2(this, 'unknown_outputs') + empty: create_0satsPattern2(this, "empty_outputs"), + p2a: create_0satsPattern2(this, "p2a"), + p2ms: create_0satsPattern2(this, "p2ms"), + p2pk33: create_0satsPattern2(this, "p2pk33"), + p2pk65: create_0satsPattern2(this, "p2pk65"), + p2pkh: create_0satsPattern2(this, "p2pkh"), + p2sh: create_0satsPattern2(this, "p2sh"), + p2tr: create_0satsPattern2(this, "p2tr"), + p2wpkh: create_0satsPattern2(this, "p2wpkh"), + p2wsh: create_0satsPattern2(this, "p2wsh"), + unknown: create_0satsPattern2(this, "unknown_outputs"), }, year: { - _2009: create_0satsPattern2(this, 'year_2009'), - _2010: create_0satsPattern2(this, 'year_2010'), - _2011: create_0satsPattern2(this, 'year_2011'), - _2012: create_0satsPattern2(this, 'year_2012'), - _2013: create_0satsPattern2(this, 'year_2013'), - _2014: create_0satsPattern2(this, 'year_2014'), - _2015: create_0satsPattern2(this, 'year_2015'), - _2016: create_0satsPattern2(this, 'year_2016'), - _2017: create_0satsPattern2(this, 'year_2017'), - _2018: create_0satsPattern2(this, 'year_2018'), - _2019: create_0satsPattern2(this, 'year_2019'), - _2020: create_0satsPattern2(this, 'year_2020'), - _2021: create_0satsPattern2(this, 'year_2021'), - _2022: create_0satsPattern2(this, 'year_2022'), - _2023: create_0satsPattern2(this, 'year_2023'), - _2024: create_0satsPattern2(this, 'year_2024'), - _2025: create_0satsPattern2(this, 'year_2025'), - _2026: create_0satsPattern2(this, 'year_2026') - } - } + _2009: create_0satsPattern2(this, "year_2009"), + _2010: create_0satsPattern2(this, "year_2010"), + _2011: create_0satsPattern2(this, "year_2011"), + _2012: create_0satsPattern2(this, "year_2012"), + _2013: create_0satsPattern2(this, "year_2013"), + _2014: create_0satsPattern2(this, "year_2014"), + _2015: create_0satsPattern2(this, "year_2015"), + _2016: create_0satsPattern2(this, "year_2016"), + _2017: create_0satsPattern2(this, "year_2017"), + _2018: create_0satsPattern2(this, "year_2018"), + _2019: create_0satsPattern2(this, "year_2019"), + _2020: create_0satsPattern2(this, "year_2020"), + _2021: create_0satsPattern2(this, "year_2021"), + _2022: create_0satsPattern2(this, "year_2022"), + _2023: create_0satsPattern2(this, "year_2023"), + _2024: create_0satsPattern2(this, "year_2024"), + _2025: create_0satsPattern2(this, "year_2025"), + _2026: create_0satsPattern2(this, "year_2026"), + }, + }, }, indexes: { address: { - 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') + 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"), }, 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') + 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"), }, decadeindex: { - firstYearindex: createMetricPattern8(this, 'decadeindex_first_yearindex'), - identity: createMetricPattern8(this, 'decadeindex'), - yearindexCount: createMetricPattern8(this, 'decadeindex_yearindex_count') + firstYearindex: createMetricPattern8( + this, + "decadeindex_first_yearindex", + ), + identity: createMetricPattern8(this, "decadeindex"), + yearindexCount: createMetricPattern8( + this, + "decadeindex_yearindex_count", + ), }, difficultyepoch: { - firstHeight: createMetricPattern9(this, 'difficultyepoch_first_height'), - heightCount: createMetricPattern9(this, 'difficultyepoch_height_count'), - identity: createMetricPattern9(this, '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') + 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') + 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') + 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') + 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') + 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') + identity: createMetricPattern28(this, "txindex"), + inputCount: createMetricPattern28(this, "txindex_input_count"), + outputCount: createMetricPattern28(this, "txindex_output_count"), }, - txinindex: createEmptyPattern(this, 'txinindex'), - txoutindex: createEmptyPattern(this, 'txoutindex'), + 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') + 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') - } + decadeindex: createMetricPattern31(this, "yearindex_decadeindex"), + firstMonthindex: createMetricPattern31( + this, + "yearindex_first_monthindex", + ), + identity: createMetricPattern31(this, "yearindex"), + monthindexCount: createMetricPattern31( + this, + "yearindex_monthindex_count", + ), + }, }, inputs: { - count: createSizePattern(this, 'input_count'), - firstTxinindex: createMetricPattern12(this, 'first_txinindex'), - outpoint: createMetricPattern13(this, 'outpoint'), - outputtype: createMetricPattern13(this, 'outputtype'), + count: createSizePattern(this, "input_count"), + firstTxinindex: createMetricPattern12(this, "first_txinindex"), + outpoint: createMetricPattern13(this, "outpoint"), + outputtype: createMetricPattern13(this, "outputtype"), spent: { - txoutindex: createMetricPattern13(this, 'txoutindex'), - value: createMetricPattern13(this, 'value') + txoutindex: createMetricPattern13(this, "txoutindex"), + value: createMetricPattern13(this, "value"), }, - txindex: createMetricPattern13(this, 'txindex'), - typeindex: createMetricPattern13(this, 'typeindex'), - witnessSize: createMetricPattern13(this, 'witness_size') + 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: createMetricPattern1(this, 'price_ath'), - priceDrawdown: createMetricPattern3(this, 'price_drawdown'), - yearsSincePriceAth: createMetricPattern4(this, 'years_since_price_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: createMetricPattern1(this, "price_ath"), + priceDrawdown: createMetricPattern3(this, "price_drawdown"), + yearsSincePriceAth: createMetricPattern4( + this, + "years_since_price_ath", + ), }, dca: { - classAveragePrice: createClassAveragePricePattern(this, 'dca_class'), - classReturns: createClassAveragePricePattern(this, 'dca_class'), + classAveragePrice: createClassAveragePricePattern(this, "dca_class"), + classReturns: createClassAveragePricePattern(this, "dca_class"), classStack: { - _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') + _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'), - periodLumpSumStack: createPeriodLumpSumStackPattern(this, ''), - periodReturns: createPeriodAveragePricePattern(this, 'dca_returns'), - periodStack: createPeriodLumpSumStackPattern(this, '') + periodAveragePrice: createPeriodAveragePricePattern( + this, + "dca_average_price", + ), + periodCagr: createPeriodCagrPattern(this, "dca_cagr"), + periodLumpSumStack: createPeriodLumpSumStackPattern(this, ""), + periodReturns: createPeriodAveragePricePattern(this, "dca_returns"), + periodStack: createPeriodLumpSumStackPattern(this, ""), }, indicators: { - gini: createMetricPattern7(this, 'gini'), - macdHistogram: createMetricPattern7(this, 'macd_histogram'), - macdLine: createMetricPattern7(this, 'macd_line'), - macdSignal: createMetricPattern7(this, 'macd_signal'), - nvt: createMetricPattern4(this, 'nvt'), - piCycle: createMetricPattern7(this, 'pi_cycle'), - puellMultiple: createMetricPattern4(this, 'puell_multiple'), - 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') + gini: createMetricPattern7(this, "gini"), + macdHistogram: createMetricPattern7(this, "macd_histogram"), + macdLine: createMetricPattern7(this, "macd_line"), + macdSignal: createMetricPattern7(this, "macd_signal"), + nvt: createMetricPattern4(this, "nvt"), + piCycle: createMetricPattern7(this, "pi_cycle"), + puellMultiple: createMetricPattern4(this, "puell_multiple"), + 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') + priceAgo: createPriceAgoPattern(this, "price"), }, movingAverage: { - price111dSma: createPrice111dSmaPattern(this, 'price_111d_sma'), - price12dEma: createPrice111dSmaPattern(this, 'price_12d_ema'), - price13dEma: createPrice111dSmaPattern(this, 'price_13d_ema'), - price13dSma: createPrice111dSmaPattern(this, 'price_13d_sma'), - price144dEma: createPrice111dSmaPattern(this, 'price_144d_ema'), - price144dSma: createPrice111dSmaPattern(this, 'price_144d_sma'), - price1mEma: createPrice111dSmaPattern(this, 'price_1m_ema'), - price1mSma: createPrice111dSmaPattern(this, 'price_1m_sma'), - price1wEma: createPrice111dSmaPattern(this, 'price_1w_ema'), - price1wSma: createPrice111dSmaPattern(this, 'price_1w_sma'), - price1yEma: createPrice111dSmaPattern(this, 'price_1y_ema'), - price1ySma: createPrice111dSmaPattern(this, 'price_1y_sma'), - price200dEma: createPrice111dSmaPattern(this, 'price_200d_ema'), - price200dSma: createPrice111dSmaPattern(this, 'price_200d_sma'), - price200dSmaX08: createMetricPattern4(this, 'price_200d_sma_x0_8'), - price200dSmaX24: createMetricPattern4(this, 'price_200d_sma_x2_4'), - price200wEma: createPrice111dSmaPattern(this, 'price_200w_ema'), - price200wSma: createPrice111dSmaPattern(this, 'price_200w_sma'), - price21dEma: createPrice111dSmaPattern(this, 'price_21d_ema'), - price21dSma: createPrice111dSmaPattern(this, 'price_21d_sma'), - price26dEma: createPrice111dSmaPattern(this, 'price_26d_ema'), - price2yEma: createPrice111dSmaPattern(this, 'price_2y_ema'), - price2ySma: createPrice111dSmaPattern(this, 'price_2y_sma'), - price34dEma: createPrice111dSmaPattern(this, 'price_34d_ema'), - price34dSma: createPrice111dSmaPattern(this, 'price_34d_sma'), - price350dSma: createPrice111dSmaPattern(this, 'price_350d_sma'), - price350dSmaX2: createMetricPattern4(this, 'price_350d_sma_x2'), - price4yEma: createPrice111dSmaPattern(this, 'price_4y_ema'), - price4ySma: createPrice111dSmaPattern(this, 'price_4y_sma'), - price55dEma: createPrice111dSmaPattern(this, 'price_55d_ema'), - price55dSma: createPrice111dSmaPattern(this, 'price_55d_sma'), - price89dEma: createPrice111dSmaPattern(this, 'price_89d_ema'), - price89dSma: createPrice111dSmaPattern(this, 'price_89d_sma'), - price8dEma: createPrice111dSmaPattern(this, 'price_8d_ema'), - price8dSma: createPrice111dSmaPattern(this, 'price_8d_sma') + price111dSma: createPrice111dSmaPattern(this, "price_111d_sma"), + price12dEma: createPrice111dSmaPattern(this, "price_12d_ema"), + price13dEma: createPrice111dSmaPattern(this, "price_13d_ema"), + price13dSma: createPrice111dSmaPattern(this, "price_13d_sma"), + price144dEma: createPrice111dSmaPattern(this, "price_144d_ema"), + price144dSma: createPrice111dSmaPattern(this, "price_144d_sma"), + price1mEma: createPrice111dSmaPattern(this, "price_1m_ema"), + price1mSma: createPrice111dSmaPattern(this, "price_1m_sma"), + price1wEma: createPrice111dSmaPattern(this, "price_1w_ema"), + price1wSma: createPrice111dSmaPattern(this, "price_1w_sma"), + price1yEma: createPrice111dSmaPattern(this, "price_1y_ema"), + price1ySma: createPrice111dSmaPattern(this, "price_1y_sma"), + price200dEma: createPrice111dSmaPattern(this, "price_200d_ema"), + price200dSma: createPrice111dSmaPattern(this, "price_200d_sma"), + price200dSmaX08: createMetricPattern4(this, "price_200d_sma_x0_8"), + price200dSmaX24: createMetricPattern4(this, "price_200d_sma_x2_4"), + price200wEma: createPrice111dSmaPattern(this, "price_200w_ema"), + price200wSma: createPrice111dSmaPattern(this, "price_200w_sma"), + price21dEma: createPrice111dSmaPattern(this, "price_21d_ema"), + price21dSma: createPrice111dSmaPattern(this, "price_21d_sma"), + price26dEma: createPrice111dSmaPattern(this, "price_26d_ema"), + price2yEma: createPrice111dSmaPattern(this, "price_2y_ema"), + price2ySma: createPrice111dSmaPattern(this, "price_2y_sma"), + price34dEma: createPrice111dSmaPattern(this, "price_34d_ema"), + price34dSma: createPrice111dSmaPattern(this, "price_34d_sma"), + price350dSma: createPrice111dSmaPattern(this, "price_350d_sma"), + price350dSmaX2: createMetricPattern4(this, "price_350d_sma_x2"), + price4yEma: createPrice111dSmaPattern(this, "price_4y_ema"), + price4ySma: createPrice111dSmaPattern(this, "price_4y_sma"), + price55dEma: createPrice111dSmaPattern(this, "price_55d_ema"), + price55dSma: createPrice111dSmaPattern(this, "price_55d_sma"), + price89dEma: createPrice111dSmaPattern(this, "price_89d_ema"), + price89dSma: createPrice111dSmaPattern(this, "price_89d_sma"), + price8dEma: createPrice111dSmaPattern(this, "price_8d_ema"), + price8dSma: createPrice111dSmaPattern(this, "price_8d_sma"), }, range: { - price1mMax: createMetricPattern4(this, 'price_1m_max'), - price1mMin: createMetricPattern4(this, 'price_1m_min'), - price1wMax: createMetricPattern4(this, 'price_1w_max'), - price1wMin: createMetricPattern4(this, 'price_1w_min'), - price1yMax: createMetricPattern4(this, 'price_1y_max'), - price1yMin: createMetricPattern4(this, 'price_1y_min'), - price2wChoppinessIndex: createMetricPattern4(this, 'price_2w_choppiness_index'), - price2wMax: createMetricPattern4(this, 'price_2w_max'), - price2wMin: createMetricPattern4(this, 'price_2w_min'), - priceTrueRange: createMetricPattern7(this, 'price_true_range'), - priceTrueRange2wSum: createMetricPattern7(this, 'price_true_range_2w_sum') + price1mMax: createMetricPattern4(this, "price_1m_max"), + price1mMin: createMetricPattern4(this, "price_1m_min"), + price1wMax: createMetricPattern4(this, "price_1w_max"), + price1wMin: createMetricPattern4(this, "price_1w_min"), + price1yMax: createMetricPattern4(this, "price_1y_max"), + price1yMin: createMetricPattern4(this, "price_1y_min"), + price2wChoppinessIndex: createMetricPattern4( + this, + "price_2w_choppiness_index", + ), + price2wMax: createMetricPattern4(this, "price_2w_max"), + price2wMin: createMetricPattern4(this, "price_2w_min"), + priceTrueRange: createMetricPattern7(this, "price_true_range"), + priceTrueRange2wSum: createMetricPattern7( + this, + "price_true_range_2w_sum", + ), }, returns: { - _1dReturns1mSd: create_1dReturns1mSdPattern(this, '1d_returns_1m_sd'), - _1dReturns1wSd: create_1dReturns1mSdPattern(this, '1d_returns_1w_sd'), - _1dReturns1ySd: create_1dReturns1mSdPattern(this, '1d_returns_1y_sd'), - cagr: createPeriodCagrPattern(this, 'cagr'), - downside1mSd: create_1dReturns1mSdPattern(this, 'downside_1m_sd'), - downside1wSd: create_1dReturns1mSdPattern(this, 'downside_1w_sd'), - downside1ySd: create_1dReturns1mSdPattern(this, 'downside_1y_sd'), - downsideReturns: createMetricPattern7(this, 'downside_returns'), - priceReturns: createPriceAgoPattern(this, 'price_returns') + _1dReturns1mSd: create_1dReturns1mSdPattern(this, "1d_returns_1m_sd"), + _1dReturns1wSd: create_1dReturns1mSdPattern(this, "1d_returns_1w_sd"), + _1dReturns1ySd: create_1dReturns1mSdPattern(this, "1d_returns_1y_sd"), + cagr: createPeriodCagrPattern(this, "cagr"), + downside1mSd: create_1dReturns1mSdPattern(this, "downside_1m_sd"), + downside1wSd: create_1dReturns1mSdPattern(this, "downside_1w_sd"), + downside1ySd: create_1dReturns1mSdPattern(this, "downside_1y_sd"), + 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: 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') - } + price1mVolatility: createMetricPattern4(this, "price_1m_volatility"), + price1wVolatility: createMetricPattern4(this, "price_1w_volatility"), + price1yVolatility: createMetricPattern4(this, "price_1y_volatility"), + 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: { - totalCount: createSizePattern(this, 'output_count'), - utxoCount: createBitcoinPattern(this, 'exact_utxo_count') + totalCount: createSizePattern(this, "output_count"), + utxoCount: createBitcoinPattern(this, "exact_utxo_count"), }, - firstTxoutindex: createMetricPattern12(this, 'first_txoutindex'), - outputtype: createMetricPattern16(this, 'outputtype'), + firstTxoutindex: createMetricPattern12(this, "first_txoutindex"), + outputtype: createMetricPattern16(this, "outputtype"), spent: { - txinindex: createMetricPattern16(this, 'txinindex') + txinindex: createMetricPattern16(this, "txinindex"), }, - txindex: createMetricPattern16(this, 'txindex'), - typeindex: createMetricPattern16(this, 'typeindex'), - value: createMetricPattern16(this, 'value') + txindex: createMetricPattern16(this, "txindex"), + typeindex: createMetricPattern16(this, "typeindex"), + value: createMetricPattern16(this, "value"), }, pools: { - pool: createMetricPattern12(this, 'pool'), + pool: createMetricPattern12(this, "pool"), vecs: { - aaopool: createAaopoolPattern(this, 'aaopool'), - antpool: createAaopoolPattern(this, 'antpool'), - arkpool: createAaopoolPattern(this, 'arkpool'), - asicminer: createAaopoolPattern(this, 'asicminer'), - axbt: createAaopoolPattern(this, 'axbt'), - batpool: createAaopoolPattern(this, 'batpool'), - bcmonster: createAaopoolPattern(this, 'bcmonster'), - bcpoolio: createAaopoolPattern(this, 'bcpoolio'), - binancepool: createAaopoolPattern(this, 'binancepool'), - bitalo: createAaopoolPattern(this, 'bitalo'), - bitclub: createAaopoolPattern(this, 'bitclub'), - bitcoinaffiliatenetwork: createAaopoolPattern(this, 'bitcoinaffiliatenetwork'), - bitcoincom: createAaopoolPattern(this, 'bitcoincom'), - bitcoinindia: createAaopoolPattern(this, 'bitcoinindia'), - bitcoinrussia: createAaopoolPattern(this, 'bitcoinrussia'), - bitcoinukraine: createAaopoolPattern(this, 'bitcoinukraine'), - bitfarms: createAaopoolPattern(this, 'bitfarms'), - bitfufupool: createAaopoolPattern(this, 'bitfufupool'), - bitfury: createAaopoolPattern(this, 'bitfury'), - bitminter: createAaopoolPattern(this, 'bitminter'), - bitparking: createAaopoolPattern(this, 'bitparking'), - bitsolo: createAaopoolPattern(this, 'bitsolo'), - bixin: createAaopoolPattern(this, 'bixin'), - blockfills: createAaopoolPattern(this, 'blockfills'), - braiinspool: createAaopoolPattern(this, 'braiinspool'), - bravomining: createAaopoolPattern(this, 'bravomining'), - btcc: createAaopoolPattern(this, 'btcc'), - btccom: createAaopoolPattern(this, 'btccom'), - btcdig: createAaopoolPattern(this, 'btcdig'), - btcguild: createAaopoolPattern(this, 'btcguild'), - btclab: createAaopoolPattern(this, 'btclab'), - btcmp: createAaopoolPattern(this, 'btcmp'), - btcnuggets: createAaopoolPattern(this, 'btcnuggets'), - btcpoolparty: createAaopoolPattern(this, 'btcpoolparty'), - btcserv: createAaopoolPattern(this, 'btcserv'), - btctop: createAaopoolPattern(this, 'btctop'), - btpool: createAaopoolPattern(this, 'btpool'), - bwpool: createAaopoolPattern(this, 'bwpool'), - bytepool: createAaopoolPattern(this, 'bytepool'), - canoe: createAaopoolPattern(this, 'canoe'), - canoepool: createAaopoolPattern(this, 'canoepool'), - carbonnegative: createAaopoolPattern(this, 'carbonnegative'), - ckpool: createAaopoolPattern(this, 'ckpool'), - cloudhashing: createAaopoolPattern(this, 'cloudhashing'), - coinlab: createAaopoolPattern(this, 'coinlab'), - cointerra: createAaopoolPattern(this, 'cointerra'), - connectbtc: createAaopoolPattern(this, 'connectbtc'), - dcex: createAaopoolPattern(this, 'dcex'), - dcexploration: createAaopoolPattern(this, 'dcexploration'), - digitalbtc: createAaopoolPattern(this, 'digitalbtc'), - digitalxmintsy: createAaopoolPattern(this, 'digitalxmintsy'), - dpool: createAaopoolPattern(this, 'dpool'), - eclipsemc: createAaopoolPattern(this, 'eclipsemc'), - eightbaochi: createAaopoolPattern(this, 'eightbaochi'), - ekanembtc: createAaopoolPattern(this, 'ekanembtc'), - eligius: createAaopoolPattern(this, 'eligius'), - emcdpool: createAaopoolPattern(this, 'emcdpool'), - entrustcharitypool: createAaopoolPattern(this, 'entrustcharitypool'), - eobot: createAaopoolPattern(this, 'eobot'), - exxbw: createAaopoolPattern(this, 'exxbw'), - f2pool: createAaopoolPattern(this, 'f2pool'), - fiftyeightcoin: createAaopoolPattern(this, 'fiftyeightcoin'), - foundryusa: createAaopoolPattern(this, 'foundryusa'), - futurebitapollosolo: createAaopoolPattern(this, 'futurebitapollosolo'), - gbminers: createAaopoolPattern(this, 'gbminers'), - ghashio: createAaopoolPattern(this, 'ghashio'), - givemecoins: createAaopoolPattern(this, 'givemecoins'), - gogreenlight: createAaopoolPattern(this, 'gogreenlight'), - haominer: createAaopoolPattern(this, 'haominer'), - haozhuzhu: createAaopoolPattern(this, 'haozhuzhu'), - hashbx: createAaopoolPattern(this, 'hashbx'), - hashpool: createAaopoolPattern(this, 'hashpool'), - helix: createAaopoolPattern(this, 'helix'), - hhtt: createAaopoolPattern(this, 'hhtt'), - hotpool: createAaopoolPattern(this, 'hotpool'), - hummerpool: createAaopoolPattern(this, 'hummerpool'), - huobipool: createAaopoolPattern(this, 'huobipool'), - innopolistech: createAaopoolPattern(this, 'innopolistech'), - kanopool: createAaopoolPattern(this, 'kanopool'), - kncminer: createAaopoolPattern(this, 'kncminer'), - kucoinpool: createAaopoolPattern(this, 'kucoinpool'), - lubiancom: createAaopoolPattern(this, 'lubiancom'), - luckypool: createAaopoolPattern(this, 'luckypool'), - luxor: createAaopoolPattern(this, 'luxor'), - marapool: createAaopoolPattern(this, 'marapool'), - maxbtc: createAaopoolPattern(this, 'maxbtc'), - maxipool: createAaopoolPattern(this, 'maxipool'), - megabigpower: createAaopoolPattern(this, 'megabigpower'), - minerium: createAaopoolPattern(this, 'minerium'), - miningcity: createAaopoolPattern(this, 'miningcity'), - miningdutch: createAaopoolPattern(this, 'miningdutch'), - miningkings: createAaopoolPattern(this, 'miningkings'), - miningsquared: createAaopoolPattern(this, 'miningsquared'), - mmpool: createAaopoolPattern(this, 'mmpool'), - mtred: createAaopoolPattern(this, 'mtred'), - multicoinco: createAaopoolPattern(this, 'multicoinco'), - multipool: createAaopoolPattern(this, 'multipool'), - mybtccoinpool: createAaopoolPattern(this, 'mybtccoinpool'), - neopool: createAaopoolPattern(this, 'neopool'), - nexious: createAaopoolPattern(this, 'nexious'), - nicehash: createAaopoolPattern(this, 'nicehash'), - nmcbit: createAaopoolPattern(this, 'nmcbit'), - novablock: createAaopoolPattern(this, 'novablock'), - ocean: createAaopoolPattern(this, 'ocean'), - okexpool: createAaopoolPattern(this, 'okexpool'), - okkong: createAaopoolPattern(this, 'okkong'), - okminer: createAaopoolPattern(this, 'okminer'), - okpooltop: createAaopoolPattern(this, 'okpooltop'), - onehash: createAaopoolPattern(this, 'onehash'), - onem1x: createAaopoolPattern(this, 'onem1x'), - onethash: createAaopoolPattern(this, 'onethash'), - ozcoin: createAaopoolPattern(this, 'ozcoin'), - parasite: createAaopoolPattern(this, 'parasite'), - patels: createAaopoolPattern(this, 'patels'), - pegapool: createAaopoolPattern(this, 'pegapool'), - phashio: createAaopoolPattern(this, 'phashio'), - phoenix: createAaopoolPattern(this, 'phoenix'), - polmine: createAaopoolPattern(this, 'polmine'), - pool175btc: createAaopoolPattern(this, 'pool175btc'), - pool50btc: createAaopoolPattern(this, 'pool50btc'), - poolin: createAaopoolPattern(this, 'poolin'), - portlandhodl: createAaopoolPattern(this, 'portlandhodl'), - publicpool: createAaopoolPattern(this, 'publicpool'), - purebtccom: createAaopoolPattern(this, 'purebtccom'), - rawpool: createAaopoolPattern(this, 'rawpool'), - rigpool: createAaopoolPattern(this, 'rigpool'), - sbicrypto: createAaopoolPattern(this, 'sbicrypto'), - secpool: createAaopoolPattern(this, 'secpool'), - secretsuperstar: createAaopoolPattern(this, 'secretsuperstar'), - sevenpool: createAaopoolPattern(this, 'sevenpool'), - shawnp0wers: createAaopoolPattern(this, 'shawnp0wers'), - sigmapoolcom: createAaopoolPattern(this, 'sigmapoolcom'), - simplecoinus: createAaopoolPattern(this, 'simplecoinus'), - solock: createAaopoolPattern(this, 'solock'), - spiderpool: createAaopoolPattern(this, 'spiderpool'), - stminingcorp: createAaopoolPattern(this, 'stminingcorp'), - tangpool: createAaopoolPattern(this, 'tangpool'), - tatmaspool: createAaopoolPattern(this, 'tatmaspool'), - tbdice: createAaopoolPattern(this, 'tbdice'), - telco214: createAaopoolPattern(this, 'telco214'), - terrapool: createAaopoolPattern(this, 'terrapool'), - tiger: createAaopoolPattern(this, 'tiger'), - tigerpoolnet: createAaopoolPattern(this, 'tigerpoolnet'), - titan: createAaopoolPattern(this, 'titan'), - transactioncoinmining: createAaopoolPattern(this, 'transactioncoinmining'), - trickysbtcpool: createAaopoolPattern(this, 'trickysbtcpool'), - triplemining: createAaopoolPattern(this, 'triplemining'), - twentyoneinc: createAaopoolPattern(this, 'twentyoneinc'), - ultimuspool: createAaopoolPattern(this, 'ultimuspool'), - unknown: createAaopoolPattern(this, 'unknown'), - unomp: createAaopoolPattern(this, 'unomp'), - viabtc: createAaopoolPattern(this, 'viabtc'), - waterhole: createAaopoolPattern(this, 'waterhole'), - wayicn: createAaopoolPattern(this, 'wayicn'), - whitepool: createAaopoolPattern(this, 'whitepool'), - wk057: createAaopoolPattern(this, 'wk057'), - yourbtcnet: createAaopoolPattern(this, 'yourbtcnet'), - zulupool: createAaopoolPattern(this, 'zulupool') - } + aaopool: createAaopoolPattern(this, "aaopool"), + antpool: createAaopoolPattern(this, "antpool"), + arkpool: createAaopoolPattern(this, "arkpool"), + asicminer: createAaopoolPattern(this, "asicminer"), + axbt: createAaopoolPattern(this, "axbt"), + batpool: createAaopoolPattern(this, "batpool"), + bcmonster: createAaopoolPattern(this, "bcmonster"), + bcpoolio: createAaopoolPattern(this, "bcpoolio"), + binancepool: createAaopoolPattern(this, "binancepool"), + bitalo: createAaopoolPattern(this, "bitalo"), + bitclub: createAaopoolPattern(this, "bitclub"), + bitcoinaffiliatenetwork: createAaopoolPattern( + this, + "bitcoinaffiliatenetwork", + ), + bitcoincom: createAaopoolPattern(this, "bitcoincom"), + bitcoinindia: createAaopoolPattern(this, "bitcoinindia"), + bitcoinrussia: createAaopoolPattern(this, "bitcoinrussia"), + bitcoinukraine: createAaopoolPattern(this, "bitcoinukraine"), + bitfarms: createAaopoolPattern(this, "bitfarms"), + bitfufupool: createAaopoolPattern(this, "bitfufupool"), + bitfury: createAaopoolPattern(this, "bitfury"), + bitminter: createAaopoolPattern(this, "bitminter"), + bitparking: createAaopoolPattern(this, "bitparking"), + bitsolo: createAaopoolPattern(this, "bitsolo"), + bixin: createAaopoolPattern(this, "bixin"), + blockfills: createAaopoolPattern(this, "blockfills"), + braiinspool: createAaopoolPattern(this, "braiinspool"), + bravomining: createAaopoolPattern(this, "bravomining"), + btcc: createAaopoolPattern(this, "btcc"), + btccom: createAaopoolPattern(this, "btccom"), + btcdig: createAaopoolPattern(this, "btcdig"), + btcguild: createAaopoolPattern(this, "btcguild"), + btclab: createAaopoolPattern(this, "btclab"), + btcmp: createAaopoolPattern(this, "btcmp"), + btcnuggets: createAaopoolPattern(this, "btcnuggets"), + btcpoolparty: createAaopoolPattern(this, "btcpoolparty"), + btcserv: createAaopoolPattern(this, "btcserv"), + btctop: createAaopoolPattern(this, "btctop"), + btpool: createAaopoolPattern(this, "btpool"), + bwpool: createAaopoolPattern(this, "bwpool"), + bytepool: createAaopoolPattern(this, "bytepool"), + canoe: createAaopoolPattern(this, "canoe"), + canoepool: createAaopoolPattern(this, "canoepool"), + carbonnegative: createAaopoolPattern(this, "carbonnegative"), + ckpool: createAaopoolPattern(this, "ckpool"), + cloudhashing: createAaopoolPattern(this, "cloudhashing"), + coinlab: createAaopoolPattern(this, "coinlab"), + cointerra: createAaopoolPattern(this, "cointerra"), + connectbtc: createAaopoolPattern(this, "connectbtc"), + dcex: createAaopoolPattern(this, "dcex"), + dcexploration: createAaopoolPattern(this, "dcexploration"), + digitalbtc: createAaopoolPattern(this, "digitalbtc"), + digitalxmintsy: createAaopoolPattern(this, "digitalxmintsy"), + dpool: createAaopoolPattern(this, "dpool"), + eclipsemc: createAaopoolPattern(this, "eclipsemc"), + eightbaochi: createAaopoolPattern(this, "eightbaochi"), + ekanembtc: createAaopoolPattern(this, "ekanembtc"), + eligius: createAaopoolPattern(this, "eligius"), + emcdpool: createAaopoolPattern(this, "emcdpool"), + entrustcharitypool: createAaopoolPattern(this, "entrustcharitypool"), + eobot: createAaopoolPattern(this, "eobot"), + exxbw: createAaopoolPattern(this, "exxbw"), + f2pool: createAaopoolPattern(this, "f2pool"), + fiftyeightcoin: createAaopoolPattern(this, "fiftyeightcoin"), + foundryusa: createAaopoolPattern(this, "foundryusa"), + futurebitapollosolo: createAaopoolPattern( + this, + "futurebitapollosolo", + ), + gbminers: createAaopoolPattern(this, "gbminers"), + ghashio: createAaopoolPattern(this, "ghashio"), + givemecoins: createAaopoolPattern(this, "givemecoins"), + gogreenlight: createAaopoolPattern(this, "gogreenlight"), + haominer: createAaopoolPattern(this, "haominer"), + haozhuzhu: createAaopoolPattern(this, "haozhuzhu"), + hashbx: createAaopoolPattern(this, "hashbx"), + hashpool: createAaopoolPattern(this, "hashpool"), + helix: createAaopoolPattern(this, "helix"), + hhtt: createAaopoolPattern(this, "hhtt"), + hotpool: createAaopoolPattern(this, "hotpool"), + hummerpool: createAaopoolPattern(this, "hummerpool"), + huobipool: createAaopoolPattern(this, "huobipool"), + innopolistech: createAaopoolPattern(this, "innopolistech"), + kanopool: createAaopoolPattern(this, "kanopool"), + kncminer: createAaopoolPattern(this, "kncminer"), + kucoinpool: createAaopoolPattern(this, "kucoinpool"), + lubiancom: createAaopoolPattern(this, "lubiancom"), + luckypool: createAaopoolPattern(this, "luckypool"), + luxor: createAaopoolPattern(this, "luxor"), + marapool: createAaopoolPattern(this, "marapool"), + maxbtc: createAaopoolPattern(this, "maxbtc"), + maxipool: createAaopoolPattern(this, "maxipool"), + megabigpower: createAaopoolPattern(this, "megabigpower"), + minerium: createAaopoolPattern(this, "minerium"), + miningcity: createAaopoolPattern(this, "miningcity"), + miningdutch: createAaopoolPattern(this, "miningdutch"), + miningkings: createAaopoolPattern(this, "miningkings"), + miningsquared: createAaopoolPattern(this, "miningsquared"), + mmpool: createAaopoolPattern(this, "mmpool"), + mtred: createAaopoolPattern(this, "mtred"), + multicoinco: createAaopoolPattern(this, "multicoinco"), + multipool: createAaopoolPattern(this, "multipool"), + mybtccoinpool: createAaopoolPattern(this, "mybtccoinpool"), + neopool: createAaopoolPattern(this, "neopool"), + nexious: createAaopoolPattern(this, "nexious"), + nicehash: createAaopoolPattern(this, "nicehash"), + nmcbit: createAaopoolPattern(this, "nmcbit"), + novablock: createAaopoolPattern(this, "novablock"), + ocean: createAaopoolPattern(this, "ocean"), + okexpool: createAaopoolPattern(this, "okexpool"), + okkong: createAaopoolPattern(this, "okkong"), + okminer: createAaopoolPattern(this, "okminer"), + okpooltop: createAaopoolPattern(this, "okpooltop"), + onehash: createAaopoolPattern(this, "onehash"), + onem1x: createAaopoolPattern(this, "onem1x"), + onethash: createAaopoolPattern(this, "onethash"), + ozcoin: createAaopoolPattern(this, "ozcoin"), + parasite: createAaopoolPattern(this, "parasite"), + patels: createAaopoolPattern(this, "patels"), + pegapool: createAaopoolPattern(this, "pegapool"), + phashio: createAaopoolPattern(this, "phashio"), + phoenix: createAaopoolPattern(this, "phoenix"), + polmine: createAaopoolPattern(this, "polmine"), + pool175btc: createAaopoolPattern(this, "pool175btc"), + pool50btc: createAaopoolPattern(this, "pool50btc"), + poolin: createAaopoolPattern(this, "poolin"), + portlandhodl: createAaopoolPattern(this, "portlandhodl"), + publicpool: createAaopoolPattern(this, "publicpool"), + purebtccom: createAaopoolPattern(this, "purebtccom"), + rawpool: createAaopoolPattern(this, "rawpool"), + rigpool: createAaopoolPattern(this, "rigpool"), + sbicrypto: createAaopoolPattern(this, "sbicrypto"), + secpool: createAaopoolPattern(this, "secpool"), + secretsuperstar: createAaopoolPattern(this, "secretsuperstar"), + sevenpool: createAaopoolPattern(this, "sevenpool"), + shawnp0wers: createAaopoolPattern(this, "shawnp0wers"), + sigmapoolcom: createAaopoolPattern(this, "sigmapoolcom"), + simplecoinus: createAaopoolPattern(this, "simplecoinus"), + solock: createAaopoolPattern(this, "solock"), + spiderpool: createAaopoolPattern(this, "spiderpool"), + stminingcorp: createAaopoolPattern(this, "stminingcorp"), + tangpool: createAaopoolPattern(this, "tangpool"), + tatmaspool: createAaopoolPattern(this, "tatmaspool"), + tbdice: createAaopoolPattern(this, "tbdice"), + telco214: createAaopoolPattern(this, "telco214"), + terrapool: createAaopoolPattern(this, "terrapool"), + tiger: createAaopoolPattern(this, "tiger"), + tigerpoolnet: createAaopoolPattern(this, "tigerpoolnet"), + titan: createAaopoolPattern(this, "titan"), + transactioncoinmining: createAaopoolPattern( + this, + "transactioncoinmining", + ), + trickysbtcpool: createAaopoolPattern(this, "trickysbtcpool"), + triplemining: createAaopoolPattern(this, "triplemining"), + twentyoneinc: createAaopoolPattern(this, "twentyoneinc"), + ultimuspool: createAaopoolPattern(this, "ultimuspool"), + unknown: createAaopoolPattern(this, "unknown"), + unomp: createAaopoolPattern(this, "unomp"), + viabtc: createAaopoolPattern(this, "viabtc"), + waterhole: createAaopoolPattern(this, "waterhole"), + wayicn: createAaopoolPattern(this, "wayicn"), + whitepool: createAaopoolPattern(this, "whitepool"), + wk057: createAaopoolPattern(this, "wk057"), + yourbtcnet: createAaopoolPattern(this, "yourbtcnet"), + zulupool: createAaopoolPattern(this, "zulupool"), + }, }, positions: { - blockPosition: createMetricPattern12(this, 'position'), - txPosition: createMetricPattern28(this, 'position') + blockPosition: createMetricPattern12(this, "position"), + txPosition: createMetricPattern28(this, "position"), }, price: { cents: { - ohlc: createMetricPattern6(this, 'ohlc_cents'), + ohlc: createMetricPattern6(this, "ohlc_cents"), split: { - dateindex: createDateindexPattern2(this, 'price'), - height: createDateindexPattern2(this, 'price') - } + dateindex: createDateindexPattern2(this, "price"), + height: createDateindexPattern2(this, "price"), + }, }, - sats: createSatsPattern(this, 'price'), - usd: createSatsPattern(this, 'price') + sats: createSatsPattern(this, "price"), + usd: createSatsPattern(this, "price"), }, scripts: { count: { - emptyoutput: createBitcoinPattern(this, 'emptyoutput_count'), - opreturn: createBitcoinPattern(this, 'opreturn_count'), - p2a: createBitcoinPattern(this, 'p2a_count'), - p2ms: createBitcoinPattern(this, 'p2ms_count'), - p2pk33: createBitcoinPattern(this, 'p2pk33_count'), - p2pk65: createBitcoinPattern(this, 'p2pk65_count'), - p2pkh: createBitcoinPattern(this, 'p2pkh_count'), - p2sh: createBitcoinPattern(this, 'p2sh_count'), - p2tr: createBitcoinPattern(this, 'p2tr_count'), - p2wpkh: createBitcoinPattern(this, 'p2wpkh_count'), - p2wsh: createBitcoinPattern(this, 'p2wsh_count'), - segwit: createBitcoinPattern(this, 'segwit_count'), - segwitAdoption: createSegwitAdoptionPattern(this, 'segwit_adoption'), - taprootAdoption: createSegwitAdoptionPattern(this, 'taproot_adoption'), - unknownoutput: createBitcoinPattern(this, 'unknownoutput_count') + emptyoutput: createBitcoinPattern(this, "emptyoutput_count"), + opreturn: createBitcoinPattern(this, "opreturn_count"), + p2a: createBitcoinPattern(this, "p2a_count"), + p2ms: createBitcoinPattern(this, "p2ms_count"), + p2pk33: createBitcoinPattern(this, "p2pk33_count"), + p2pk65: createBitcoinPattern(this, "p2pk65_count"), + p2pkh: createBitcoinPattern(this, "p2pkh_count"), + p2sh: createBitcoinPattern(this, "p2sh_count"), + p2tr: createBitcoinPattern(this, "p2tr_count"), + p2wpkh: createBitcoinPattern(this, "p2wpkh_count"), + p2wsh: createBitcoinPattern(this, "p2wsh_count"), + segwit: createBitcoinPattern(this, "segwit_count"), + segwitAdoption: createSegwitAdoptionPattern(this, "segwit_adoption"), + taprootAdoption: createSegwitAdoptionPattern( + this, + "taproot_adoption", + ), + unknownoutput: createBitcoinPattern(this, "unknownoutput_count"), }, - 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'), + 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') - } + opreturn: createCoinbasePattern(this, "opreturn_value"), + }, }, supply: { burned: { - opreturn: createUnclaimedRewardsPattern(this, 'opreturn_supply'), - unspendable: createUnclaimedRewardsPattern(this, 'unspendable_supply') + opreturn: createUnclaimedRewardsPattern(this, "opreturn_supply"), + unspendable: createUnclaimedRewardsPattern( + this, + "unspendable_supply", + ), }, - circulating: create_24hCoinbaseSumPattern(this, 'circulating_supply'), - inflation: createMetricPattern4(this, 'inflation_rate'), - marketCap: createMetricPattern1(this, 'market_cap'), + circulating: create_24hCoinbaseSumPattern(this, "circulating_supply"), + inflation: createMetricPattern4(this, "inflation_rate"), + marketCap: createMetricPattern1(this, "market_cap"), velocity: { - btc: createMetricPattern4(this, 'btc_velocity'), - usd: createMetricPattern4(this, 'usd_velocity') - } + btc: createMetricPattern4(this, "btc_velocity"), + usd: createMetricPattern4(this, "usd_velocity"), + }, }, transactions: { - baseSize: createMetricPattern28(this, 'base_size'), + baseSize: createMetricPattern28(this, "base_size"), count: { - isCoinbase: createMetricPattern28(this, 'is_coinbase'), - txCount: createBitcoinPattern(this, 'tx_count') + isCoinbase: createMetricPattern28(this, "is_coinbase"), + txCount: createBitcoinPattern(this, "tx_count"), }, fees: { fee: { - bitcoin: createSizePattern(this, 'fee_btc'), - dollars: createSizePattern(this, 'fee_usd'), - sats: createSizePattern(this, 'fee'), - txindex: createMetricPattern28(this, 'fee') + bitcoin: createSizePattern(this, "fee_btc"), + dollars: createSizePattern(this, "fee_usd"), + sats: createSizePattern(this, "fee"), + txindex: createMetricPattern28(this, "fee"), }, - feeRate: createFeeRatePattern(this, 'fee_rate'), - inputValue: createMetricPattern28(this, 'input_value'), - outputValue: createMetricPattern28(this, 'output_value') + feeRate: createFeeRatePattern(this, "fee_rate"), + inputValue: createMetricPattern28(this, "input_value"), + outputValue: createMetricPattern28(this, "output_value"), }, - 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'), + 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: { - vsize: createFeeRatePattern(this, ''), - weight: createFeeRatePattern(this, '') + vsize: createFeeRatePattern(this, ""), + weight: createFeeRatePattern(this, ""), }, - totalSize: createMetricPattern28(this, 'total_size'), - txid: createMetricPattern28(this, 'txid'), - txversion: createMetricPattern28(this, 'txversion'), + totalSize: createMetricPattern28(this, "total_size"), + txid: createMetricPattern28(this, "txid"), + txversion: createMetricPattern28(this, "txversion"), versions: { - v1: createBlockCountPattern(this, 'tx_v1'), - v2: createBlockCountPattern(this, 'tx_v2'), - v3: createBlockCountPattern(this, 'tx_v3') + v1: createBlockCountPattern(this, "tx_v1"), + v2: createBlockCountPattern(this, "tx_v2"), + v3: createBlockCountPattern(this, "tx_v3"), }, volume: { - annualizedVolume: create_24hCoinbaseSumPattern(this, 'annualized_volume'), - inputsPerSec: createMetricPattern4(this, 'inputs_per_sec'), - outputsPerSec: createMetricPattern4(this, 'outputs_per_sec'), - sentSum: create_24hCoinbaseSumPattern(this, 'sent_sum'), - txPerSec: createMetricPattern4(this, 'tx_per_sec') - } - } + annualizedVolume: create_24hCoinbaseSumPattern( + this, + "annualized_volume", + ), + inputsPerSec: createMetricPattern4(this, "inputs_per_sec"), + outputsPerSec: createMetricPattern4(this, "outputs_per_sec"), + sentSum: create_24hCoinbaseSumPattern(this, "sent_sum"), + txPerSec: createMetricPattern4(this, "tx_per_sec"), + }, + }, }; } /** * Address information * @description Retrieve comprehensive information about a Bitcoin address including balance, transaction history, UTXOs, and estimated investment metrics. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR, etc.). - * @param {Address} address + * @param {Address} address * @returns {Promise} */ async getAddress(address) { @@ -6317,39 +7191,41 @@ class BrkClient extends BrkClientBase { /** * Address transaction IDs * @description Get transaction IDs for an address, newest first. Use after_txid for pagination. - * @param {Address} address + * @param {Address} address * @param {string=} [after_txid] Txid to paginate from (return transactions before this one) * @param {number=} [limit] Maximum number of results to return. Defaults to 25 if not specified. * @returns {Promise} */ async getAddressTxs(address, after_txid, limit) { const params = new URLSearchParams(); - if (after_txid !== undefined) params.set('after_txid', String(after_txid)); - if (limit !== undefined) params.set('limit', String(limit)); + if (after_txid !== undefined) params.set("after_txid", String(after_txid)); + if (limit !== undefined) params.set("limit", String(limit)); const query = params.toString(); - return this.get(`/api/address/${address}/txs${query ? '?' + query : ''}`); + return this.get(`/api/address/${address}/txs${query ? "?" + query : ""}`); } /** * Address confirmed transactions * @description Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination. - * @param {Address} address + * @param {Address} address * @param {string=} [after_txid] Txid to paginate from (return transactions before this one) * @param {number=} [limit] Maximum number of results to return. Defaults to 25 if not specified. * @returns {Promise} */ async getAddressTxsChain(address, after_txid, limit) { const params = new URLSearchParams(); - if (after_txid !== undefined) params.set('after_txid', String(after_txid)); - if (limit !== undefined) params.set('limit', String(limit)); + if (after_txid !== undefined) params.set("after_txid", String(after_txid)); + if (limit !== undefined) params.set("limit", String(limit)); const query = params.toString(); - return this.get(`/api/address/${address}/txs/chain${query ? '?' + query : ''}`); + return this.get( + `/api/address/${address}/txs/chain${query ? "?" + query : ""}`, + ); } /** * Address mempool transactions * @description Get unconfirmed transaction IDs for an address from the mempool (up to 50). - * @param {Address} address + * @param {Address} address * @returns {Promise} */ async getAddressTxsMempool(address) { @@ -6359,7 +7235,7 @@ class BrkClient extends BrkClientBase { /** * Address UTXOs * @description Get unspent transaction outputs for an address. - * @param {Address} address + * @param {Address} address * @returns {Promise} */ async getAddressUtxo(address) { @@ -6369,7 +7245,7 @@ class BrkClient extends BrkClientBase { /** * Block by height * @description Retrieve block information by block height. Returns block metadata including hash, timestamp, difficulty, size, weight, and transaction count. - * @param {Height} height + * @param {Height} height * @returns {Promise} */ async getBlockHeight(height) { @@ -6379,7 +7255,7 @@ class BrkClient extends BrkClientBase { /** * Block information * @description Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count. - * @param {BlockHash} hash + * @param {BlockHash} hash * @returns {Promise} */ async getBlockByHash(hash) { @@ -6389,7 +7265,7 @@ class BrkClient extends BrkClientBase { /** * Raw block * @description Returns the raw block data in binary format. - * @param {BlockHash} hash + * @param {BlockHash} hash * @returns {Promise} */ async getBlockByHashRaw(hash) { @@ -6399,7 +7275,7 @@ class BrkClient extends BrkClientBase { /** * Block status * @description Retrieve the status of a block. Returns whether the block is in the best chain and, if so, its height and the hash of the next block. - * @param {BlockHash} hash + * @param {BlockHash} hash * @returns {Promise} */ async getBlockByHashStatus(hash) { @@ -6420,7 +7296,7 @@ class BrkClient extends BrkClientBase { /** * Block transaction IDs * @description Retrieve all transaction IDs in a block by block hash. - * @param {BlockHash} hash + * @param {BlockHash} hash * @returns {Promise} */ async getBlockByHashTxids(hash) { @@ -6450,7 +7326,7 @@ class BrkClient extends BrkClientBase { /** * Blocks from height * @description Retrieve up to 10 blocks going backwards from the given height. For example, height=100 returns blocks 100, 99, 98, ..., 91. Height=0 returns only block 0. - * @param {Height} height + * @param {Height} height * @returns {Promise} */ async getBlocksByHeight(height) { @@ -6478,7 +7354,7 @@ class BrkClient extends BrkClientBase { /** * Get supported indexes for a metric * @description Returns the list of indexes are supported by the specified metric. For example, `realized_price` might be available on dateindex, weekindex, and monthindex. - * @param {Metric} metric + * @param {Metric} metric * @returns {Promise} */ async getMetric(metric) { @@ -6498,12 +7374,14 @@ class BrkClient extends BrkClientBase { */ async getMetricByIndex(index, metric, count, format, from, to) { const params = new URLSearchParams(); - if (count !== undefined) params.set('count', String(count)); - if (format !== undefined) params.set('format', String(format)); - if (from !== undefined) params.set('from', String(from)); - if (to !== undefined) params.set('to', String(to)); + if (count !== undefined) params.set("count", String(count)); + if (format !== undefined) params.set("format", String(format)); + if (from !== undefined) params.set("from", String(from)); + if (to !== undefined) params.set("to", String(to)); const query = params.toString(); - return this.get(`/api/metric/${metric}/${index}${query ? '?' + query : ''}`); + return this.get( + `/api/metric/${metric}/${index}${query ? "?" + query : ""}`, + ); } /** @@ -6519,14 +7397,14 @@ class BrkClient extends BrkClientBase { */ async getMetricsBulk(count, format, from, index, metrics, to) { const params = new URLSearchParams(); - if (count !== undefined) params.set('count', String(count)); - if (format !== undefined) params.set('format', String(format)); - if (from !== undefined) params.set('from', String(from)); - params.set('index', String(index)); - params.set('metrics', String(metrics)); - if (to !== undefined) params.set('to', String(to)); + if (count !== undefined) params.set("count", String(count)); + if (format !== undefined) params.set("format", String(format)); + if (from !== undefined) params.set("from", String(from)); + params.set("index", String(index)); + params.set("metrics", String(metrics)); + if (to !== undefined) params.set("to", String(to)); const query = params.toString(); - return this.get(`/api/metrics/bulk${query ? '?' + query : ''}`); + return this.get(`/api/metrics/bulk${query ? "?" + query : ""}`); } /** @@ -6564,29 +7442,29 @@ class BrkClient extends BrkClientBase { */ async getMetricsList(page) { const params = new URLSearchParams(); - if (page !== undefined) params.set('page', String(page)); + if (page !== undefined) params.set("page", String(page)); const query = params.toString(); - return this.get(`/api/metrics/list${query ? '?' + query : ''}`); + return this.get(`/api/metrics/list${query ? "?" + query : ""}`); } /** * Search metrics * @description Fuzzy search for metrics by name. Supports partial matches and typos. - * @param {Metric} metric - * @param {Limit=} [limit] + * @param {Metric} metric + * @param {Limit=} [limit] * @returns {Promise} */ async getMetricsSearchByMetric(metric, limit) { const params = new URLSearchParams(); - if (limit !== undefined) params.set('limit', String(limit)); + if (limit !== undefined) params.set("limit", String(limit)); const query = params.toString(); - return this.get(`/api/metrics/search/${metric}${query ? '?' + query : ''}`); + return this.get(`/api/metrics/search/${metric}${query ? "?" + query : ""}`); } /** * Transaction information * @description Retrieve complete transaction data by transaction ID (txid). Returns the full transaction details including inputs, outputs, and metadata. The transaction data is read directly from the blockchain data files. - * @param {Txid} txid + * @param {Txid} txid * @returns {Promise} */ async getTxByTxid(txid) { @@ -6596,7 +7474,7 @@ class BrkClient extends BrkClientBase { /** * Transaction hex * @description Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format. - * @param {Txid} txid + * @param {Txid} txid * @returns {Promise} */ async getTxByTxidHex(txid) { @@ -6617,7 +7495,7 @@ class BrkClient extends BrkClientBase { /** * All output spend statuses * @description Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output. - * @param {Txid} txid + * @param {Txid} txid * @returns {Promise} */ async getTxByTxidOutspends(txid) { @@ -6627,7 +7505,7 @@ class BrkClient extends BrkClientBase { /** * Transaction status * @description Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp. - * @param {Txid} txid + * @param {Txid} txid * @returns {Promise} */ async getTxByTxidStatus(txid) { @@ -6664,7 +7542,7 @@ class BrkClient extends BrkClientBase { /** * Block fees * @description Get average block fees for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - * @param {TimePeriod} time_period + * @param {TimePeriod} time_period * @returns {Promise} */ async getV1MiningBlocksFeesByTimePeriod(time_period) { @@ -6674,7 +7552,7 @@ class BrkClient extends BrkClientBase { /** * Block rewards * @description Get average block rewards (coinbase = subsidy + fees) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - * @param {TimePeriod} time_period + * @param {TimePeriod} time_period * @returns {Promise} */ async getV1MiningBlocksRewardsByTimePeriod(time_period) { @@ -6684,7 +7562,7 @@ class BrkClient extends BrkClientBase { /** * Block sizes and weights * @description Get average block sizes and weights for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - * @param {TimePeriod} time_period + * @param {TimePeriod} time_period * @returns {Promise} */ async getV1MiningBlocksSizesWeightsByTimePeriod(time_period) { @@ -6694,7 +7572,7 @@ class BrkClient extends BrkClientBase { /** * Block by timestamp * @description Find the block closest to a given UNIX timestamp. - * @param {Timestamp} timestamp + * @param {Timestamp} timestamp * @returns {Promise} */ async getV1MiningBlocksTimestamp(timestamp) { @@ -6713,7 +7591,7 @@ class BrkClient extends BrkClientBase { /** * Difficulty adjustments * @description Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. Returns array of [timestamp, height, difficulty, change_percent]. - * @param {TimePeriod} time_period + * @param {TimePeriod} time_period * @returns {Promise} */ async getV1MiningDifficultyAdjustmentsByTimePeriod(time_period) { @@ -6732,7 +7610,7 @@ class BrkClient extends BrkClientBase { /** * Network hashrate * @description Get network hashrate and difficulty data for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - * @param {TimePeriod} time_period + * @param {TimePeriod} time_period * @returns {Promise} */ async getV1MiningHashrateByTimePeriod(time_period) { @@ -6742,7 +7620,7 @@ class BrkClient extends BrkClientBase { /** * Mining pool details * @description Get detailed information about a specific mining pool including block counts and shares for different time periods. - * @param {PoolSlug} slug + * @param {PoolSlug} slug * @returns {Promise} */ async getV1MiningPoolBySlug(slug) { @@ -6761,7 +7639,7 @@ class BrkClient extends BrkClientBase { /** * Mining pool statistics * @description Get mining pool statistics for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - * @param {TimePeriod} time_period + * @param {TimePeriod} time_period * @returns {Promise} */ async getV1MiningPoolsByTimePeriod(time_period) { @@ -6805,7 +7683,6 @@ class BrkClient extends BrkClientBase { async getVersion() { return this.get(`/version`); } - } export { BrkClient, BrkError }; diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index f778e31ca..fc9042492 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -2117,22 +2117,6 @@ 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 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: 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: 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.""" @@ -2149,6 +2133,22 @@ class RelativePattern2: 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 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: 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: 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 AddrCountPattern: """Pattern struct for repeated tree structure.""" @@ -2164,21 +2164,6 @@ 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 OhlcPattern(Generic[T]): - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - 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.""" @@ -2194,6 +2179,21 @@ class FeeRatePattern(Generic[T]): self.pct90: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct90')) self.txindex: MetricPattern28[T] = MetricPattern28(client, acc) +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.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 _0satsPattern: """Pattern struct for repeated tree structure.""" @@ -2208,6 +2208,19 @@ class _0satsPattern: self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) +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 UnrealizedPattern: """Pattern struct for repeated tree structure.""" @@ -2234,6 +2247,19 @@ class _100btcPattern: 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 _10yPattern: """Pattern struct for repeated tree structure.""" @@ -2260,39 +2286,13 @@ 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.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) + self.cumulative: MetricPattern2[T] = MetricPattern2(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')) @@ -2304,12 +2304,12 @@ class SizePattern(Generic[T]): def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) + self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) - self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max')) - self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min')) + 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.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'sum')) + self.sum: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'sum')) class ActivityPattern2: """Pattern struct for repeated tree structure.""" @@ -2343,16 +2343,6 @@ class DateindexPattern2: self.low: MetricPattern7[Cents] = MetricPattern7(client, _m(acc, 'low_cents')) self.open: MetricPattern7[Cents] = MetricPattern7(client, _m(acc, 'open_cents')) -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.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 HighPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2363,6 +2353,16 @@ class HighPattern(Generic[T]): self.height: MetricPattern12[T] = MetricPattern12(client, acc) self.rest: MetricPattern5[T] = MetricPattern5(client, _m(acc, 'max')) +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.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 _24hCoinbaseSumPattern: """Pattern struct for repeated tree structure.""" @@ -2372,33 +2372,6 @@ class _24hCoinbaseSumPattern: self.dollars: MetricPattern12[Dollars] = MetricPattern12(client, _m(acc, 'usd')) self.sats: MetricPattern12[Sats] = MetricPattern12(client, acc) -class SegwitAdoptionPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - 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 UnclaimedRewardsPattern: - """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) - class CoinbasePattern: """Pattern struct for repeated tree structure.""" @@ -2408,37 +2381,32 @@ class CoinbasePattern: self.dollars: BitcoinPattern[Dollars] = BitcoinPattern(client, _m(acc, 'usd')) self.sats: BitcoinPattern[Sats] = BitcoinPattern(client, acc) -class RelativePattern4: +class UnclaimedRewardsPattern: """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: 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')) + 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) -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 CostBasisPattern: +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 SupplyPattern2: +class SegwitAdoptionPattern: """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) + 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 SatsPattern: """Pattern struct for repeated tree structure.""" @@ -2448,6 +2416,38 @@ class SatsPattern: self.ohlc: OhlcPattern[OHLCSats] = OhlcPattern(client, _m(acc, 'ohlc_sats')) self.split: SplitPattern2[Sats] = SplitPattern2(client, _m(acc, 'sats')) +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 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 _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: + """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: 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 BlockCountPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2456,13 +2456,6 @@ class BlockCountPattern(Generic[T]): self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) self.sum: MetricPattern1[T] = MetricPattern1(client, acc) -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.""" @@ -2470,12 +2463,19 @@ class OutputsPattern: """Create pattern node with accumulated metric name.""" self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'utxo_count')) +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 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) + self.identity: MetricPattern25[T] = MetricPattern25(client, acc) # Catalog tree classes diff --git a/websites/bitview/index.html b/websites/bitview/index.html index c6dfa2f7b..02aa58c62 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.df202eed.js", + "/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.ab5c0c96.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",