diff --git a/Cargo.lock b/Cargo.lock index dcc738ae3..f2e916dcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2762,6 +2762,8 @@ dependencies = [ [[package]] name = "rawdb" version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a5e6777f8192d5ccaafddad97373ffa60e08f3251afa9365e2a161c69fd9dc" dependencies = [ "libc", "log", @@ -3703,6 +3705,8 @@ checksum = "8f54a172d0620933a27a4360d3db3e2ae0dd6cceae9730751a036bbf182c4b23" [[package]] name = "vecdb" version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650b943316db7a11c54684ab0390a787aed7fdb306f2e0c1f7cbdf8b2440644a" dependencies = [ "ctrlc", "log", @@ -3722,6 +3726,8 @@ dependencies = [ [[package]] name = "vecdb_derive" version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b71f12e3bfb96b62f18d6293029870102764565895effc4e25922002ad1db6" dependencies = [ "quote", "syn", diff --git a/Cargo.toml b/Cargo.toml index c8ee4613a..fcae36f0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,8 +79,8 @@ serde_json = { version = "1.0.149", features = ["float_roundtrip"] } smallvec = "1.15.1" tokio = { version = "1.49.0", features = ["rt-multi-thread"] } tracing = { version = "0.1", default-features = false, features = ["std"] } -# vecdb = { version = "0.5.6", features = ["derive", "serde_json", "pco", "schemars"] } -vecdb = { path = "../anydb/crates/vecdb", features = ["derive", "serde_json", "pco", "schemars"] } +vecdb = { version = "0.5.7", features = ["derive", "serde_json", "pco", "schemars"] } +# vecdb = { path = "../anydb/crates/vecdb", features = ["derive", "serde_json", "pco", "schemars"] } # vecdb = { git = "https://github.com/anydb-rs/anydb", features = ["derive", "serde_json", "pco"] } [workspace.metadata.release] diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index a7646f203..77945f6b8 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -2741,56 +2741,6 @@ impl Price111dSmaPattern { } } -/// Pattern struct for repeated tree structure. -pub struct ActivePriceRatioPattern { - pub ratio: MetricPattern4, - pub ratio_1m_sma: MetricPattern4, - pub ratio_1w_sma: MetricPattern4, - pub ratio_1y_sd: Ratio1ySdPattern, - pub ratio_2y_sd: Ratio1ySdPattern, - pub ratio_4y_sd: Ratio1ySdPattern, - pub ratio_pct1: MetricPattern4, - pub ratio_pct1_usd: MetricPattern4, - pub ratio_pct2: MetricPattern4, - pub ratio_pct2_usd: MetricPattern4, - pub ratio_pct5: MetricPattern4, - pub ratio_pct5_usd: MetricPattern4, - pub ratio_pct95: MetricPattern4, - pub ratio_pct95_usd: MetricPattern4, - pub ratio_pct98: MetricPattern4, - pub ratio_pct98_usd: MetricPattern4, - pub ratio_pct99: MetricPattern4, - pub ratio_pct99_usd: MetricPattern4, - pub ratio_sd: Ratio1ySdPattern, -} - -impl ActivePriceRatioPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - ratio: MetricPattern4::new(client.clone(), acc.clone()), - ratio_1m_sma: MetricPattern4::new(client.clone(), _m(&acc, "1m_sma")), - ratio_1w_sma: MetricPattern4::new(client.clone(), _m(&acc, "1w_sma")), - ratio_1y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "1y")), - ratio_2y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "2y")), - ratio_4y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "4y")), - ratio_pct1: MetricPattern4::new(client.clone(), _m(&acc, "pct1")), - ratio_pct1_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct1_usd")), - ratio_pct2: MetricPattern4::new(client.clone(), _m(&acc, "pct2")), - ratio_pct2_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct2_usd")), - ratio_pct5: MetricPattern4::new(client.clone(), _m(&acc, "pct5")), - ratio_pct5_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct5_usd")), - ratio_pct95: MetricPattern4::new(client.clone(), _m(&acc, "pct95")), - ratio_pct95_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct95_usd")), - ratio_pct98: MetricPattern4::new(client.clone(), _m(&acc, "pct98")), - ratio_pct98_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct98_usd")), - ratio_pct99: MetricPattern4::new(client.clone(), _m(&acc, "pct99")), - ratio_pct99_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct99_usd")), - ratio_sd: Ratio1ySdPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct PercentilesPattern2 { pub cost_basis_pct05: MetricPattern4, @@ -2841,6 +2791,56 @@ impl PercentilesPattern2 { } } +/// Pattern struct for repeated tree structure. +pub struct ActivePriceRatioPattern { + pub ratio: MetricPattern4, + pub ratio_1m_sma: MetricPattern4, + pub ratio_1w_sma: MetricPattern4, + pub ratio_1y_sd: Ratio1ySdPattern, + pub ratio_2y_sd: Ratio1ySdPattern, + pub ratio_4y_sd: Ratio1ySdPattern, + pub ratio_pct1: MetricPattern4, + pub ratio_pct1_usd: MetricPattern4, + pub ratio_pct2: MetricPattern4, + pub ratio_pct2_usd: MetricPattern4, + pub ratio_pct5: MetricPattern4, + pub ratio_pct5_usd: MetricPattern4, + pub ratio_pct95: MetricPattern4, + pub ratio_pct95_usd: MetricPattern4, + pub ratio_pct98: MetricPattern4, + pub ratio_pct98_usd: MetricPattern4, + pub ratio_pct99: MetricPattern4, + pub ratio_pct99_usd: MetricPattern4, + pub ratio_sd: Ratio1ySdPattern, +} + +impl ActivePriceRatioPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + ratio: MetricPattern4::new(client.clone(), acc.clone()), + ratio_1m_sma: MetricPattern4::new(client.clone(), _m(&acc, "1m_sma")), + ratio_1w_sma: MetricPattern4::new(client.clone(), _m(&acc, "1w_sma")), + ratio_1y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "1y")), + ratio_2y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "2y")), + ratio_4y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "4y")), + ratio_pct1: MetricPattern4::new(client.clone(), _m(&acc, "pct1")), + ratio_pct1_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct1_usd")), + ratio_pct2: MetricPattern4::new(client.clone(), _m(&acc, "pct2")), + ratio_pct2_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct2_usd")), + ratio_pct5: MetricPattern4::new(client.clone(), _m(&acc, "pct5")), + ratio_pct5_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct5_usd")), + ratio_pct95: MetricPattern4::new(client.clone(), _m(&acc, "pct95")), + ratio_pct95_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct95_usd")), + ratio_pct98: MetricPattern4::new(client.clone(), _m(&acc, "pct98")), + ratio_pct98_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct98_usd")), + ratio_pct99: MetricPattern4::new(client.clone(), _m(&acc, "pct99")), + ratio_pct99_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct99_usd")), + ratio_sd: Ratio1ySdPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct RelativePattern5 { pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, @@ -3073,38 +3073,6 @@ impl ClassAveragePricePattern { } } -/// Pattern struct for repeated tree structure. -pub struct RelativePattern2 { - pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, - pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1, - pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, - pub unrealized_loss_rel_to_own_market_cap: MetricPattern1, - pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub unrealized_profit_rel_to_own_market_cap: MetricPattern1, - pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, -} - -impl RelativePattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), - neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), - net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), - net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), - unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), - unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), - unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), - unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct RelativePattern { pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, @@ -3137,6 +3105,38 @@ impl RelativePattern { } } +/// Pattern struct for repeated tree structure. +pub struct RelativePattern2 { + pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, + pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, + pub unrealized_loss_rel_to_own_market_cap: MetricPattern1, + pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub unrealized_profit_rel_to_own_market_cap: MetricPattern1, + pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, +} + +impl RelativePattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), + neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), + net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), + net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), + supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), + supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), + unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), + unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), + unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), + unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), + } + } +} + /// 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 FeeRatePattern { - pub average: MetricPattern1, - pub max: MetricPattern1, - pub median: MetricPattern12, - pub min: MetricPattern1, - pub pct10: MetricPattern12, - pub pct25: MetricPattern12, - pub pct75: MetricPattern12, - pub pct90: MetricPattern12, - pub txindex: MetricPattern28, -} - -impl FeeRatePattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - average: MetricPattern1::new(client.clone(), _m(&acc, "average")), - max: MetricPattern1::new(client.clone(), _m(&acc, "max")), - median: MetricPattern12::new(client.clone(), _m(&acc, "median")), - min: MetricPattern1::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern12::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern12::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern12::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern12::new(client.clone(), _m(&acc, "pct90")), - txindex: MetricPattern28::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct OhlcPattern { pub dateindex: MetricPattern7, @@ -3227,6 +3197,36 @@ impl OhlcPattern { } } +/// Pattern struct for repeated tree structure. +pub struct FeeRatePattern { + pub average: MetricPattern1, + pub max: MetricPattern1, + pub median: MetricPattern12, + pub min: MetricPattern1, + pub pct10: MetricPattern12, + pub pct25: MetricPattern12, + pub pct75: MetricPattern12, + pub pct90: MetricPattern12, + pub txindex: MetricPattern28, +} + +impl FeeRatePattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + average: MetricPattern1::new(client.clone(), _m(&acc, "average")), + max: MetricPattern1::new(client.clone(), _m(&acc, "max")), + median: MetricPattern12::new(client.clone(), _m(&acc, "median")), + min: MetricPattern1::new(client.clone(), _m(&acc, "min")), + pct10: MetricPattern12::new(client.clone(), _m(&acc, "pct10")), + pct25: MetricPattern12::new(client.clone(), _m(&acc, "pct25")), + pct75: MetricPattern12::new(client.clone(), _m(&acc, "pct75")), + pct90: MetricPattern12::new(client.clone(), _m(&acc, "pct90")), + txindex: MetricPattern28::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _0satsPattern { pub activity: ActivityPattern2, @@ -3256,76 +3256,24 @@ impl _0satsPattern { } /// Pattern struct for repeated tree structure. -pub struct _0satsPattern2 { +pub struct _10yPattern { 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, - pub net_unrealized_pnl: MetricPattern1, - pub supply_in_loss: _24hCoinbaseSumPattern, - pub supply_in_profit: _24hCoinbaseSumPattern, - pub total_unrealized_pnl: MetricPattern1, - pub unrealized_loss: MetricPattern1, - pub unrealized_profit: MetricPattern1, -} - -impl UnrealizedPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - neg_unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")), - net_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl")), - supply_in_loss: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_loss")), - supply_in_profit: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_profit")), - total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_unrealized_pnl")), - unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss")), - unrealized_profit: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct _100btcPattern { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern, - pub outputs: OutputsPattern, - pub realized: RealizedPattern, + pub realized: RealizedPattern4, pub relative: RelativePattern, pub supply: SupplyPattern2, pub unrealized: UnrealizedPattern, } -impl _100btcPattern { +impl _10yPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { activity: ActivityPattern2::new(client.clone(), acc.clone()), cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), outputs: OutputsPattern::new(client.clone(), acc.clone()), - realized: RealizedPattern::new(client.clone(), acc.clone()), + realized: RealizedPattern4::new(client.clone(), acc.clone()), relative: RelativePattern::new(client.clone(), acc.clone()), supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), @@ -3360,24 +3308,50 @@ impl _10yTo12yPattern { } /// Pattern struct for repeated tree structure. -pub struct _10yPattern { +pub struct _0satsPattern2 { pub activity: ActivityPattern2, pub cost_basis: CostBasisPattern, pub outputs: OutputsPattern, - pub realized: RealizedPattern4, - pub relative: RelativePattern, + pub realized: RealizedPattern, + pub relative: RelativePattern4, pub supply: SupplyPattern2, pub unrealized: UnrealizedPattern, } -impl _10yPattern { +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: RealizedPattern4::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 _100btcPattern { + pub activity: ActivityPattern2, + pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, + pub realized: RealizedPattern, + pub relative: RelativePattern, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, +} + +impl _100btcPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: ActivityPattern2::new(client.clone(), acc.clone()), + cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), acc.clone()), + realized: RealizedPattern::new(client.clone(), acc.clone()), relative: RelativePattern::new(client.clone(), acc.clone()), supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), @@ -3385,6 +3359,32 @@ impl _10yPattern { } } +/// Pattern struct for repeated tree structure. +pub struct UnrealizedPattern { + pub neg_unrealized_loss: MetricPattern1, + pub net_unrealized_pnl: MetricPattern1, + pub supply_in_loss: _24hCoinbaseSumPattern, + pub supply_in_profit: _24hCoinbaseSumPattern, + pub total_unrealized_pnl: MetricPattern1, + pub unrealized_loss: MetricPattern1, + pub unrealized_profit: MetricPattern1, +} + +impl UnrealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + neg_unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")), + net_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl")), + supply_in_loss: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_loss")), + supply_in_profit: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_profit")), + total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_unrealized_pnl")), + unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss")), + unrealized_profit: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct PeriodCagrPattern { pub _10y: MetricPattern4, @@ -3414,7 +3414,7 @@ impl PeriodCagrPattern { /// Pattern struct for repeated tree structure. pub struct BitcoinPattern { pub average: MetricPattern2, - pub cumulative: MetricPattern2, + pub cumulative: MetricPattern1, 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: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), + cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), height: MetricPattern12::new(client.clone(), acc.clone()), max: MetricPattern2::new(client.clone(), _m(&acc, "max")), min: MetricPattern2::new(client.clone(), _m(&acc, "min")), @@ -3671,22 +3671,6 @@ 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, @@ -3719,6 +3703,22 @@ impl _1dReturns1mSdPattern { } } +/// 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 RelativePattern4 { pub supply_in_loss_rel_to_own_supply: MetricPattern1, @@ -3737,7 +3737,7 @@ impl RelativePattern4 { /// Pattern struct for repeated tree structure. pub struct BlockCountPattern { - pub cumulative: MetricPattern1, + pub cumulative: MetricPattern2, pub sum: MetricPattern1, } @@ -3745,26 +3745,12 @@ impl BlockCountPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), sum: MetricPattern1::new(client.clone(), acc.clone()), } } } -/// Pattern struct for repeated tree structure. -pub struct OutputsPattern { - pub utxo_count: MetricPattern1, -} - -impl OutputsPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - utxo_count: MetricPattern1::new(client.clone(), _m(&acc, "utxo_count")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct RealizedPriceExtraPattern { pub ratio: MetricPattern4, @@ -3779,6 +3765,20 @@ impl RealizedPriceExtraPattern { } } +/// Pattern struct for repeated tree structure. +pub struct OutputsPattern { + pub utxo_count: MetricPattern1, +} + +impl OutputsPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + utxo_count: MetricPattern1::new(client.clone(), _m(&acc, "utxo_count")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct EmptyPattern { pub identity: MetricPattern25, diff --git a/crates/brk_computer/src/blocks/size/import.rs b/crates/brk_computer/src/blocks/size/import.rs index b86c6b120..2d134a2ff 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::{ComputedDerivedBlockFull, BlockFullLazyHeight}}; +use crate::{indexes, internal::{ComputedDerivedBlockFull, LazyBlockFullHeight}}; impl Vecs { pub fn forced_import( @@ -14,7 +14,7 @@ impl Vecs { indexes: &indexes::Vecs, ) -> Result { Ok(Self { - vbytes: BlockFullLazyHeight::forced_import_with_init( + vbytes: LazyBlockFullHeight::forced_import_with_init( db, "block_vbytes", version, diff --git a/crates/brk_computer/src/blocks/size/vecs.rs b/crates/brk_computer/src/blocks/size/vecs.rs index 95d6d39a4..c1d3239a1 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::{ComputedDerivedBlockFull, BlockFullLazyHeight}; +use crate::internal::{ComputedDerivedBlockFull, LazyBlockFullHeight}; #[derive(Clone, Traversable)] pub struct Vecs { - pub vbytes: BlockFullLazyHeight, + pub vbytes: LazyBlockFullHeight, pub size: ComputedDerivedBlockFull, } diff --git a/crates/brk_computer/src/distribution/metrics/realized.rs b/crates/brk_computer/src/distribution/metrics/realized.rs index 487b67571..f1461ef8f 100644 --- a/crates/brk_computer/src/distribution/metrics/realized.rs +++ b/crates/brk_computer/src/distribution/metrics/realized.rs @@ -12,8 +12,8 @@ use crate::{ distribution::state::RealizedState, indexes, internal::{ - BinaryBlockSum, BinaryBlockSumCum, ComputedBlockLast, ComputedBlockSum, - ComputedBlockSumCum, ComputedDateLast, ComputedRatioVecsDate, DollarsMinus, + ComputedBlockLast, ComputedBlockSum, ComputedBlockSumCum, ComputedDateLast, + ComputedRatioVecsDate, DollarsMinus, LazyBinaryBlockSum, LazyBinaryBlockSumCum, LazyBlockSum, LazyBlockSumCum, LazyDateLast, PercentageDollarsF32, StoredF32Identity, }, price, @@ -43,9 +43,9 @@ pub struct RealizedMetrics { pub realized_value: ComputedBlockSum, // === Realized vs Realized Cap Ratios (lazy) === - pub realized_profit_rel_to_realized_cap: BinaryBlockSumCum, - pub realized_loss_rel_to_realized_cap: BinaryBlockSumCum, - pub net_realized_pnl_rel_to_realized_cap: BinaryBlockSumCum, + pub realized_profit_rel_to_realized_cap: LazyBinaryBlockSumCum, + pub realized_loss_rel_to_realized_cap: LazyBinaryBlockSumCum, + pub net_realized_pnl_rel_to_realized_cap: LazyBinaryBlockSumCum, // === Total Realized PnL === pub total_realized_pnl: LazyBlockSum, @@ -56,8 +56,8 @@ pub struct RealizedMetrics { pub value_destroyed: ComputedBlockSum, // === Adjusted Value (lazy: cohort - up_to_1h) === - pub adjusted_value_created: Option>, - pub adjusted_value_destroyed: Option>, + pub adjusted_value_created: Option>, + pub adjusted_value_destroyed: Option>, // === SOPR (Spent Output Profit Ratio) === pub sopr: EagerVec>, @@ -140,7 +140,7 @@ impl RealizedMetrics { // Construct lazy ratio vecs let realized_profit_rel_to_realized_cap = - BinaryBlockSumCum::from_computed_last::( + LazyBinaryBlockSumCum::from_computed_last::( &cfg.name("realized_profit_rel_to_realized_cap"), cfg.version + v1, realized_profit.height.boxed_clone(), @@ -150,7 +150,7 @@ impl RealizedMetrics { ); let realized_loss_rel_to_realized_cap = - BinaryBlockSumCum::from_computed_last::( + LazyBinaryBlockSumCum::from_computed_last::( &cfg.name("realized_loss_rel_to_realized_cap"), cfg.version + v1, realized_loss.height.boxed_clone(), @@ -160,7 +160,7 @@ impl RealizedMetrics { ); let net_realized_pnl_rel_to_realized_cap = - BinaryBlockSumCum::from_computed_last::( + LazyBinaryBlockSumCum::from_computed_last::( &cfg.name("net_realized_pnl_rel_to_realized_cap"), cfg.version + v1, net_realized_pnl.height.boxed_clone(), @@ -194,7 +194,7 @@ impl RealizedMetrics { let adjusted_value_created = (compute_adjusted && cfg.up_to_1h_realized.is_some()).then(|| { let up_to_1h = cfg.up_to_1h_realized.unwrap(); - BinaryBlockSum::from_computed::( + LazyBinaryBlockSum::from_computed::( &cfg.name("adjusted_value_created"), cfg.version, &value_created, @@ -204,7 +204,7 @@ impl RealizedMetrics { let adjusted_value_destroyed = (compute_adjusted && cfg.up_to_1h_realized.is_some()).then(|| { let up_to_1h = cfg.up_to_1h_realized.unwrap(); - BinaryBlockSum::from_computed::( + LazyBinaryBlockSum::from_computed::( &cfg.name("adjusted_value_destroyed"), cfg.version, &value_destroyed, diff --git a/crates/brk_computer/src/distribution/metrics/supply.rs b/crates/brk_computer/src/distribution/metrics/supply.rs index 1fc03c3fe..28fe50037 100644 --- a/crates/brk_computer/src/distribution/metrics/supply.rs +++ b/crates/brk_computer/src/distribution/metrics/supply.rs @@ -9,7 +9,7 @@ use vecdb::{AnyStoredVec, AnyVec, Exit, GenericStoredVec}; use crate::{ indexes, internal::{ - HalfClosePriceTimesSats, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyBinaryLastBlockValue, + HalfClosePriceTimesSats, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyBinaryValueBlockLast, ValueBlockLast, }, price, @@ -21,7 +21,7 @@ use super::ImportConfig; #[derive(Clone, Traversable)] pub struct SupplyMetrics { pub total: ValueBlockLast, - pub halved: LazyBinaryLastBlockValue, + pub halved: LazyBinaryValueBlockLast, } impl SupplyMetrics { @@ -37,7 +37,7 @@ impl SupplyMetrics { compute_dollars, )?; - let supply_half = LazyBinaryLastBlockValue::from_block_source::< + let supply_half = LazyBinaryValueBlockLast::from_block_source::< HalveSats, HalveSatsToBitcoin, HalfClosePriceTimesSats, diff --git a/crates/brk_computer/src/distribution/metrics/unrealized.rs b/crates/brk_computer/src/distribution/metrics/unrealized.rs index b772795c2..8b0a71acf 100644 --- a/crates/brk_computer/src/distribution/metrics/unrealized.rs +++ b/crates/brk_computer/src/distribution/metrics/unrealized.rs @@ -9,7 +9,7 @@ use crate::{ distribution::state::UnrealizedState, internal::{ ComputedHeightDateLast, DollarsMinus, DollarsPlus, LazyBinaryBlockLast, LazyBlockLast, - ValueBlockDateLast, + ValueHeightDateLast, }, }; @@ -19,8 +19,8 @@ use super::ImportConfig; #[derive(Clone, Traversable)] pub struct UnrealizedMetrics { // === Supply in Profit/Loss === - pub supply_in_profit: ValueBlockDateLast, - pub supply_in_loss: ValueBlockDateLast, + pub supply_in_profit: ValueHeightDateLast, + pub supply_in_loss: ValueHeightDateLast, // === Unrealized Profit/Loss === pub unrealized_profit: ComputedHeightDateLast, @@ -40,7 +40,7 @@ impl UnrealizedMetrics { let compute_dollars = cfg.compute_dollars(); // === Supply in Profit/Loss === - let supply_in_profit = ValueBlockDateLast::forced_import( + let supply_in_profit = ValueHeightDateLast::forced_import( cfg.db, &cfg.name("supply_in_profit"), cfg.version, @@ -48,7 +48,7 @@ impl UnrealizedMetrics { cfg.indexes, cfg.price, )?; - let supply_in_loss = ValueBlockDateLast::forced_import( + let supply_in_loss = ValueHeightDateLast::forced_import( cfg.db, &cfg.name("supply_in_loss"), cfg.version, diff --git a/crates/brk_computer/src/internal/computed/block/mod.rs b/crates/brk_computer/src/internal/computed/block/mod.rs deleted file mode 100644 index d3508550f..000000000 --- a/crates/brk_computer/src/internal/computed/block/mod.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! Block-level computed types (height + dateindex + periods + difficultyepoch). -//! -//! For simpler chain-level types (height + difficultyepoch only), see `chain/`. - -mod full; -mod height_date_bytes; -mod height_date_first; -mod height_date_last; -mod height_date_max; -mod height_date_min; -mod last; -mod lazy_height_sum_cum; -mod sum; -mod sum_cum; - -pub use full::*; -pub use height_date_bytes::*; -pub use height_date_first::*; -pub use height_date_last::*; -pub use height_date_max::*; -pub use height_date_min::*; -pub use last::*; -pub use lazy_height_sum_cum::*; -pub use sum::*; -pub use sum_cum::*; diff --git a/crates/brk_computer/src/internal/computed/date/mod.rs b/crates/brk_computer/src/internal/computed/date/mod.rs deleted file mode 100644 index bbebb8746..000000000 --- a/crates/brk_computer/src/internal/computed/date/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod average; -mod first; -mod last; -mod max; -mod min; - -pub use average::*; -pub use first::*; -pub use last::*; -pub use max::*; -pub use min::*; diff --git a/crates/brk_computer/src/internal/computed/mod.rs b/crates/brk_computer/src/internal/computed/mod.rs deleted file mode 100644 index 6e0f85fb1..000000000 --- a/crates/brk_computer/src/internal/computed/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod block; -mod date; -mod tx; - -pub use block::*; -pub use date::*; -pub use tx::*; diff --git a/crates/brk_computer/src/internal/derived/block/mod.rs b/crates/brk_computer/src/internal/derived/block/mod.rs deleted file mode 100644 index d0fa0a4d0..000000000 --- a/crates/brk_computer/src/internal/derived/block/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod distribution; -mod first; -mod full; -mod last; -mod sum; -mod sum_cum; - -pub use distribution::*; -pub use first::*; -pub use full::*; -pub use last::*; -pub use sum::*; -pub use sum_cum::*; diff --git a/crates/brk_computer/src/internal/derived/mod.rs b/crates/brk_computer/src/internal/derived/mod.rs deleted file mode 100644 index 6e0f85fb1..000000000 --- a/crates/brk_computer/src/internal/derived/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod block; -mod date; -mod tx; - -pub use block::*; -pub use date::*; -pub use tx::*; diff --git a/crates/brk_computer/src/internal/derived/tx/mod.rs b/crates/brk_computer/src/internal/derived/tx/mod.rs deleted file mode 100644 index b0d01da0e..000000000 --- a/crates/brk_computer/src/internal/derived/tx/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod distribution; -mod full; - -pub use distribution::*; -pub use full::*; diff --git a/crates/brk_computer/src/internal/lazy/date/mod.rs b/crates/brk_computer/src/internal/lazy/date/mod.rs deleted file mode 100644 index caf157d67..000000000 --- a/crates/brk_computer/src/internal/lazy/date/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -mod binary_height_date_last; -mod binary_last; -mod binary_sum; -mod binary_sum_cum; -mod full; -mod last; -mod sum; -mod sum_cum; - -pub use binary_height_date_last::*; -pub use binary_last::*; -pub use binary_sum::*; -pub use binary_sum_cum::*; -pub use full::*; -pub use last::*; -pub use sum::*; -pub use sum_cum::*; diff --git a/crates/brk_computer/src/internal/lazy/derived_block/mod.rs b/crates/brk_computer/src/internal/lazy/derived_block/mod.rs deleted file mode 100644 index a53d333f9..000000000 --- a/crates/brk_computer/src/internal/lazy/derived_block/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -mod binary_last; -mod binary_sum; -mod binary_sum_cum; -mod full; -mod last; -mod sum; -mod sum_cum; - -pub use binary_last::*; -pub use binary_sum::*; -pub use binary_sum_cum::*; -pub use full::*; -pub use last::*; -pub use sum::*; -pub use sum_cum::*; diff --git a/crates/brk_computer/src/internal/lazy/derived_tx/mod.rs b/crates/brk_computer/src/internal/lazy/derived_tx/mod.rs deleted file mode 100644 index b0d01da0e..000000000 --- a/crates/brk_computer/src/internal/lazy/derived_tx/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod distribution; -mod full; - -pub use distribution::*; -pub use full::*; diff --git a/crates/brk_computer/src/internal/lazy/mod.rs b/crates/brk_computer/src/internal/lazy/mod.rs deleted file mode 100644 index 6ec75b4a3..000000000 --- a/crates/brk_computer/src/internal/lazy/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -mod block; -mod date; -mod derived_block; -mod derived_tx; -mod transform; - -pub use block::*; -pub use date::*; -pub use derived_tx::*; -pub use transform::*; diff --git a/crates/brk_computer/src/internal/mod.rs b/crates/brk_computer/src/internal/mod.rs index 6236074eb..38d76b1ee 100644 --- a/crates/brk_computer/src/internal/mod.rs +++ b/crates/brk_computer/src/internal/mod.rs @@ -1,21 +1,9 @@ -mod aggregation; mod compute; -mod computed; -mod derived; -mod group; -mod lazy; -mod specialized; +mod multi; +mod single; mod traits; -mod transform; -mod vec; -pub(crate) use aggregation::*; pub(crate) use compute::*; -pub(crate) use computed::*; -pub(crate) use derived::*; -pub(crate) use group::*; -pub(crate) use lazy::*; -pub(crate) use specialized::*; +pub(crate) use multi::*; +pub(crate) use single::*; pub(crate) use traits::*; -pub(crate) use transform::*; -pub(crate) use vec::*; diff --git a/crates/brk_computer/src/internal/computed/date/average.rs b/crates/brk_computer/src/internal/multi/date/average.rs similarity index 90% rename from crates/brk_computer/src/internal/computed/date/average.rs rename to crates/brk_computer/src/internal/multi/date/average.rs index 068354cf4..378457ae7 100644 --- a/crates/brk_computer/src/internal/computed/date/average.rs +++ b/crates/brk_computer/src/internal/multi/date/average.rs @@ -1,4 +1,4 @@ -//! ComputedVecsDate using only average-value aggregation. +//! ComputedDateAverage - dateindex storage + lazy periods for average-value aggregation. use brk_error::Result; use brk_traversable::Traversable; @@ -13,7 +13,7 @@ use crate::internal::{ComputedVecValue, LazyPeriodsAverage}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct ComputedVecsDateAverage +pub struct ComputedDateAverage where T: ComputedVecValue + PartialOrd + JsonSchema, { @@ -26,7 +26,7 @@ where const VERSION: Version = Version::ZERO; -impl ComputedVecsDateAverage +impl ComputedDateAverage where T: ComputedVecValue + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/lazy/date/binary_last.rs b/crates/brk_computer/src/internal/multi/date/binary_last.rs similarity index 99% rename from crates/brk_computer/src/internal/lazy/date/binary_last.rs rename to crates/brk_computer/src/internal/multi/date/binary_last.rs index 9838b8acc..728cb534c 100644 --- a/crates/brk_computer/src/internal/lazy/date/binary_last.rs +++ b/crates/brk_computer/src/internal/multi/date/binary_last.rs @@ -8,12 +8,10 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedVecValue, LazyPeriodsLast, - LazyPeriodsSumCum, NumericValue, + ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedVecValue, LazyBinaryTransformLast, + LazyPeriodsLast, LazyPeriodsSumCum, NumericValue, }; -use super::super::transform::LazyBinaryTransformLast; - const VERSION: Version = Version::ZERO; #[derive(Clone, Traversable)] diff --git a/crates/brk_computer/src/internal/lazy/date/binary_sum.rs b/crates/brk_computer/src/internal/multi/date/binary_sum.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/date/binary_sum.rs rename to crates/brk_computer/src/internal/multi/date/binary_sum.rs diff --git a/crates/brk_computer/src/internal/lazy/date/binary_sum_cum.rs b/crates/brk_computer/src/internal/multi/date/binary_sum_cum.rs similarity index 97% rename from crates/brk_computer/src/internal/lazy/date/binary_sum_cum.rs rename to crates/brk_computer/src/internal/multi/date/binary_sum_cum.rs index 477714cba..0f0eb33cc 100644 --- a/crates/brk_computer/src/internal/lazy/date/binary_sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/date/binary_sum_cum.rs @@ -8,12 +8,11 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableCloneableVec}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast, - ComputedDerivedBlockSumCum, LazyPeriodsFull, LazyPeriodsSumCum, NumericValue, SumCum, + ComputedBlockLast, ComputedBlockSumCum, ComputedDerivedBlockLast, + ComputedDerivedBlockSumCum, ComputedVecValue, LazyBinaryTransformSumCum, LazyPeriodsFull, + LazyPeriodsSumCum, NumericValue, SumCum, }; -use super::super::transform::LazyBinaryTransformSumCum; - const VERSION: Version = Version::ZERO; #[derive(Clone, Traversable)] diff --git a/crates/brk_computer/src/internal/computed/date/first.rs b/crates/brk_computer/src/internal/multi/date/first.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/date/first.rs rename to crates/brk_computer/src/internal/multi/date/first.rs diff --git a/crates/brk_computer/src/internal/computed/date/last.rs b/crates/brk_computer/src/internal/multi/date/last.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/date/last.rs rename to crates/brk_computer/src/internal/multi/date/last.rs diff --git a/crates/brk_computer/src/internal/lazy/date/full.rs b/crates/brk_computer/src/internal/multi/date/lazy_full.rs similarity index 93% rename from crates/brk_computer/src/internal/lazy/date/full.rs rename to crates/brk_computer/src/internal/multi/date/lazy_full.rs index 721b8eb48..deac7117c 100644 --- a/crates/brk_computer/src/internal/lazy/date/full.rs +++ b/crates/brk_computer/src/internal/multi/date/lazy_full.rs @@ -5,9 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex, use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedVecValue, LazyPeriodsFull, Full}; - -use super::super::transform::{LazyTransformFull, LazyTransformStats}; +use crate::internal::{ComputedVecValue, Full, LazyPeriodsFull, LazyTransformFull, LazyTransformStats}; const VERSION: Version = Version::ZERO; diff --git a/crates/brk_computer/src/internal/lazy/date/last.rs b/crates/brk_computer/src/internal/multi/date/lazy_last.rs similarity index 96% rename from crates/brk_computer/src/internal/lazy/date/last.rs rename to crates/brk_computer/src/internal/multi/date/lazy_last.rs index da3988ae2..01073c6c6 100644 --- a/crates/brk_computer/src/internal/lazy/date/last.rs +++ b/crates/brk_computer/src/internal/multi/date/lazy_last.rs @@ -7,9 +7,7 @@ use brk_types::{ use schemars::JsonSchema; use vecdb::{IterableBoxedVec, IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedBlockLast, ComputedDateLast, ComputedVecValue, LazyPeriodsLast, NumericValue}; - -use super::super::transform::LazyTransformLast; +use crate::internal::{ComputedBlockLast, ComputedDateLast, ComputedVecValue, LazyPeriodsLast, LazyTransformLast, NumericValue}; const VERSION: Version = Version::ZERO; diff --git a/crates/brk_computer/src/internal/lazy/date/sum.rs b/crates/brk_computer/src/internal/multi/date/lazy_sum.rs similarity index 94% rename from crates/brk_computer/src/internal/lazy/date/sum.rs rename to crates/brk_computer/src/internal/multi/date/lazy_sum.rs index 71686863d..e2b1eae63 100644 --- a/crates/brk_computer/src/internal/lazy/date/sum.rs +++ b/crates/brk_computer/src/internal/multi/date/lazy_sum.rs @@ -5,9 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex, use schemars::JsonSchema; use vecdb::{IterableBoxedVec, IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedVecValue, LazyPeriodsSum}; - -use super::super::transform::LazyTransformSum; +use crate::internal::{ComputedVecValue, LazyPeriodsSum, LazyTransformSum}; const VERSION: Version = Version::ZERO; diff --git a/crates/brk_computer/src/internal/lazy/date/sum_cum.rs b/crates/brk_computer/src/internal/multi/date/lazy_sum_cum.rs similarity index 94% rename from crates/brk_computer/src/internal/lazy/date/sum_cum.rs rename to crates/brk_computer/src/internal/multi/date/lazy_sum_cum.rs index 7819f69bc..d733f2032 100644 --- a/crates/brk_computer/src/internal/lazy/date/sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/date/lazy_sum_cum.rs @@ -5,9 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex, use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedVecValue, LazyPeriodsSumCum, SumCum}; - -use super::super::transform::LazyTransformSumCum; +use crate::internal::{ComputedVecValue, LazyPeriodsSumCum, LazyTransformSumCum, SumCum}; const VERSION: Version = Version::ZERO; diff --git a/crates/brk_computer/src/internal/computed/date/max.rs b/crates/brk_computer/src/internal/multi/date/max.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/date/max.rs rename to crates/brk_computer/src/internal/multi/date/max.rs diff --git a/crates/brk_computer/src/internal/computed/date/min.rs b/crates/brk_computer/src/internal/multi/date/min.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/date/min.rs rename to crates/brk_computer/src/internal/multi/date/min.rs diff --git a/crates/brk_computer/src/internal/multi/date/mod.rs b/crates/brk_computer/src/internal/multi/date/mod.rs new file mode 100644 index 000000000..c83a41740 --- /dev/null +++ b/crates/brk_computer/src/internal/multi/date/mod.rs @@ -0,0 +1,25 @@ +mod average; +mod binary_last; +mod binary_sum; +mod binary_sum_cum; +mod first; +mod last; +mod lazy_full; +mod lazy_last; +mod lazy_sum; +mod lazy_sum_cum; +mod max; +mod min; + +pub use average::*; +pub use binary_last::*; +pub use binary_sum::*; +pub use binary_sum_cum::*; +pub use first::*; +pub use last::*; +pub use lazy_full::*; +pub use lazy_last::*; +pub use lazy_sum::*; +pub use lazy_sum_cum::*; +pub use max::*; +pub use min::*; diff --git a/crates/brk_computer/src/internal/derived/date/average.rs b/crates/brk_computer/src/internal/multi/derived_date/average.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/average.rs rename to crates/brk_computer/src/internal/multi/derived_date/average.rs diff --git a/crates/brk_computer/src/internal/derived/date/distribution.rs b/crates/brk_computer/src/internal/multi/derived_date/distribution.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/distribution.rs rename to crates/brk_computer/src/internal/multi/derived_date/distribution.rs diff --git a/crates/brk_computer/src/internal/derived/date/first.rs b/crates/brk_computer/src/internal/multi/derived_date/first.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/first.rs rename to crates/brk_computer/src/internal/multi/derived_date/first.rs diff --git a/crates/brk_computer/src/internal/derived/date/full.rs b/crates/brk_computer/src/internal/multi/derived_date/full.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/full.rs rename to crates/brk_computer/src/internal/multi/derived_date/full.rs diff --git a/crates/brk_computer/src/internal/derived/date/last.rs b/crates/brk_computer/src/internal/multi/derived_date/last.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/last.rs rename to crates/brk_computer/src/internal/multi/derived_date/last.rs diff --git a/crates/brk_computer/src/internal/specialized/lazy_period.rs b/crates/brk_computer/src/internal/multi/derived_date/lazy.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/lazy_period.rs rename to crates/brk_computer/src/internal/multi/derived_date/lazy.rs diff --git a/crates/brk_computer/src/internal/derived/date/max.rs b/crates/brk_computer/src/internal/multi/derived_date/max.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/max.rs rename to crates/brk_computer/src/internal/multi/derived_date/max.rs diff --git a/crates/brk_computer/src/internal/derived/date/min.rs b/crates/brk_computer/src/internal/multi/derived_date/min.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/min.rs rename to crates/brk_computer/src/internal/multi/derived_date/min.rs diff --git a/crates/brk_computer/src/internal/derived/date/mod.rs b/crates/brk_computer/src/internal/multi/derived_date/mod.rs similarity index 90% rename from crates/brk_computer/src/internal/derived/date/mod.rs rename to crates/brk_computer/src/internal/multi/derived_date/mod.rs index 2061797f6..c2340e54d 100644 --- a/crates/brk_computer/src/internal/derived/date/mod.rs +++ b/crates/brk_computer/src/internal/multi/derived_date/mod.rs @@ -3,6 +3,7 @@ mod distribution; mod first; mod full; mod last; +mod lazy; mod max; mod min; mod sum; @@ -13,6 +14,7 @@ pub use distribution::*; pub use first::*; pub use full::*; pub use last::*; +pub use lazy::*; pub use max::*; pub use min::*; pub use sum::*; diff --git a/crates/brk_computer/src/internal/derived/date/sum.rs b/crates/brk_computer/src/internal/multi/derived_date/sum.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/sum.rs rename to crates/brk_computer/src/internal/multi/derived_date/sum.rs diff --git a/crates/brk_computer/src/internal/derived/date/sum_cum.rs b/crates/brk_computer/src/internal/multi/derived_date/sum_cum.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/date/sum_cum.rs rename to crates/brk_computer/src/internal/multi/derived_date/sum_cum.rs diff --git a/crates/brk_computer/src/internal/lazy/derived_block/binary_last.rs b/crates/brk_computer/src/internal/multi/derived_height/binary_last.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/derived_block/binary_last.rs rename to crates/brk_computer/src/internal/multi/derived_height/binary_last.rs diff --git a/crates/brk_computer/src/internal/lazy/derived_block/binary_sum.rs b/crates/brk_computer/src/internal/multi/derived_height/binary_sum.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/derived_block/binary_sum.rs rename to crates/brk_computer/src/internal/multi/derived_height/binary_sum.rs diff --git a/crates/brk_computer/src/internal/lazy/derived_block/binary_sum_cum.rs b/crates/brk_computer/src/internal/multi/derived_height/binary_sum_cum.rs similarity index 96% rename from crates/brk_computer/src/internal/lazy/derived_block/binary_sum_cum.rs rename to crates/brk_computer/src/internal/multi/derived_height/binary_sum_cum.rs index 36b970ad4..ae009ffa0 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/binary_sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/derived_height/binary_sum_cum.rs @@ -7,13 +7,11 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableCloneableVec}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast, - ComputedDerivedBlockSumCum, LazyPeriodsFull, LazyPeriodsSumCum, LazyBinaryDateSumCum, LazyFull, - LazySumCum, NumericValue, SumCum, + ComputedBlockLast, ComputedBlockSumCum, ComputedDerivedBlockLast, ComputedDerivedBlockSumCum, + ComputedVecValue, LazyBinaryDateSumCum, LazyBinaryTransformSumCum, LazyFull, LazyPeriodsFull, + LazyPeriodsSumCum, LazySumCum, NumericValue, SumCum, }; -use super::super::transform::LazyBinaryTransformSumCum; - const VERSION: Version = Version::ZERO; #[derive(Clone, Deref, DerefMut, Traversable)] diff --git a/crates/brk_computer/src/internal/derived/block/distribution.rs b/crates/brk_computer/src/internal/multi/derived_height/distribution.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/block/distribution.rs rename to crates/brk_computer/src/internal/multi/derived_height/distribution.rs diff --git a/crates/brk_computer/src/internal/derived/block/first.rs b/crates/brk_computer/src/internal/multi/derived_height/first.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/block/first.rs rename to crates/brk_computer/src/internal/multi/derived_height/first.rs diff --git a/crates/brk_computer/src/internal/derived/block/full.rs b/crates/brk_computer/src/internal/multi/derived_height/full.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/block/full.rs rename to crates/brk_computer/src/internal/multi/derived_height/full.rs diff --git a/crates/brk_computer/src/internal/derived/block/last.rs b/crates/brk_computer/src/internal/multi/derived_height/last.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/block/last.rs rename to crates/brk_computer/src/internal/multi/derived_height/last.rs diff --git a/crates/brk_computer/src/internal/lazy/derived_block/full.rs b/crates/brk_computer/src/internal/multi/derived_height/lazy_full.rs similarity index 94% rename from crates/brk_computer/src/internal/lazy/derived_block/full.rs rename to crates/brk_computer/src/internal/multi/derived_height/lazy_full.rs index 6615066cf..966117867 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/full.rs +++ b/crates/brk_computer/src/internal/multi/derived_height/lazy_full.rs @@ -7,11 +7,10 @@ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; use crate::internal::{ - ComputedVecValue, ComputedDerivedBlockFull, LazyPeriodsFull, Full, LazyDateFull, NumericValue, + ComputedDerivedBlockFull, ComputedVecValue, Full, LazyDateFull, LazyPeriodsFull, + LazyTransformStats, NumericValue, }; -use super::super::transform::LazyTransformStats; - #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyDerivedBlockFull diff --git a/crates/brk_computer/src/internal/lazy/derived_block/last.rs b/crates/brk_computer/src/internal/multi/derived_height/lazy_last.rs similarity index 94% rename from crates/brk_computer/src/internal/lazy/derived_block/last.rs rename to crates/brk_computer/src/internal/multi/derived_height/lazy_last.rs index 1ddcf146e..e732dbf8e 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/last.rs +++ b/crates/brk_computer/src/internal/multi/derived_height/lazy_last.rs @@ -7,12 +7,10 @@ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; use crate::internal::{ - ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, ComputedDerivedBlockLast, - LazyDateLast, NumericValue, + ComputedBlockLast, ComputedDerivedBlockLast, ComputedHeightDateLast, ComputedVecValue, + LazyDateLast, LazyTransformLast, NumericValue, }; -use super::super::transform::LazyTransformLast; - #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyDerivedBlockLast diff --git a/crates/brk_computer/src/internal/lazy/derived_block/sum.rs b/crates/brk_computer/src/internal/multi/derived_height/lazy_sum.rs similarity index 92% rename from crates/brk_computer/src/internal/lazy/derived_block/sum.rs rename to crates/brk_computer/src/internal/multi/derived_height/lazy_sum.rs index ad1e1152f..93b6d60e4 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/sum.rs +++ b/crates/brk_computer/src/internal/multi/derived_height/lazy_sum.rs @@ -7,11 +7,10 @@ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; use crate::internal::{ - ComputedVecValue, ComputedDerivedBlockSum, LazyPeriodsSum, LazyDateSum, LazySum, NumericValue, SumVec, + ComputedDerivedBlockSum, ComputedVecValue, LazyDateSum, LazyPeriodsSum, LazySum, + LazyTransformSum, NumericValue, SumVec, }; -use super::super::transform::LazyTransformSum; - #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyDerivedBlockSum diff --git a/crates/brk_computer/src/internal/lazy/derived_block/sum_cum.rs b/crates/brk_computer/src/internal/multi/derived_height/lazy_sum_cum.rs similarity index 92% rename from crates/brk_computer/src/internal/lazy/derived_block/sum_cum.rs rename to crates/brk_computer/src/internal/multi/derived_height/lazy_sum_cum.rs index bb6d58289..2e2c080b9 100644 --- a/crates/brk_computer/src/internal/lazy/derived_block/sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/derived_height/lazy_sum_cum.rs @@ -7,12 +7,10 @@ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; use crate::internal::{ - ComputedVecValue, ComputedDerivedBlockSumCum, LazyPeriodsSumCum, LazyDateSumCum, LazySumCum, - NumericValue, SumCum, + ComputedDerivedBlockSumCum, ComputedVecValue, LazyDateSumCum, LazyPeriodsSumCum, LazySumCum, + LazyTransformSumCum, NumericValue, SumCum, }; -use super::super::transform::LazyTransformSumCum; - #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyDerivedBlockSumCum diff --git a/crates/brk_computer/src/internal/lazy/block/mod.rs b/crates/brk_computer/src/internal/multi/derived_height/mod.rs similarity index 60% rename from crates/brk_computer/src/internal/lazy/block/mod.rs rename to crates/brk_computer/src/internal/multi/derived_height/mod.rs index 1bb57e7ad..b0f432c1a 100644 --- a/crates/brk_computer/src/internal/lazy/block/mod.rs +++ b/crates/brk_computer/src/internal/multi/derived_height/mod.rs @@ -1,21 +1,27 @@ -mod binary_full; mod binary_last; mod binary_sum; mod binary_sum_cum; mod distribution; +mod first; mod full; mod last; -mod lazy_height_full; +mod lazy_full; +mod lazy_last; +mod lazy_sum; +mod lazy_sum_cum; mod sum; mod sum_cum; -pub use binary_full::*; pub use binary_last::*; pub use binary_sum::*; pub use binary_sum_cum::*; pub use distribution::*; +pub use first::*; pub use full::*; pub use last::*; -pub use lazy_height_full::*; +pub use lazy_full::*; +pub use lazy_last::*; +pub use lazy_sum::*; +pub use lazy_sum_cum::*; pub use sum::*; pub use sum_cum::*; diff --git a/crates/brk_computer/src/internal/derived/block/sum.rs b/crates/brk_computer/src/internal/multi/derived_height/sum.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/block/sum.rs rename to crates/brk_computer/src/internal/multi/derived_height/sum.rs diff --git a/crates/brk_computer/src/internal/derived/block/sum_cum.rs b/crates/brk_computer/src/internal/multi/derived_height/sum_cum.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/block/sum_cum.rs rename to crates/brk_computer/src/internal/multi/derived_height/sum_cum.rs diff --git a/crates/brk_computer/src/internal/derived/tx/distribution.rs b/crates/brk_computer/src/internal/multi/derived_tx/distribution.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/tx/distribution.rs rename to crates/brk_computer/src/internal/multi/derived_tx/distribution.rs diff --git a/crates/brk_computer/src/internal/derived/tx/full.rs b/crates/brk_computer/src/internal/multi/derived_tx/full.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/tx/full.rs rename to crates/brk_computer/src/internal/multi/derived_tx/full.rs diff --git a/crates/brk_computer/src/internal/lazy/derived_tx/distribution.rs b/crates/brk_computer/src/internal/multi/derived_tx/lazy_distribution.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/derived_tx/distribution.rs rename to crates/brk_computer/src/internal/multi/derived_tx/lazy_distribution.rs diff --git a/crates/brk_computer/src/internal/lazy/derived_tx/full.rs b/crates/brk_computer/src/internal/multi/derived_tx/lazy_full.rs similarity index 95% rename from crates/brk_computer/src/internal/lazy/derived_tx/full.rs rename to crates/brk_computer/src/internal/multi/derived_tx/lazy_full.rs index 9b5a44f7b..6d6d14dd9 100644 --- a/crates/brk_computer/src/internal/lazy/derived_tx/full.rs +++ b/crates/brk_computer/src/internal/multi/derived_tx/lazy_full.rs @@ -8,9 +8,7 @@ use brk_types::{ use schemars::JsonSchema; use vecdb::{IterableCloneableVec, UnaryTransform}; -use crate::internal::{ComputedVecValue, DerivedTxFull}; - -use super::super::transform::{LazyTransformFull, LazyTransformStats}; +use crate::internal::{ComputedVecValue, DerivedTxFull, LazyTransformFull, LazyTransformStats}; #[derive(Clone, Traversable)] #[traversable(merge)] diff --git a/crates/brk_computer/src/internal/multi/derived_tx/mod.rs b/crates/brk_computer/src/internal/multi/derived_tx/mod.rs new file mode 100644 index 000000000..51b46a003 --- /dev/null +++ b/crates/brk_computer/src/internal/multi/derived_tx/mod.rs @@ -0,0 +1,9 @@ +mod distribution; +mod full; +mod lazy_distribution; +mod lazy_full; + +pub use distribution::*; +pub use full::*; +pub use lazy_distribution::*; +pub use lazy_full::*; diff --git a/crates/brk_computer/src/internal/lazy/block/binary_full.rs b/crates/brk_computer/src/internal/multi/height/binary_full.rs similarity index 86% rename from crates/brk_computer/src/internal/lazy/block/binary_full.rs rename to crates/brk_computer/src/internal/multi/height/binary_full.rs index 9ed671e77..704cf4d21 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_full.rs +++ b/crates/brk_computer/src/internal/multi/height/binary_full.rs @@ -6,13 +6,13 @@ use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableBoxedVec, LazyVecFrom2}; -use crate::internal::{ComputedBlockFull, ComputedVecValue, DerivedTxFull, NumericValue}; - -use super::super::derived_block::LazyBinaryDerivedBlockSumCum; +use crate::internal::{ + ComputedBlockFull, ComputedVecValue, DerivedTxFull, LazyBinaryDerivedBlockSumCum, NumericValue, +}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct BinaryBlockFull +pub struct LazyBinaryBlockFull where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, @@ -27,7 +27,7 @@ where const VERSION: Version = Version::ZERO; -impl BinaryBlockFull +impl LazyBinaryBlockFull where T: ComputedVecValue + JsonSchema + 'static, S1T: NumericValue + JsonSchema, diff --git a/crates/brk_computer/src/internal/lazy/date/binary_height_date_last.rs b/crates/brk_computer/src/internal/multi/height/binary_height_date_last.rs similarity index 91% rename from crates/brk_computer/src/internal/lazy/date/binary_height_date_last.rs rename to crates/brk_computer/src/internal/multi/height/binary_height_date_last.rs index d726b78e1..fba0ab0d0 100644 --- a/crates/brk_computer/src/internal/lazy/date/binary_height_date_last.rs +++ b/crates/brk_computer/src/internal/multi/height/binary_height_date_last.rs @@ -1,4 +1,4 @@ -//! BinaryHeightDateLast - height storage + binary transform lazy date periods. +//! LazyBinaryHeightDateLast - height storage + binary transform lazy date periods. //! //! Use this when height is stored as EagerVec and date periods are lazy binary transforms. @@ -16,7 +16,7 @@ const VERSION: Version = Version::ZERO; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct BinaryHeightDateLast +pub struct LazyBinaryHeightDateLast where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, @@ -29,7 +29,7 @@ where pub rest: LazyBinaryDateLast, } -impl BinaryHeightDateLast +impl LazyBinaryHeightDateLast where T: ComputedVecValue + JsonSchema + 'static, S1T: ComputedVecValue + JsonSchema, diff --git a/crates/brk_computer/src/internal/lazy/block/binary_last.rs b/crates/brk_computer/src/internal/multi/height/binary_last.rs similarity index 98% rename from crates/brk_computer/src/internal/lazy/block/binary_last.rs rename to crates/brk_computer/src/internal/multi/height/binary_last.rs index 0c2b761b1..b75360666 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_last.rs +++ b/crates/brk_computer/src/internal/multi/height/binary_last.rs @@ -8,11 +8,10 @@ use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom use crate::internal::{ ComputedBlockLast, ComputedBlockSumCum, ComputedHeightDateLast, ComputedVecValue, - LazyPeriodsLast, LazyBinaryDateLast, LazyBinaryTransformLast, NumericValue, + LazyBinaryDateLast, LazyBinaryDerivedBlockLast, LazyBinaryTransformLast, LazyPeriodsLast, + NumericValue, }; -use super::super::derived_block::LazyBinaryDerivedBlockLast; - #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyBinaryBlockLast @@ -252,7 +251,7 @@ where /// Create from separate height, difficultyepoch, and date sources. /// - /// Use when sources are split across different types (e.g., ValueBlockDateLast + ComputedBlockLast). + /// Use when sources are split across different types (e.g., ValueHeightDateLast + ComputedBlockLast). #[allow(clippy::too_many_arguments)] pub fn from_height_difficultyepoch_dates>( name: &str, diff --git a/crates/brk_computer/src/internal/lazy/block/binary_sum.rs b/crates/brk_computer/src/internal/multi/height/binary_sum.rs similarity index 89% rename from crates/brk_computer/src/internal/lazy/block/binary_sum.rs rename to crates/brk_computer/src/internal/multi/height/binary_sum.rs index 55225404c..94f504ce7 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_sum.rs +++ b/crates/brk_computer/src/internal/multi/height/binary_sum.rs @@ -6,15 +6,16 @@ use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2}; -use crate::internal::{ComputedBlockSum, ComputedVecValue, ComputedDerivedBlockSum, NumericValue}; - -use super::super::derived_block::LazyBinaryDerivedBlockSum; +use crate::internal::{ + ComputedBlockSum, ComputedDerivedBlockSum, ComputedVecValue, LazyBinaryDerivedBlockSum, + NumericValue, +}; const VERSION: Version = Version::ZERO; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct BinaryBlockSum +pub struct LazyBinaryBlockSum where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, @@ -27,7 +28,7 @@ where pub rest: LazyBinaryDerivedBlockSum, } -impl BinaryBlockSum +impl LazyBinaryBlockSum where T: ComputedVecValue + JsonSchema + 'static, S1T: NumericValue + JsonSchema, diff --git a/crates/brk_computer/src/internal/lazy/block/binary_sum_cum.rs b/crates/brk_computer/src/internal/multi/height/binary_sum_cum.rs similarity index 95% rename from crates/brk_computer/src/internal/lazy/block/binary_sum_cum.rs rename to crates/brk_computer/src/internal/multi/height/binary_sum_cum.rs index b07f46cb1..61a686e9e 100644 --- a/crates/brk_computer/src/internal/lazy/block/binary_sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/height/binary_sum_cum.rs @@ -7,15 +7,13 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2}; use crate::internal::{ - ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast, - ComputedDerivedBlockSumCum, NumericValue, + ComputedBlockLast, ComputedBlockSumCum, ComputedDerivedBlockLast, ComputedDerivedBlockSumCum, + ComputedVecValue, LazyBinaryDerivedBlockSumCum, NumericValue, }; -use super::super::derived_block::LazyBinaryDerivedBlockSumCum; - #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct BinaryBlockSumCum +pub struct LazyBinaryBlockSumCum where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, @@ -32,7 +30,7 @@ where const VERSION: Version = Version::ZERO; -impl BinaryBlockSumCum +impl LazyBinaryBlockSumCum where T: ComputedVecValue + JsonSchema + 'static, S1T: ComputedVecValue + JsonSchema, diff --git a/crates/brk_computer/src/internal/computed/block/full.rs b/crates/brk_computer/src/internal/multi/height/full.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/block/full.rs rename to crates/brk_computer/src/internal/multi/height/full.rs diff --git a/crates/brk_computer/src/internal/computed/block/height_date_bytes.rs b/crates/brk_computer/src/internal/multi/height/height_date_bytes.rs similarity index 87% rename from crates/brk_computer/src/internal/computed/block/height_date_bytes.rs rename to crates/brk_computer/src/internal/multi/height/height_date_bytes.rs index 97283f85e..7caa6929d 100644 --- a/crates/brk_computer/src/internal/computed/block/height_date_bytes.rs +++ b/crates/brk_computer/src/internal/multi/height/height_date_bytes.rs @@ -1,4 +1,4 @@ -//! HeightDateBytes - height + dateindex BytesVec storage. +//! ComputedHeightDateBytes - height + dateindex BytesVec storage. //! //! Use this for simple cases where both height and dateindex are stored BytesVecs //! without any lazy derivations. For OHLC-type data. @@ -12,7 +12,7 @@ use vecdb::{BytesVec, BytesVecValue, Database, Formattable, ImportableVec}; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct HeightDateBytes +pub struct ComputedHeightDateBytes where T: BytesVecValue + Formattable + Serialize + JsonSchema, { @@ -22,7 +22,7 @@ where const VERSION: Version = Version::ZERO; -impl HeightDateBytes +impl ComputedHeightDateBytes where T: BytesVecValue + Formattable + Serialize + JsonSchema + 'static, { diff --git a/crates/brk_computer/src/internal/computed/block/height_date_first.rs b/crates/brk_computer/src/internal/multi/height/height_date_first.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/block/height_date_first.rs rename to crates/brk_computer/src/internal/multi/height/height_date_first.rs diff --git a/crates/brk_computer/src/internal/computed/block/height_date_last.rs b/crates/brk_computer/src/internal/multi/height/height_date_last.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/block/height_date_last.rs rename to crates/brk_computer/src/internal/multi/height/height_date_last.rs diff --git a/crates/brk_computer/src/internal/computed/block/height_date_max.rs b/crates/brk_computer/src/internal/multi/height/height_date_max.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/block/height_date_max.rs rename to crates/brk_computer/src/internal/multi/height/height_date_max.rs diff --git a/crates/brk_computer/src/internal/computed/block/height_date_min.rs b/crates/brk_computer/src/internal/multi/height/height_date_min.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/block/height_date_min.rs rename to crates/brk_computer/src/internal/multi/height/height_date_min.rs diff --git a/crates/brk_computer/src/internal/computed/block/last.rs b/crates/brk_computer/src/internal/multi/height/last.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/block/last.rs rename to crates/brk_computer/src/internal/multi/height/last.rs diff --git a/crates/brk_computer/src/internal/lazy/block/distribution.rs b/crates/brk_computer/src/internal/multi/height/lazy_distribution.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/block/distribution.rs rename to crates/brk_computer/src/internal/multi/height/lazy_distribution.rs diff --git a/crates/brk_computer/src/internal/lazy/block/full.rs b/crates/brk_computer/src/internal/multi/height/lazy_full.rs similarity index 93% rename from crates/brk_computer/src/internal/lazy/block/full.rs rename to crates/brk_computer/src/internal/multi/height/lazy_full.rs index 284fd9cc0..a21f0da6e 100644 --- a/crates/brk_computer/src/internal/lazy/block/full.rs +++ b/crates/brk_computer/src/internal/multi/height/lazy_full.rs @@ -7,10 +7,9 @@ use schemars::JsonSchema; use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform}; use crate::internal::{ - ComputedBlockFull, ComputedVecValue, ComputedDerivedBlockFull, NumericValue, + ComputedBlockFull, ComputedDerivedBlockFull, ComputedVecValue, LazyDerivedBlockFull, + NumericValue, }; - -use super::super::derived_block::LazyDerivedBlockFull; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyBlockFull diff --git a/crates/brk_computer/src/internal/lazy/block/lazy_height_full.rs b/crates/brk_computer/src/internal/multi/height/lazy_height_full.rs similarity index 93% rename from crates/brk_computer/src/internal/lazy/block/lazy_height_full.rs rename to crates/brk_computer/src/internal/multi/height/lazy_height_full.rs index 89897367b..9d70e8cce 100644 --- a/crates/brk_computer/src/internal/lazy/block/lazy_height_full.rs +++ b/crates/brk_computer/src/internal/multi/height/lazy_height_full.rs @@ -1,4 +1,4 @@ -//! BlockFullLazyHeight - block full with lazy height transform. +//! LazyBlockFullHeight - block full with lazy height transform. use brk_error::Result; use brk_traversable::Traversable; @@ -17,7 +17,7 @@ const VERSION: Version = Version::ZERO; /// Block full aggregation with lazy height transform + computed derived indexes. #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct BlockFullLazyHeight +pub struct LazyBlockFullHeight where T: ComputedVecValue + PartialOrd + JsonSchema, S: ComputedVecValue, @@ -29,7 +29,7 @@ where pub rest: ComputedDerivedBlockFull, } -impl BlockFullLazyHeight +impl LazyBlockFullHeight where T: NumericValue + JsonSchema, S: ComputedVecValue + JsonSchema, diff --git a/crates/brk_computer/src/internal/computed/block/lazy_height_sum_cum.rs b/crates/brk_computer/src/internal/multi/height/lazy_height_sum_cum.rs similarity index 92% rename from crates/brk_computer/src/internal/computed/block/lazy_height_sum_cum.rs rename to crates/brk_computer/src/internal/multi/height/lazy_height_sum_cum.rs index 65cf85208..50e99ed2b 100644 --- a/crates/brk_computer/src/internal/computed/block/lazy_height_sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/height/lazy_height_sum_cum.rs @@ -1,4 +1,4 @@ -//! BlockSumCumLazyHeight - block sum+cumulative with lazy height transform. +//! LazyBlockSumCumHeight - block sum+cumulative with lazy height transform. //! //! Use this when you need: //! - Lazy height (binary transform from two sources) @@ -23,7 +23,7 @@ use crate::internal::{ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue /// Coarser periods are lazy lookups. #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct BlockSumCumLazyHeight +pub struct LazyBlockSumCumHeight where T: ComputedVecValue + PartialOrd + JsonSchema, S1T: ComputedVecValue, @@ -38,7 +38,7 @@ where const VERSION: Version = Version::ZERO; -impl BlockSumCumLazyHeight +impl LazyBlockSumCumHeight where T: NumericValue + JsonSchema, S1T: ComputedVecValue + JsonSchema, diff --git a/crates/brk_computer/src/internal/lazy/block/last.rs b/crates/brk_computer/src/internal/multi/height/lazy_last.rs similarity index 93% rename from crates/brk_computer/src/internal/lazy/block/last.rs rename to crates/brk_computer/src/internal/multi/height/lazy_last.rs index 2580197fe..9edcc31c4 100644 --- a/crates/brk_computer/src/internal/lazy/block/last.rs +++ b/crates/brk_computer/src/internal/multi/height/lazy_last.rs @@ -7,11 +7,9 @@ use schemars::JsonSchema; use vecdb::{IterableBoxedVec, IterableCloneableVec, LazyVecFrom1, UnaryTransform}; use crate::internal::{ - ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, ComputedDerivedBlockLast, - NumericValue, + ComputedBlockLast, ComputedDerivedBlockLast, ComputedHeightDateLast, ComputedVecValue, + LazyDerivedBlockLast, NumericValue, }; - -use super::super::derived_block::LazyDerivedBlockLast; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyBlockLast diff --git a/crates/brk_computer/src/internal/lazy/block/sum.rs b/crates/brk_computer/src/internal/multi/height/lazy_sum.rs similarity index 92% rename from crates/brk_computer/src/internal/lazy/block/sum.rs rename to crates/brk_computer/src/internal/multi/height/lazy_sum.rs index 2262fb6dd..77b5e141c 100644 --- a/crates/brk_computer/src/internal/lazy/block/sum.rs +++ b/crates/brk_computer/src/internal/multi/height/lazy_sum.rs @@ -6,9 +6,9 @@ use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform}; -use crate::internal::{ComputedBlockSum, ComputedVecValue, ComputedDerivedBlockSum, NumericValue}; - -use super::super::derived_block::LazyDerivedBlockSum; +use crate::internal::{ + ComputedBlockSum, ComputedDerivedBlockSum, ComputedVecValue, LazyDerivedBlockSum, NumericValue, +}; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyBlockSum diff --git a/crates/brk_computer/src/internal/lazy/block/sum_cum.rs b/crates/brk_computer/src/internal/multi/height/lazy_sum_cum.rs similarity index 92% rename from crates/brk_computer/src/internal/lazy/block/sum_cum.rs rename to crates/brk_computer/src/internal/multi/height/lazy_sum_cum.rs index 811ea5e4a..fed0e5d13 100644 --- a/crates/brk_computer/src/internal/lazy/block/sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/height/lazy_sum_cum.rs @@ -7,10 +7,9 @@ use schemars::JsonSchema; use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform}; use crate::internal::{ - ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue, + ComputedBlockSumCum, ComputedDerivedBlockSumCum, ComputedVecValue, LazyDerivedBlockSumCum, + NumericValue, }; - -use super::super::derived_block::LazyDerivedBlockSumCum; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] pub struct LazyBlockSumCum diff --git a/crates/brk_computer/src/internal/multi/height/mod.rs b/crates/brk_computer/src/internal/multi/height/mod.rs new file mode 100644 index 000000000..3718c0d37 --- /dev/null +++ b/crates/brk_computer/src/internal/multi/height/mod.rs @@ -0,0 +1,43 @@ +mod binary_full; +mod binary_height_date_last; +mod binary_last; +mod binary_sum; +mod binary_sum_cum; +mod full; +mod height_date_bytes; +mod height_date_first; +mod height_date_last; +mod height_date_max; +mod height_date_min; +mod last; +mod lazy_distribution; +mod lazy_full; +mod lazy_height_full; +mod lazy_height_sum_cum; +mod lazy_last; +mod lazy_sum; +mod lazy_sum_cum; +mod sum; +mod sum_cum; + +pub use binary_full::*; +pub use binary_height_date_last::*; +pub use binary_last::*; +pub use binary_sum::*; +pub use binary_sum_cum::*; +pub use full::*; +pub use height_date_bytes::*; +pub use height_date_first::*; +pub use height_date_last::*; +pub use height_date_max::*; +pub use height_date_min::*; +pub use last::*; +pub use lazy_distribution::*; +pub use lazy_full::*; +pub use lazy_height_full::*; +pub use lazy_height_sum_cum::*; +pub use lazy_last::*; +pub use lazy_sum::*; +pub use lazy_sum_cum::*; +pub use sum::*; +pub use sum_cum::*; diff --git a/crates/brk_computer/src/internal/computed/block/sum.rs b/crates/brk_computer/src/internal/multi/height/sum.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/block/sum.rs rename to crates/brk_computer/src/internal/multi/height/sum.rs diff --git a/crates/brk_computer/src/internal/computed/block/sum_cum.rs b/crates/brk_computer/src/internal/multi/height/sum_cum.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/block/sum_cum.rs rename to crates/brk_computer/src/internal/multi/height/sum_cum.rs diff --git a/crates/brk_computer/src/internal/multi/mod.rs b/crates/brk_computer/src/internal/multi/mod.rs new file mode 100644 index 000000000..c21562de8 --- /dev/null +++ b/crates/brk_computer/src/internal/multi/mod.rs @@ -0,0 +1,17 @@ +//! Multi-index composite types. + +mod date; +mod derived_date; +mod derived_height; +mod derived_tx; +mod height; +mod specialized; +mod value; + +pub use date::*; +pub use derived_date::*; +pub use derived_height::*; +pub use derived_tx::*; +pub use height::*; +pub use specialized::*; +pub use value::*; diff --git a/crates/brk_computer/src/internal/specialized/constant.rs b/crates/brk_computer/src/internal/multi/specialized/constant.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/constant.rs rename to crates/brk_computer/src/internal/multi/specialized/constant.rs diff --git a/crates/brk_computer/src/internal/specialized/mod.rs b/crates/brk_computer/src/internal/multi/specialized/mod.rs similarity index 70% rename from crates/brk_computer/src/internal/specialized/mod.rs rename to crates/brk_computer/src/internal/multi/specialized/mod.rs index 9b807be0e..211f63fdf 100644 --- a/crates/brk_computer/src/internal/specialized/mod.rs +++ b/crates/brk_computer/src/internal/multi/specialized/mod.rs @@ -1,15 +1,11 @@ mod constant; -mod lazy_period; mod ohlc; mod percentiles; mod ratio; mod stddev; -mod value; pub use constant::*; -pub use lazy_period::*; pub use ohlc::*; pub use percentiles::*; pub use ratio::*; pub use stddev::*; -pub use value::*; diff --git a/crates/brk_computer/src/internal/specialized/ohlc/computed.rs b/crates/brk_computer/src/internal/multi/specialized/ohlc/computed.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/ohlc/computed.rs rename to crates/brk_computer/src/internal/multi/specialized/ohlc/computed.rs diff --git a/crates/brk_computer/src/internal/specialized/ohlc/lazy.rs b/crates/brk_computer/src/internal/multi/specialized/ohlc/lazy.rs similarity index 96% rename from crates/brk_computer/src/internal/specialized/ohlc/lazy.rs rename to crates/brk_computer/src/internal/multi/specialized/ohlc/lazy.rs index 4a56a9aad..f4b9d2a37 100644 --- a/crates/brk_computer/src/internal/specialized/ohlc/lazy.rs +++ b/crates/brk_computer/src/internal/multi/specialized/ohlc/lazy.rs @@ -22,7 +22,7 @@ where /// Lazy OHLC component extractors for height + dateindex. #[derive(Clone, Traversable)] -pub struct HeightDateLazyOHLC +pub struct LazyHeightDateOHLC where T: BytesVecValue + Formattable + Serialize + JsonSchema + 'static, SourceT: BytesVecValue + Formattable + Serialize + JsonSchema + 'static, diff --git a/crates/brk_computer/src/internal/specialized/ohlc/mod.rs b/crates/brk_computer/src/internal/multi/specialized/ohlc/mod.rs similarity index 64% rename from crates/brk_computer/src/internal/specialized/ohlc/mod.rs rename to crates/brk_computer/src/internal/multi/specialized/ohlc/mod.rs index ffc51ad6a..604d49d61 100644 --- a/crates/brk_computer/src/internal/specialized/ohlc/mod.rs +++ b/crates/brk_computer/src/internal/multi/specialized/ohlc/mod.rs @@ -1,5 +1,3 @@ -//! OHLC - Open/High/Low/Close specialized types. - mod computed; mod lazy; mod period; diff --git a/crates/brk_computer/src/internal/specialized/ohlc/period.rs b/crates/brk_computer/src/internal/multi/specialized/ohlc/period.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/ohlc/period.rs rename to crates/brk_computer/src/internal/multi/specialized/ohlc/period.rs diff --git a/crates/brk_computer/src/internal/specialized/percentiles.rs b/crates/brk_computer/src/internal/multi/specialized/percentiles.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/percentiles.rs rename to crates/brk_computer/src/internal/multi/specialized/percentiles.rs diff --git a/crates/brk_computer/src/internal/specialized/ratio.rs b/crates/brk_computer/src/internal/multi/specialized/ratio.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/ratio.rs rename to crates/brk_computer/src/internal/multi/specialized/ratio.rs diff --git a/crates/brk_computer/src/internal/specialized/stddev.rs b/crates/brk_computer/src/internal/multi/specialized/stddev.rs similarity index 99% rename from crates/brk_computer/src/internal/specialized/stddev.rs rename to crates/brk_computer/src/internal/multi/specialized/stddev.rs index 3fd0d0864..f029e348c 100644 --- a/crates/brk_computer/src/internal/specialized/stddev.rs +++ b/crates/brk_computer/src/internal/multi/specialized/stddev.rs @@ -10,7 +10,7 @@ use vecdb::{ use crate::{ComputeIndexes, indexes, price}; -use super::super::{ClosePriceTimesRatio, ComputedDateLast, LazyBinaryDateLast}; +use crate::internal::{ClosePriceTimesRatio, ComputedDateLast, LazyBinaryDateLast}; #[derive(Clone, Traversable)] pub struct ComputedStandardDeviationVecsDate { diff --git a/crates/brk_computer/src/internal/specialized/value/date/derived_last.rs b/crates/brk_computer/src/internal/multi/value/date/derived_last.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/date/derived_last.rs rename to crates/brk_computer/src/internal/multi/value/date/derived_last.rs diff --git a/crates/brk_computer/src/internal/specialized/value/date/block_date_last.rs b/crates/brk_computer/src/internal/multi/value/date/height_date_last.rs similarity index 94% rename from crates/brk_computer/src/internal/specialized/value/date/block_date_last.rs rename to crates/brk_computer/src/internal/multi/value/date/height_date_last.rs index 2afb415bc..43e7bc70a 100644 --- a/crates/brk_computer/src/internal/specialized/value/date/block_date_last.rs +++ b/crates/brk_computer/src/internal/multi/value/date/height_date_last.rs @@ -11,14 +11,14 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe use crate::{ComputeIndexes, indexes, price}; -use super::super::block::{LazyDerivedBlockValue, LazyValueDifficultyEpochFromHeight}; +use crate::internal::{LazyDerivedBlockValue, LazyValueDifficultyEpochFromHeight}; use super::ValueDateLast; /// Value type where both height and dateindex are stored independently. /// Dateindex values cannot be derived from height (e.g., unrealized P&L). #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct ValueBlockDateLast { +pub struct ValueHeightDateLast { #[traversable(rename = "sats")] pub height: EagerVec>, #[traversable(flatten)] @@ -33,7 +33,7 @@ pub struct ValueBlockDateLast { const VERSION: Version = Version::ZERO; -impl ValueBlockDateLast { +impl ValueHeightDateLast { pub fn forced_import( db: &Database, name: &str, diff --git a/crates/brk_computer/src/internal/specialized/value/date/last.rs b/crates/brk_computer/src/internal/multi/value/date/last.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/date/last.rs rename to crates/brk_computer/src/internal/multi/value/date/last.rs diff --git a/crates/brk_computer/src/internal/specialized/value/date/lazy_last.rs b/crates/brk_computer/src/internal/multi/value/date/lazy_last.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/date/lazy_last.rs rename to crates/brk_computer/src/internal/multi/value/date/lazy_last.rs diff --git a/crates/brk_computer/src/internal/specialized/value/date/mod.rs b/crates/brk_computer/src/internal/multi/value/date/mod.rs similarity index 67% rename from crates/brk_computer/src/internal/specialized/value/date/mod.rs rename to crates/brk_computer/src/internal/multi/value/date/mod.rs index cdc966757..45774b152 100644 --- a/crates/brk_computer/src/internal/specialized/value/date/mod.rs +++ b/crates/brk_computer/src/internal/multi/value/date/mod.rs @@ -1,9 +1,9 @@ -mod block_date_last; mod derived_last; +mod height_date_last; mod last; mod lazy_last; -pub use block_date_last::*; +pub use height_date_last::*; pub use derived_last::*; pub use last::*; pub use lazy_last::*; diff --git a/crates/brk_computer/src/internal/specialized/value/derived_block/mod.rs b/crates/brk_computer/src/internal/multi/value/derived_height/mod.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/derived_block/mod.rs rename to crates/brk_computer/src/internal/multi/value/derived_height/mod.rs diff --git a/crates/brk_computer/src/internal/specialized/value/derived_block/sum_cum.rs b/crates/brk_computer/src/internal/multi/value/derived_height/sum_cum.rs similarity index 91% rename from crates/brk_computer/src/internal/specialized/value/derived_block/sum_cum.rs rename to crates/brk_computer/src/internal/multi/value/derived_height/sum_cum.rs index e8030db10..1d2a23126 100644 --- a/crates/brk_computer/src/internal/specialized/value/derived_block/sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/value/derived_height/sum_cum.rs @@ -8,7 +8,7 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec, use crate::{ ComputeIndexes, indexes, internal::{ - ClosePriceTimesSats, ComputedDerivedBlockSumCum, LazyBlockSumCum, BlockSumCumLazyHeight, + ClosePriceTimesSats, ComputedDerivedBlockSumCum, LazyBlockSumCum, LazyBlockSumCumHeight, SatsToBitcoin, }, price, @@ -16,15 +16,15 @@ use crate::{ /// Value wrapper for derived SumCum (derives from external height source). #[derive(Clone, Traversable)] -pub struct DerivedValueBlockSumCum { +pub struct ValueDerivedBlockSumCum { pub sats: ComputedDerivedBlockSumCum, pub bitcoin: LazyBlockSumCum, - pub dollars: Option, Sats>>, + pub dollars: Option, Sats>>, } const VERSION: Version = Version::ZERO; -impl DerivedValueBlockSumCum { +impl ValueDerivedBlockSumCum { pub fn forced_import( db: &Database, name: &str, @@ -58,7 +58,7 @@ impl DerivedValueBlockSumCum { sats_source.boxed_clone(), ); - Some(BlockSumCumLazyHeight::forced_import( + Some(LazyBlockSumCumHeight::forced_import( db, &format!("{name}_usd"), v, diff --git a/crates/brk_computer/src/internal/specialized/value/block/binary.rs b/crates/brk_computer/src/internal/multi/value/height/binary.rs similarity index 82% rename from crates/brk_computer/src/internal/specialized/value/block/binary.rs rename to crates/brk_computer/src/internal/multi/value/height/binary.rs index 4cb051674..4cce4d0bc 100644 --- a/crates/brk_computer/src/internal/specialized/value/block/binary.rs +++ b/crates/brk_computer/src/internal/multi/value/height/binary.rs @@ -4,7 +4,7 @@ use schemars::JsonSchema; use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec}; use crate::internal::{ - BinaryBlockSumCum, ComputedVecValue, DerivedValueBlockSumCum, LazyValueBlockSumCum, + ComputedVecValue, ValueDerivedBlockSumCum, LazyBinaryBlockSumCum, LazyValueBlockSumCum, ValueBlockSumCum, }; @@ -12,9 +12,9 @@ use crate::internal::{ /// Used for computing coinbase = subsidy + fee. #[derive(Clone, Traversable)] pub struct ValueBinaryBlock { - pub sats: BinaryBlockSumCum, - pub bitcoin: BinaryBlockSumCum, - pub dollars: Option>, + pub sats: LazyBinaryBlockSumCum, + pub bitcoin: LazyBinaryBlockSumCum, + pub dollars: Option>, } impl ValueBinaryBlock { @@ -31,7 +31,7 @@ impl ValueBinaryBlock { BitcoinF: BinaryTransform, DollarsF: BinaryTransform, { - let sats = BinaryBlockSumCum::from_computed::( + let sats = LazyBinaryBlockSumCum::from_computed::( name, version, height_source1.boxed_clone(), @@ -40,7 +40,7 @@ impl ValueBinaryBlock { &source2.sats, ); - let bitcoin = BinaryBlockSumCum::from_computed::( + let bitcoin = LazyBinaryBlockSumCum::from_computed::( &format!("{name}_btc"), version, height_source1, @@ -54,7 +54,7 @@ impl ValueBinaryBlock { .as_ref() .zip(source2.dollars.as_ref()) .map(|(d1, d2)| { - BinaryBlockSumCum::from_computed::( + LazyBinaryBlockSumCum::from_computed::( &format!("{name}_usd"), version, d1.height.boxed_clone(), @@ -76,15 +76,15 @@ impl ValueBinaryBlock { version: Version, height_source1: IterableBoxedVec, height_source2: IterableBoxedVec, - source1: &DerivedValueBlockSumCum, - source2: &DerivedValueBlockSumCum, + source1: &ValueDerivedBlockSumCum, + source2: &ValueDerivedBlockSumCum, ) -> Self where SatsF: BinaryTransform, BitcoinF: BinaryTransform, DollarsF: BinaryTransform, { - let sats = BinaryBlockSumCum::from_derived::( + let sats = LazyBinaryBlockSumCum::from_derived::( name, version, height_source1.boxed_clone(), @@ -93,7 +93,7 @@ impl ValueBinaryBlock { &source2.sats, ); - let bitcoin = BinaryBlockSumCum::from_derived::( + let bitcoin = LazyBinaryBlockSumCum::from_derived::( &format!("{name}_btc"), version, height_source1, @@ -107,7 +107,7 @@ impl ValueBinaryBlock { .as_ref() .zip(source2.dollars.as_ref()) .map(|(d1, d2)| { - BinaryBlockSumCum::from_derived::( + LazyBinaryBlockSumCum::from_derived::( &format!("{name}_usd"), version, d1.height_cumulative.0.boxed_clone(), @@ -137,7 +137,7 @@ impl ValueBinaryBlock { S1T: ComputedVecValue + JsonSchema, S2T: ComputedVecValue + JsonSchema, { - let sats = BinaryBlockSumCum::from_derived::( + let sats = LazyBinaryBlockSumCum::from_derived::( name, version, source1.sats.height.boxed_clone(), @@ -146,7 +146,7 @@ impl ValueBinaryBlock { &source2.sats.rest, ); - let bitcoin = BinaryBlockSumCum::from_derived::( + let bitcoin = LazyBinaryBlockSumCum::from_derived::( &format!("{name}_btc"), version, source1.sats.height.boxed_clone(), @@ -160,7 +160,7 @@ impl ValueBinaryBlock { .as_ref() .zip(source2.dollars.as_ref()) .map(|(d1, d2)| { - BinaryBlockSumCum::from_derived::( + LazyBinaryBlockSumCum::from_derived::( &format!("{name}_usd"), version, d1.height.boxed_clone(), diff --git a/crates/brk_computer/src/internal/specialized/value/block/full.rs b/crates/brk_computer/src/internal/multi/value/height/full.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/block/full.rs rename to crates/brk_computer/src/internal/multi/value/height/full.rs diff --git a/crates/brk_computer/src/internal/specialized/value/block/last.rs b/crates/brk_computer/src/internal/multi/value/height/last.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/block/last.rs rename to crates/brk_computer/src/internal/multi/value/height/last.rs diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_binary_last.rs b/crates/brk_computer/src/internal/multi/value/height/lazy_binary_last.rs similarity index 97% rename from crates/brk_computer/src/internal/specialized/value/block/lazy_binary_last.rs rename to crates/brk_computer/src/internal/multi/value/height/lazy_binary_last.rs index c8d7ea603..ab978da71 100644 --- a/crates/brk_computer/src/internal/specialized/value/block/lazy_binary_last.rs +++ b/crates/brk_computer/src/internal/multi/value/height/lazy_binary_last.rs @@ -19,7 +19,7 @@ const VERSION: Version = Version::ZERO; /// No merge at this level - denominations (sats, bitcoin, dollars) stay as separate branches. /// Each inner field has merge which combines indexes within each denomination. #[derive(Clone, Deref, DerefMut, Traversable)] -pub struct LazyBinaryLastBlockValue { +pub struct LazyBinaryValueBlockLast { #[traversable(flatten)] pub height: LazyBlockValue, #[traversable(flatten)] @@ -30,7 +30,7 @@ pub struct LazyBinaryLastBlockValue { pub dates: LazyValueDateLast, } -impl LazyBinaryLastBlockValue { +impl LazyBinaryValueBlockLast { pub fn from_block_source( name: &str, source: &ValueBlockLast, diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy.rs b/crates/brk_computer/src/internal/multi/value/height/lazy_block_value.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/block/lazy.rs rename to crates/brk_computer/src/internal/multi/value/height/lazy_block_value.rs diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_computed_sum_cum.rs b/crates/brk_computer/src/internal/multi/value/height/lazy_computed_sum_cum.rs similarity index 94% rename from crates/brk_computer/src/internal/specialized/value/block/lazy_computed_sum_cum.rs rename to crates/brk_computer/src/internal/multi/value/height/lazy_computed_sum_cum.rs index cde6a0a62..a26bbeadf 100644 --- a/crates/brk_computer/src/internal/specialized/value/block/lazy_computed_sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/value/height/lazy_computed_sum_cum.rs @@ -14,7 +14,7 @@ use vecdb::{Database, Exit, IterableCloneableVec, LazyVecFrom2}; use crate::{ ComputeIndexes, indexes, internal::{ - ClosePriceTimesSats, ComputedBlockSumCum, LazyBlockSumCum, BlockSumCumLazyHeight, + ClosePriceTimesSats, ComputedBlockSumCum, LazyBlockSumCum, LazyBlockSumCumHeight, SatsToBitcoin, }, price, @@ -29,7 +29,7 @@ use crate::{ pub struct LazyComputedValueBlockSumCum { pub sats: ComputedBlockSumCum, pub bitcoin: LazyBlockSumCum, - pub dollars: Option, Sats>>, + pub dollars: Option, Sats>>, } const VERSION: Version = Version::ZERO; @@ -61,7 +61,7 @@ impl LazyComputedValueBlockSumCum { sats.height.boxed_clone(), ); - Some(BlockSumCumLazyHeight::forced_import( + Some(LazyBlockSumCumHeight::forced_import( db, &format!("{name}_usd"), v, diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_derived.rs b/crates/brk_computer/src/internal/multi/value/height/lazy_derived.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/block/lazy_derived.rs rename to crates/brk_computer/src/internal/multi/value/height/lazy_derived.rs diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_difficultyepoch.rs b/crates/brk_computer/src/internal/multi/value/height/lazy_difficultyepoch.rs similarity index 99% rename from crates/brk_computer/src/internal/specialized/value/block/lazy_difficultyepoch.rs rename to crates/brk_computer/src/internal/multi/value/height/lazy_difficultyepoch.rs index 503a6c512..c1a27b45f 100644 --- a/crates/brk_computer/src/internal/specialized/value/block/lazy_difficultyepoch.rs +++ b/crates/brk_computer/src/internal/multi/value/height/lazy_difficultyepoch.rs @@ -15,7 +15,7 @@ const VERSION: Version = Version::ZERO; /// Lazy value type at difficultyepoch level - computed from height sats + price. /// -/// Use this when the source only has height-indexed sats (e.g., ValueBlockDateLast). +/// Use this when the source only has height-indexed sats (e.g., ValueHeightDateLast). /// Dollars are computed via price × sats binary transform. #[derive(Clone, Traversable)] pub struct LazyValueDifficultyEpochFromHeight { diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_height.rs b/crates/brk_computer/src/internal/multi/value/height/lazy_height.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/block/lazy_height.rs rename to crates/brk_computer/src/internal/multi/value/height/lazy_height.rs diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_last.rs b/crates/brk_computer/src/internal/multi/value/height/lazy_last.rs similarity index 95% rename from crates/brk_computer/src/internal/specialized/value/block/lazy_last.rs rename to crates/brk_computer/src/internal/multi/value/height/lazy_last.rs index 0ebd6e097..be56e017c 100644 --- a/crates/brk_computer/src/internal/specialized/value/block/lazy_last.rs +++ b/crates/brk_computer/src/internal/multi/value/height/lazy_last.rs @@ -13,7 +13,7 @@ const VERSION: Version = Version::ZERO; /// Lazy value wrapper with height + date last transforms from ValueBlockLast. #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct LazyLastBlockValue { +pub struct LazyValueBlockLast { #[traversable(flatten)] pub height: LazyValueBlockHeight, #[deref] @@ -22,7 +22,7 @@ pub struct LazyLastBlockValue { pub dates: LazyValueDateLast, } -impl LazyLastBlockValue { +impl LazyValueBlockLast { pub fn from_block_source( name: &str, source: &ValueBlockLast, diff --git a/crates/brk_computer/src/internal/specialized/value/block/lazy_sum_cum.rs b/crates/brk_computer/src/internal/multi/value/height/lazy_sum_cum.rs similarity index 91% rename from crates/brk_computer/src/internal/specialized/value/block/lazy_sum_cum.rs rename to crates/brk_computer/src/internal/multi/value/height/lazy_sum_cum.rs index a1df5aa70..02ef1142f 100644 --- a/crates/brk_computer/src/internal/specialized/value/block/lazy_sum_cum.rs +++ b/crates/brk_computer/src/internal/multi/value/height/lazy_sum_cum.rs @@ -13,7 +13,7 @@ use vecdb::{ use crate::{ ComputeIndexes, indexes, internal::{ - ClosePriceTimesSats, ComputedVecValue, LazyBlockSumCum, BlockSumCumLazyHeight, + ClosePriceTimesSats, ComputedVecValue, LazyBlockSumCum, LazyBlockSumCumHeight, SatsToBitcoin, }, price, @@ -30,9 +30,9 @@ where S1T: ComputedVecValue + JsonSchema, S2T: ComputedVecValue + JsonSchema, { - pub sats: BlockSumCumLazyHeight, + pub sats: LazyBlockSumCumHeight, pub bitcoin: LazyBlockSumCum, - pub dollars: Option, Sats>>, + pub dollars: Option, Sats>>, } const VERSION: Version = Version::ZERO; @@ -57,7 +57,7 @@ where let v = version + VERSION; let sats_height = LazyVecFrom2::transformed::(name, v, source1, source2); - let sats = BlockSumCumLazyHeight::forced_import(db, name, v, indexes, sats_height)?; + let sats = LazyBlockSumCumHeight::forced_import(db, name, v, indexes, sats_height)?; let bitcoin = LazyBlockSumCum::from_derived::( &format!("{name}_btc"), @@ -74,7 +74,7 @@ where sats.height.boxed_clone(), ); - Some(BlockSumCumLazyHeight::forced_import( + Some(LazyBlockSumCumHeight::forced_import( db, &format!("{name}_usd"), v, diff --git a/crates/brk_computer/src/internal/specialized/value/block/mod.rs b/crates/brk_computer/src/internal/multi/value/height/mod.rs similarity index 89% rename from crates/brk_computer/src/internal/specialized/value/block/mod.rs rename to crates/brk_computer/src/internal/multi/value/height/mod.rs index 6049dd258..356e52aa1 100644 --- a/crates/brk_computer/src/internal/specialized/value/block/mod.rs +++ b/crates/brk_computer/src/internal/multi/value/height/mod.rs @@ -1,8 +1,7 @@ mod binary; mod full; -mod height; mod last; -mod lazy; +mod lazy_block_value; mod lazy_binary_last; mod lazy_computed_sum_cum; mod lazy_derived; @@ -15,9 +14,8 @@ mod sum_cum; pub use binary::*; pub use full::*; -pub use height::*; pub use last::*; -pub use lazy::*; +pub use lazy_block_value::*; pub use lazy_binary_last::*; pub use lazy_computed_sum_cum::*; pub use lazy_derived::*; diff --git a/crates/brk_computer/src/internal/specialized/value/block/sum.rs b/crates/brk_computer/src/internal/multi/value/height/sum.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/block/sum.rs rename to crates/brk_computer/src/internal/multi/value/height/sum.rs diff --git a/crates/brk_computer/src/internal/specialized/value/block/sum_cum.rs b/crates/brk_computer/src/internal/multi/value/height/sum_cum.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/block/sum_cum.rs rename to crates/brk_computer/src/internal/multi/value/height/sum_cum.rs diff --git a/crates/brk_computer/src/internal/multi/value/mod.rs b/crates/brk_computer/src/internal/multi/value/mod.rs new file mode 100644 index 000000000..24adb7641 --- /dev/null +++ b/crates/brk_computer/src/internal/multi/value/mod.rs @@ -0,0 +1,9 @@ +mod date; +mod derived_height; +mod height; +mod tx; + +pub use date::*; +pub use derived_height::*; +pub use height::*; +pub use tx::*; diff --git a/crates/brk_computer/src/internal/specialized/value/tx/derived_full.rs b/crates/brk_computer/src/internal/multi/value/tx/derived_full.rs similarity index 91% rename from crates/brk_computer/src/internal/specialized/value/tx/derived_full.rs rename to crates/brk_computer/src/internal/multi/value/tx/derived_full.rs index 907ac66ca..28c63249f 100644 --- a/crates/brk_computer/src/internal/specialized/value/tx/derived_full.rs +++ b/crates/brk_computer/src/internal/multi/value/tx/derived_full.rs @@ -8,7 +8,7 @@ use vecdb::{CollectableVec, Database, Exit, IterableCloneableVec}; use crate::{ ComputeIndexes, indexes, - internal::{DerivedTxFull, DollarsTxFull, LazyDerivedTxFull, SatsToBitcoin}, + internal::{DerivedTxFull, ValueDollarsTxFull, LazyDerivedTxFull, SatsToBitcoin}, price, }; @@ -16,7 +16,7 @@ use crate::{ pub struct ValueDerivedTxFull { pub sats: DerivedTxFull, pub bitcoin: LazyDerivedTxFull, - pub dollars: Option, + pub dollars: Option, } const VERSION: Version = Version::ZERO; @@ -40,7 +40,7 @@ impl ValueDerivedTxFull { let dollars = price .map(|price| { - DollarsTxFull::forced_import( + ValueDollarsTxFull::forced_import( db, &format!("{name}_usd"), v, diff --git a/crates/brk_computer/src/internal/specialized/value/tx/dollars.rs b/crates/brk_computer/src/internal/multi/value/tx/dollars.rs similarity index 98% rename from crates/brk_computer/src/internal/specialized/value/tx/dollars.rs rename to crates/brk_computer/src/internal/multi/value/tx/dollars.rs index 8465295b1..cf7fc514d 100644 --- a/crates/brk_computer/src/internal/specialized/value/tx/dollars.rs +++ b/crates/brk_computer/src/internal/multi/value/tx/dollars.rs @@ -21,7 +21,7 @@ pub type LazyDollarsTxIndex = /// Dollars with lazy txindex field and eager height/dateindex aggregates. #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(merge)] -pub struct DollarsTxFull { +pub struct ValueDollarsTxFull { #[traversable(skip)] pub txindex: LazyDollarsTxIndex, pub height: Full, @@ -34,7 +34,7 @@ pub struct DollarsTxFull { const VERSION: Version = Version::ZERO; -impl DollarsTxFull { +impl ValueDollarsTxFull { pub fn forced_import( db: &Database, name: &str, diff --git a/crates/brk_computer/src/internal/specialized/value/tx/full.rs b/crates/brk_computer/src/internal/multi/value/tx/full.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/tx/full.rs rename to crates/brk_computer/src/internal/multi/value/tx/full.rs diff --git a/crates/brk_computer/src/internal/specialized/value/tx/mod.rs b/crates/brk_computer/src/internal/multi/value/tx/mod.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/tx/mod.rs rename to crates/brk_computer/src/internal/multi/value/tx/mod.rs diff --git a/crates/brk_computer/src/internal/group/distribution.rs b/crates/brk_computer/src/internal/single/group/distribution.rs similarity index 97% rename from crates/brk_computer/src/internal/group/distribution.rs rename to crates/brk_computer/src/internal/single/group/distribution.rs index f32eb3faf..bace3b4a3 100644 --- a/crates/brk_computer/src/internal/group/distribution.rs +++ b/crates/brk_computer/src/internal/single/group/distribution.rs @@ -3,8 +3,7 @@ use brk_traversable::Traversable; use schemars::JsonSchema; use vecdb::{AnyVec, Database, Exit, IterableVec, VecIndex, VecValue, Version}; -use crate::internal::ComputedVecValue; -use crate::internal::vec::AverageVec; +use crate::internal::{AverageVec, ComputedVecValue}; use super::{MinMax, Percentiles}; diff --git a/crates/brk_computer/src/internal/group/full.rs b/crates/brk_computer/src/internal/single/group/full.rs similarity index 100% rename from crates/brk_computer/src/internal/group/full.rs rename to crates/brk_computer/src/internal/single/group/full.rs diff --git a/crates/brk_computer/src/internal/group/min_max.rs b/crates/brk_computer/src/internal/single/group/min_max.rs similarity index 88% rename from crates/brk_computer/src/internal/group/min_max.rs rename to crates/brk_computer/src/internal/single/group/min_max.rs index 2e464664d..325978e4b 100644 --- a/crates/brk_computer/src/internal/group/min_max.rs +++ b/crates/brk_computer/src/internal/single/group/min_max.rs @@ -3,8 +3,7 @@ use brk_traversable::Traversable; use schemars::JsonSchema; use vecdb::{Database, VecIndex, Version}; -use crate::internal::vec::{MaxVec, MinVec}; -use crate::internal::ComputedVecValue; +use crate::internal::{ComputedVecValue, MaxVec, MinVec}; /// Min + Max #[derive(Clone, Traversable)] diff --git a/crates/brk_computer/src/internal/group/min_max_average.rs b/crates/brk_computer/src/internal/single/group/min_max_average.rs similarity index 97% rename from crates/brk_computer/src/internal/group/min_max_average.rs rename to crates/brk_computer/src/internal/single/group/min_max_average.rs index 4aa02f976..fd2c74d00 100644 --- a/crates/brk_computer/src/internal/group/min_max_average.rs +++ b/crates/brk_computer/src/internal/single/group/min_max_average.rs @@ -3,8 +3,7 @@ use brk_traversable::Traversable; use schemars::JsonSchema; use vecdb::{AnyVec, Database, Exit, IterableVec, VecIndex, VecValue, Version}; -use crate::internal::ComputedVecValue; -use crate::internal::vec::AverageVec; +use crate::internal::{AverageVec, ComputedVecValue}; use super::MinMax; diff --git a/crates/brk_computer/src/internal/group/mod.rs b/crates/brk_computer/src/internal/single/group/mod.rs similarity index 100% rename from crates/brk_computer/src/internal/group/mod.rs rename to crates/brk_computer/src/internal/single/group/mod.rs diff --git a/crates/brk_computer/src/internal/group/percentiles.rs b/crates/brk_computer/src/internal/single/group/percentiles.rs similarity index 89% rename from crates/brk_computer/src/internal/group/percentiles.rs rename to crates/brk_computer/src/internal/single/group/percentiles.rs index 3c8970474..55d9ae58c 100644 --- a/crates/brk_computer/src/internal/group/percentiles.rs +++ b/crates/brk_computer/src/internal/single/group/percentiles.rs @@ -3,8 +3,7 @@ use brk_traversable::Traversable; use schemars::JsonSchema; use vecdb::{Database, VecIndex, Version}; -use crate::internal::vec::{MedianVec, Pct10Vec, Pct25Vec, Pct75Vec, Pct90Vec}; -use crate::internal::ComputedVecValue; +use crate::internal::{ComputedVecValue, MedianVec, Pct10Vec, Pct25Vec, Pct75Vec, Pct90Vec}; /// All percentiles (pct10, pct25, median, pct75, pct90) #[derive(Clone, Traversable)] diff --git a/crates/brk_computer/src/internal/group/stats.rs b/crates/brk_computer/src/internal/single/group/stats.rs similarity index 96% rename from crates/brk_computer/src/internal/group/stats.rs rename to crates/brk_computer/src/internal/single/group/stats.rs index b209846eb..00cfba581 100644 --- a/crates/brk_computer/src/internal/group/stats.rs +++ b/crates/brk_computer/src/internal/single/group/stats.rs @@ -3,8 +3,7 @@ use brk_traversable::Traversable; use schemars::JsonSchema; use vecdb::{AnyVec, Database, Exit, IterableVec, VecIndex, VecValue, Version}; -use crate::internal::vec::AverageVec; -use crate::internal::ComputedVecValue; +use crate::internal::{AverageVec, ComputedVecValue}; use super::{MinMax, SumCum}; diff --git a/crates/brk_computer/src/internal/group/sum_cum.rs b/crates/brk_computer/src/internal/single/group/sum_cum.rs similarity index 97% rename from crates/brk_computer/src/internal/group/sum_cum.rs rename to crates/brk_computer/src/internal/single/group/sum_cum.rs index 4a4f36743..313ebb100 100644 --- a/crates/brk_computer/src/internal/group/sum_cum.rs +++ b/crates/brk_computer/src/internal/single/group/sum_cum.rs @@ -3,8 +3,7 @@ use brk_traversable::Traversable; use schemars::JsonSchema; use vecdb::{AnyVec, Database, Exit, IterableVec, VecIndex, VecValue, Version}; -use crate::internal::vec::{CumulativeVec, SumVec}; -use crate::internal::ComputedVecValue; +use crate::internal::{ComputedVecValue, CumulativeVec, SumVec}; /// Sum + Cumulative (12% of usage) #[derive(Clone, Traversable)] diff --git a/crates/brk_computer/src/internal/aggregation/average.rs b/crates/brk_computer/src/internal/single/lazy/average.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/average.rs rename to crates/brk_computer/src/internal/single/lazy/average.rs diff --git a/crates/brk_computer/src/internal/aggregation/cumulative.rs b/crates/brk_computer/src/internal/single/lazy/cumulative.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/cumulative.rs rename to crates/brk_computer/src/internal/single/lazy/cumulative.rs diff --git a/crates/brk_computer/src/internal/aggregation/distribution.rs b/crates/brk_computer/src/internal/single/lazy/distribution.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/distribution.rs rename to crates/brk_computer/src/internal/single/lazy/distribution.rs diff --git a/crates/brk_computer/src/internal/aggregation/first.rs b/crates/brk_computer/src/internal/single/lazy/first.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/first.rs rename to crates/brk_computer/src/internal/single/lazy/first.rs diff --git a/crates/brk_computer/src/internal/aggregation/stats_aggregate.rs b/crates/brk_computer/src/internal/single/lazy/full.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/stats_aggregate.rs rename to crates/brk_computer/src/internal/single/lazy/full.rs diff --git a/crates/brk_computer/src/internal/aggregation/last.rs b/crates/brk_computer/src/internal/single/lazy/last.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/last.rs rename to crates/brk_computer/src/internal/single/lazy/last.rs diff --git a/crates/brk_computer/src/internal/aggregation/max.rs b/crates/brk_computer/src/internal/single/lazy/max.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/max.rs rename to crates/brk_computer/src/internal/single/lazy/max.rs diff --git a/crates/brk_computer/src/internal/aggregation/min.rs b/crates/brk_computer/src/internal/single/lazy/min.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/min.rs rename to crates/brk_computer/src/internal/single/lazy/min.rs diff --git a/crates/brk_computer/src/internal/aggregation/mod.rs b/crates/brk_computer/src/internal/single/lazy/mod.rs similarity index 87% rename from crates/brk_computer/src/internal/aggregation/mod.rs rename to crates/brk_computer/src/internal/single/lazy/mod.rs index 53cf7d46e..c38e883ef 100644 --- a/crates/brk_computer/src/internal/aggregation/mod.rs +++ b/crates/brk_computer/src/internal/single/lazy/mod.rs @@ -7,7 +7,7 @@ mod first; mod last; mod max; mod min; -mod stats_aggregate; +mod full; mod sum; mod sum_cum; @@ -18,6 +18,6 @@ pub use first::*; pub use last::*; pub use max::*; pub use min::*; -pub use stats_aggregate::*; +pub use full::*; pub use sum::*; pub use sum_cum::*; diff --git a/crates/brk_computer/src/internal/aggregation/sum.rs b/crates/brk_computer/src/internal/single/lazy/sum.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/sum.rs rename to crates/brk_computer/src/internal/single/lazy/sum.rs diff --git a/crates/brk_computer/src/internal/aggregation/sum_cum.rs b/crates/brk_computer/src/internal/single/lazy/sum_cum.rs similarity index 100% rename from crates/brk_computer/src/internal/aggregation/sum_cum.rs rename to crates/brk_computer/src/internal/single/lazy/sum_cum.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/binary_last.rs b/crates/brk_computer/src/internal/single/lazy_transform/binary_last.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/binary_last.rs rename to crates/brk_computer/src/internal/single/lazy_transform/binary_last.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/binary_sum.rs b/crates/brk_computer/src/internal/single/lazy_transform/binary_sum.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/binary_sum.rs rename to crates/brk_computer/src/internal/single/lazy_transform/binary_sum.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/binary_sum_cum.rs b/crates/brk_computer/src/internal/single/lazy_transform/binary_sum_cum.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/binary_sum_cum.rs rename to crates/brk_computer/src/internal/single/lazy_transform/binary_sum_cum.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/full.rs b/crates/brk_computer/src/internal/single/lazy_transform/full.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/full.rs rename to crates/brk_computer/src/internal/single/lazy_transform/full.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/last.rs b/crates/brk_computer/src/internal/single/lazy_transform/last.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/last.rs rename to crates/brk_computer/src/internal/single/lazy_transform/last.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/mod.rs b/crates/brk_computer/src/internal/single/lazy_transform/mod.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/mod.rs rename to crates/brk_computer/src/internal/single/lazy_transform/mod.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/percentiles.rs b/crates/brk_computer/src/internal/single/lazy_transform/percentiles.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/percentiles.rs rename to crates/brk_computer/src/internal/single/lazy_transform/percentiles.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/stats.rs b/crates/brk_computer/src/internal/single/lazy_transform/stats.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/stats.rs rename to crates/brk_computer/src/internal/single/lazy_transform/stats.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/sum.rs b/crates/brk_computer/src/internal/single/lazy_transform/sum.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/sum.rs rename to crates/brk_computer/src/internal/single/lazy_transform/sum.rs diff --git a/crates/brk_computer/src/internal/lazy/transform/sum_cum.rs b/crates/brk_computer/src/internal/single/lazy_transform/sum_cum.rs similarity index 100% rename from crates/brk_computer/src/internal/lazy/transform/sum_cum.rs rename to crates/brk_computer/src/internal/single/lazy_transform/sum_cum.rs diff --git a/crates/brk_computer/src/internal/single/mod.rs b/crates/brk_computer/src/internal/single/mod.rs new file mode 100644 index 000000000..ce496144d --- /dev/null +++ b/crates/brk_computer/src/internal/single/mod.rs @@ -0,0 +1,17 @@ +//! Single-index types and primitives. + +mod group; +mod lazy; +mod lazy_transform; +mod transform; +mod tx; +mod value; +mod vec; + +pub use group::*; +pub use lazy::*; +pub use lazy_transform::*; +pub use transform::*; +pub use tx::*; +pub use value::*; +pub use vec::*; diff --git a/crates/brk_computer/src/internal/transform/close_price_times_ratio.rs b/crates/brk_computer/src/internal/single/transform/close_price_times_ratio.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/close_price_times_ratio.rs rename to crates/brk_computer/src/internal/single/transform/close_price_times_ratio.rs diff --git a/crates/brk_computer/src/internal/transform/close_price_times_sats.rs b/crates/brk_computer/src/internal/single/transform/close_price_times_sats.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/close_price_times_sats.rs rename to crates/brk_computer/src/internal/single/transform/close_price_times_sats.rs diff --git a/crates/brk_computer/src/internal/transform/difference_f32.rs b/crates/brk_computer/src/internal/single/transform/difference_f32.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/difference_f32.rs rename to crates/brk_computer/src/internal/single/transform/difference_f32.rs diff --git a/crates/brk_computer/src/internal/transform/dollar_halve.rs b/crates/brk_computer/src/internal/single/transform/dollar_halve.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/dollar_halve.rs rename to crates/brk_computer/src/internal/single/transform/dollar_halve.rs diff --git a/crates/brk_computer/src/internal/transform/dollar_identity.rs b/crates/brk_computer/src/internal/single/transform/dollar_identity.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/dollar_identity.rs rename to crates/brk_computer/src/internal/single/transform/dollar_identity.rs diff --git a/crates/brk_computer/src/internal/transform/dollar_minus.rs b/crates/brk_computer/src/internal/single/transform/dollar_minus.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/dollar_minus.rs rename to crates/brk_computer/src/internal/single/transform/dollar_minus.rs diff --git a/crates/brk_computer/src/internal/transform/dollar_plus.rs b/crates/brk_computer/src/internal/single/transform/dollar_plus.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/dollar_plus.rs rename to crates/brk_computer/src/internal/single/transform/dollar_plus.rs diff --git a/crates/brk_computer/src/internal/transform/dollar_times_tenths.rs b/crates/brk_computer/src/internal/single/transform/dollar_times_tenths.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/dollar_times_tenths.rs rename to crates/brk_computer/src/internal/single/transform/dollar_times_tenths.rs diff --git a/crates/brk_computer/src/internal/transform/f32_identity.rs b/crates/brk_computer/src/internal/single/transform/f32_identity.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/f32_identity.rs rename to crates/brk_computer/src/internal/single/transform/f32_identity.rs diff --git a/crates/brk_computer/src/internal/transform/half_close_price_times_sats.rs b/crates/brk_computer/src/internal/single/transform/half_close_price_times_sats.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/half_close_price_times_sats.rs rename to crates/brk_computer/src/internal/single/transform/half_close_price_times_sats.rs diff --git a/crates/brk_computer/src/internal/transform/mod.rs b/crates/brk_computer/src/internal/single/transform/mod.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/mod.rs rename to crates/brk_computer/src/internal/single/transform/mod.rs diff --git a/crates/brk_computer/src/internal/transform/percentage_diff_close_dollars.rs b/crates/brk_computer/src/internal/single/transform/percentage_diff_close_dollars.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/percentage_diff_close_dollars.rs rename to crates/brk_computer/src/internal/single/transform/percentage_diff_close_dollars.rs diff --git a/crates/brk_computer/src/internal/transform/percentage_dollars_f32.rs b/crates/brk_computer/src/internal/single/transform/percentage_dollars_f32.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/percentage_dollars_f32.rs rename to crates/brk_computer/src/internal/single/transform/percentage_dollars_f32.rs diff --git a/crates/brk_computer/src/internal/transform/percentage_dollars_f32_neg.rs b/crates/brk_computer/src/internal/single/transform/percentage_dollars_f32_neg.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/percentage_dollars_f32_neg.rs rename to crates/brk_computer/src/internal/single/transform/percentage_dollars_f32_neg.rs diff --git a/crates/brk_computer/src/internal/transform/percentage_sats_f64.rs b/crates/brk_computer/src/internal/single/transform/percentage_sats_f64.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/percentage_sats_f64.rs rename to crates/brk_computer/src/internal/single/transform/percentage_sats_f64.rs diff --git a/crates/brk_computer/src/internal/transform/percentage_u32_f32.rs b/crates/brk_computer/src/internal/single/transform/percentage_u32_f32.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/percentage_u32_f32.rs rename to crates/brk_computer/src/internal/single/transform/percentage_u32_f32.rs diff --git a/crates/brk_computer/src/internal/transform/percentage_u64_f32.rs b/crates/brk_computer/src/internal/single/transform/percentage_u64_f32.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/percentage_u64_f32.rs rename to crates/brk_computer/src/internal/single/transform/percentage_u64_f32.rs diff --git a/crates/brk_computer/src/internal/transform/price_times_ratio.rs b/crates/brk_computer/src/internal/single/transform/price_times_ratio.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/price_times_ratio.rs rename to crates/brk_computer/src/internal/single/transform/price_times_ratio.rs diff --git a/crates/brk_computer/src/internal/transform/ratio32.rs b/crates/brk_computer/src/internal/single/transform/ratio32.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/ratio32.rs rename to crates/brk_computer/src/internal/single/transform/ratio32.rs diff --git a/crates/brk_computer/src/internal/transform/ratio32_neg.rs b/crates/brk_computer/src/internal/single/transform/ratio32_neg.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/ratio32_neg.rs rename to crates/brk_computer/src/internal/single/transform/ratio32_neg.rs diff --git a/crates/brk_computer/src/internal/transform/ratio_f32.rs b/crates/brk_computer/src/internal/single/transform/ratio_f32.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/ratio_f32.rs rename to crates/brk_computer/src/internal/single/transform/ratio_f32.rs diff --git a/crates/brk_computer/src/internal/transform/return_f32_tenths.rs b/crates/brk_computer/src/internal/single/transform/return_f32_tenths.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/return_f32_tenths.rs rename to crates/brk_computer/src/internal/single/transform/return_f32_tenths.rs diff --git a/crates/brk_computer/src/internal/transform/return_i16.rs b/crates/brk_computer/src/internal/single/transform/return_i16.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/return_i16.rs rename to crates/brk_computer/src/internal/single/transform/return_i16.rs diff --git a/crates/brk_computer/src/internal/transform/return_u16.rs b/crates/brk_computer/src/internal/single/transform/return_u16.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/return_u16.rs rename to crates/brk_computer/src/internal/single/transform/return_u16.rs diff --git a/crates/brk_computer/src/internal/transform/rsi_formula.rs b/crates/brk_computer/src/internal/single/transform/rsi_formula.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/rsi_formula.rs rename to crates/brk_computer/src/internal/single/transform/rsi_formula.rs diff --git a/crates/brk_computer/src/internal/transform/sat_halve.rs b/crates/brk_computer/src/internal/single/transform/sat_halve.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/sat_halve.rs rename to crates/brk_computer/src/internal/single/transform/sat_halve.rs diff --git a/crates/brk_computer/src/internal/transform/sat_halve_to_bitcoin.rs b/crates/brk_computer/src/internal/single/transform/sat_halve_to_bitcoin.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/sat_halve_to_bitcoin.rs rename to crates/brk_computer/src/internal/single/transform/sat_halve_to_bitcoin.rs diff --git a/crates/brk_computer/src/internal/transform/sat_identity.rs b/crates/brk_computer/src/internal/single/transform/sat_identity.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/sat_identity.rs rename to crates/brk_computer/src/internal/single/transform/sat_identity.rs diff --git a/crates/brk_computer/src/internal/transform/sat_mask.rs b/crates/brk_computer/src/internal/single/transform/sat_mask.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/sat_mask.rs rename to crates/brk_computer/src/internal/single/transform/sat_mask.rs diff --git a/crates/brk_computer/src/internal/transform/sat_plus.rs b/crates/brk_computer/src/internal/single/transform/sat_plus.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/sat_plus.rs rename to crates/brk_computer/src/internal/single/transform/sat_plus.rs diff --git a/crates/brk_computer/src/internal/transform/sat_plus_to_bitcoin.rs b/crates/brk_computer/src/internal/single/transform/sat_plus_to_bitcoin.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/sat_plus_to_bitcoin.rs rename to crates/brk_computer/src/internal/single/transform/sat_plus_to_bitcoin.rs diff --git a/crates/brk_computer/src/internal/transform/sat_to_bitcoin.rs b/crates/brk_computer/src/internal/single/transform/sat_to_bitcoin.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/sat_to_bitcoin.rs rename to crates/brk_computer/src/internal/single/transform/sat_to_bitcoin.rs diff --git a/crates/brk_computer/src/internal/transform/u16_to_years.rs b/crates/brk_computer/src/internal/single/transform/u16_to_years.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/u16_to_years.rs rename to crates/brk_computer/src/internal/single/transform/u16_to_years.rs diff --git a/crates/brk_computer/src/internal/transform/volatility_sqrt30.rs b/crates/brk_computer/src/internal/single/transform/volatility_sqrt30.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/volatility_sqrt30.rs rename to crates/brk_computer/src/internal/single/transform/volatility_sqrt30.rs diff --git a/crates/brk_computer/src/internal/transform/volatility_sqrt365.rs b/crates/brk_computer/src/internal/single/transform/volatility_sqrt365.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/volatility_sqrt365.rs rename to crates/brk_computer/src/internal/single/transform/volatility_sqrt365.rs diff --git a/crates/brk_computer/src/internal/transform/volatility_sqrt7.rs b/crates/brk_computer/src/internal/single/transform/volatility_sqrt7.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/volatility_sqrt7.rs rename to crates/brk_computer/src/internal/single/transform/volatility_sqrt7.rs diff --git a/crates/brk_computer/src/internal/transform/weight_to_fullness.rs b/crates/brk_computer/src/internal/single/transform/weight_to_fullness.rs similarity index 100% rename from crates/brk_computer/src/internal/transform/weight_to_fullness.rs rename to crates/brk_computer/src/internal/single/transform/weight_to_fullness.rs diff --git a/crates/brk_computer/src/internal/computed/tx/distribution.rs b/crates/brk_computer/src/internal/single/tx/distribution.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/tx/distribution.rs rename to crates/brk_computer/src/internal/single/tx/distribution.rs diff --git a/crates/brk_computer/src/internal/computed/tx/mod.rs b/crates/brk_computer/src/internal/single/tx/mod.rs similarity index 100% rename from crates/brk_computer/src/internal/computed/tx/mod.rs rename to crates/brk_computer/src/internal/single/tx/mod.rs diff --git a/crates/brk_computer/src/internal/specialized/value/block/height.rs b/crates/brk_computer/src/internal/single/value/height.rs similarity index 100% rename from crates/brk_computer/src/internal/specialized/value/block/height.rs rename to crates/brk_computer/src/internal/single/value/height.rs diff --git a/crates/brk_computer/src/internal/single/value/mod.rs b/crates/brk_computer/src/internal/single/value/mod.rs new file mode 100644 index 000000000..c8b12e279 --- /dev/null +++ b/crates/brk_computer/src/internal/single/value/mod.rs @@ -0,0 +1,3 @@ +mod height; + +pub use height::*; diff --git a/crates/brk_computer/src/internal/vec/average.rs b/crates/brk_computer/src/internal/single/vec/average.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/average.rs rename to crates/brk_computer/src/internal/single/vec/average.rs diff --git a/crates/brk_computer/src/internal/vec/cumulative.rs b/crates/brk_computer/src/internal/single/vec/cumulative.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/cumulative.rs rename to crates/brk_computer/src/internal/single/vec/cumulative.rs diff --git a/crates/brk_computer/src/internal/vec/first.rs b/crates/brk_computer/src/internal/single/vec/first.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/first.rs rename to crates/brk_computer/src/internal/single/vec/first.rs diff --git a/crates/brk_computer/src/internal/vec/last.rs b/crates/brk_computer/src/internal/single/vec/last.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/last.rs rename to crates/brk_computer/src/internal/single/vec/last.rs diff --git a/crates/brk_computer/src/internal/vec/max.rs b/crates/brk_computer/src/internal/single/vec/max.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/max.rs rename to crates/brk_computer/src/internal/single/vec/max.rs diff --git a/crates/brk_computer/src/internal/vec/min.rs b/crates/brk_computer/src/internal/single/vec/min.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/min.rs rename to crates/brk_computer/src/internal/single/vec/min.rs diff --git a/crates/brk_computer/src/internal/vec/mod.rs b/crates/brk_computer/src/internal/single/vec/mod.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/mod.rs rename to crates/brk_computer/src/internal/single/vec/mod.rs diff --git a/crates/brk_computer/src/internal/vec/percentiles.rs b/crates/brk_computer/src/internal/single/vec/percentiles.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/percentiles.rs rename to crates/brk_computer/src/internal/single/vec/percentiles.rs diff --git a/crates/brk_computer/src/internal/vec/sum.rs b/crates/brk_computer/src/internal/single/vec/sum.rs similarity index 100% rename from crates/brk_computer/src/internal/vec/sum.rs rename to crates/brk_computer/src/internal/single/vec/sum.rs diff --git a/crates/brk_computer/src/internal/specialized/value/mod.rs b/crates/brk_computer/src/internal/specialized/value/mod.rs deleted file mode 100644 index e67ad59bb..000000000 --- a/crates/brk_computer/src/internal/specialized/value/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod block; -mod date; -mod derived_block; -mod tx; - -pub use block::*; -pub use date::*; -pub use derived_block::*; -pub use tx::*; diff --git a/crates/brk_computer/src/internal/traits/computed.rs b/crates/brk_computer/src/internal/traits.rs similarity index 73% rename from crates/brk_computer/src/internal/traits/computed.rs rename to crates/brk_computer/src/internal/traits.rs index d0cf21d97..2646723a6 100644 --- a/crates/brk_computer/src/internal/traits/computed.rs +++ b/crates/brk_computer/src/internal/traits.rs @@ -1,3 +1,5 @@ +//! Internal traits for computed vec values. + use std::ops::{Add, AddAssign, Div}; use serde::Serialize; @@ -26,3 +28,7 @@ impl ComputedVecValue for T where + Serialize { } + +pub trait NumericValue: ComputedVecValue + From + Into {} + +impl NumericValue for T where T: ComputedVecValue + From + Into {} diff --git a/crates/brk_computer/src/internal/traits/mod.rs b/crates/brk_computer/src/internal/traits/mod.rs deleted file mode 100644 index 31174c352..000000000 --- a/crates/brk_computer/src/internal/traits/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod computed; -mod numeric; - -pub use computed::*; -pub use numeric::*; diff --git a/crates/brk_computer/src/internal/traits/numeric.rs b/crates/brk_computer/src/internal/traits/numeric.rs deleted file mode 100644 index d65a7c920..000000000 --- a/crates/brk_computer/src/internal/traits/numeric.rs +++ /dev/null @@ -1,5 +0,0 @@ -use super::ComputedVecValue; - -pub trait NumericValue: ComputedVecValue + From + Into {} - -impl NumericValue for T where T: ComputedVecValue + From + Into {} diff --git a/crates/brk_computer/src/market/ath/import.rs b/crates/brk_computer/src/market/ath/import.rs index 69a7e7679..c27e8cf32 100644 --- a/crates/brk_computer/src/market/ath/import.rs +++ b/crates/brk_computer/src/market/ath/import.rs @@ -6,7 +6,7 @@ use super::Vecs; use crate::{ indexes, internal::{ - BinaryHeightDateLast, ComputedDateLast, ComputedHeightDateLast, LazyDateLast, + ComputedDateLast, ComputedHeightDateLast, LazyBinaryHeightDateLast, LazyDateLast, PercentageDiffCloseDollars, StoredU16ToYears, }, price, @@ -42,7 +42,7 @@ impl Vecs { ); let price_drawdown = - BinaryHeightDateLast::from_computed_both_last::( + LazyBinaryHeightDateLast::from_computed_both_last::( "price_drawdown", version, EagerVec::forced_import(db, "price_drawdown", version)?, diff --git a/crates/brk_computer/src/market/ath/vecs.rs b/crates/brk_computer/src/market/ath/vecs.rs index e83cdcda5..74edaaec7 100644 --- a/crates/brk_computer/src/market/ath/vecs.rs +++ b/crates/brk_computer/src/market/ath/vecs.rs @@ -2,14 +2,14 @@ use brk_traversable::Traversable; use brk_types::{Close, Dollars, StoredF32, StoredU16}; use crate::internal::{ - BinaryHeightDateLast, ComputedDateLast, ComputedHeightDateLast, LazyDateLast, + ComputedDateLast, ComputedHeightDateLast, LazyBinaryHeightDateLast, LazyDateLast, }; /// All-time high related metrics #[derive(Clone, Traversable)] pub struct Vecs { pub price_ath: ComputedHeightDateLast, - pub price_drawdown: BinaryHeightDateLast, Dollars>, + pub price_drawdown: LazyBinaryHeightDateLast, Dollars>, pub days_since_price_ath: ComputedDateLast, pub years_since_price_ath: LazyDateLast, pub max_days_between_price_aths: ComputedDateLast, diff --git a/crates/brk_computer/src/price/cents/import.rs b/crates/brk_computer/src/price/cents/import.rs index 16f3d885f..2b52d0b86 100644 --- a/crates/brk_computer/src/price/cents/import.rs +++ b/crates/brk_computer/src/price/cents/import.rs @@ -3,14 +3,14 @@ use brk_types::{DateIndex, Height, OHLCCents, Version}; use vecdb::{Database, IterableCloneableVec, LazyVecFrom1}; use super::Vecs; -use crate::internal::{HeightDateBytes, HeightDateLazyOHLC, LazyOHLC}; +use crate::internal::{ComputedHeightDateBytes, LazyHeightDateOHLC, LazyOHLC}; impl Vecs { pub fn forced_import(db: &Database, version: Version) -> Result { - let ohlc: HeightDateBytes = - HeightDateBytes::forced_import(db, "ohlc_cents", version)?; + let ohlc: ComputedHeightDateBytes = + ComputedHeightDateBytes::forced_import(db, "ohlc_cents", version)?; - let components = HeightDateLazyOHLC { + let components = LazyHeightDateOHLC { height: LazyOHLC { open: LazyVecFrom1::init( "price_open_cents", diff --git a/crates/brk_computer/src/price/cents/vecs.rs b/crates/brk_computer/src/price/cents/vecs.rs index ee5a22dbf..03a9d0c83 100644 --- a/crates/brk_computer/src/price/cents/vecs.rs +++ b/crates/brk_computer/src/price/cents/vecs.rs @@ -1,10 +1,10 @@ use brk_traversable::Traversable; use brk_types::{Cents, OHLCCents}; -use crate::internal::{HeightDateBytes, HeightDateLazyOHLC}; +use crate::internal::{ComputedHeightDateBytes, LazyHeightDateOHLC}; #[derive(Clone, Traversable)] pub struct Vecs { - pub split: HeightDateLazyOHLC, - pub ohlc: HeightDateBytes, + pub split: LazyHeightDateOHLC, + pub ohlc: ComputedHeightDateBytes, } diff --git a/crates/brk_computer/src/scripts/count/import.rs b/crates/brk_computer/src/scripts/count/import.rs index 61485e567..02fea94bb 100644 --- a/crates/brk_computer/src/scripts/count/import.rs +++ b/crates/brk_computer/src/scripts/count/import.rs @@ -5,7 +5,7 @@ use vecdb::{Database, IterableCloneableVec}; use super::Vecs; use crate::{ indexes, - internal::{BinaryBlockFull, ComputedBlockFull, PercentageU64F32}, + internal::{ComputedBlockFull, LazyBinaryBlockFull, PercentageU64F32}, outputs, }; @@ -32,7 +32,7 @@ impl Vecs { // Adoption ratios (lazy) // Uses outputs.count.count as denominator (total output count) // At height level: per-block ratio; at dateindex level: sum-based ratio (% of new outputs) - let taproot_adoption = BinaryBlockFull::from_height_and_txindex::( + let taproot_adoption = LazyBinaryBlockFull::from_height_and_txindex::( "taproot_adoption", version, p2tr.height.boxed_clone(), @@ -40,7 +40,7 @@ impl Vecs { &p2tr, &outputs.count.total_count, ); - let segwit_adoption = BinaryBlockFull::from_height_and_txindex::( + let segwit_adoption = LazyBinaryBlockFull::from_height_and_txindex::( "segwit_adoption", version, segwit.height.boxed_clone(), diff --git a/crates/brk_computer/src/scripts/count/vecs.rs b/crates/brk_computer/src/scripts/count/vecs.rs index 5d60da069..646edcf52 100644 --- a/crates/brk_computer/src/scripts/count/vecs.rs +++ b/crates/brk_computer/src/scripts/count/vecs.rs @@ -1,7 +1,7 @@ use brk_traversable::Traversable; use brk_types::{StoredF32, StoredU64}; -use crate::internal::{BinaryBlockFull, ComputedBlockFull}; +use crate::internal::{ComputedBlockFull, LazyBinaryBlockFull}; #[derive(Clone, Traversable)] pub struct Vecs { @@ -24,6 +24,6 @@ pub struct Vecs { pub segwit: ComputedBlockFull, // Adoption ratios - pub taproot_adoption: BinaryBlockFull, - pub segwit_adoption: BinaryBlockFull, + pub taproot_adoption: LazyBinaryBlockFull, + pub segwit_adoption: LazyBinaryBlockFull, } diff --git a/crates/brk_computer/src/supply/circulating/import.rs b/crates/brk_computer/src/supply/circulating/import.rs index ed138d3df..8541171cf 100644 --- a/crates/brk_computer/src/supply/circulating/import.rs +++ b/crates/brk_computer/src/supply/circulating/import.rs @@ -3,14 +3,14 @@ use brk_types::Version; use super::Vecs; use crate::{ distribution, - internal::{DollarsIdentity, LazyLastBlockValue, SatsIdentity}, + internal::{DollarsIdentity, LazyValueBlockLast, SatsIdentity}, }; impl Vecs { pub fn import(version: Version, distribution: &distribution::Vecs) -> Self { let supply_metrics = &distribution.utxo_cohorts.all.metrics.supply; - Self(LazyLastBlockValue::from_block_source::< + Self(LazyValueBlockLast::from_block_source::< SatsIdentity, DollarsIdentity, >( diff --git a/crates/brk_computer/src/supply/circulating/vecs.rs b/crates/brk_computer/src/supply/circulating/vecs.rs index 886985ded..b6666f04b 100644 --- a/crates/brk_computer/src/supply/circulating/vecs.rs +++ b/crates/brk_computer/src/supply/circulating/vecs.rs @@ -1,8 +1,8 @@ use brk_traversable::Traversable; use derive_more::{Deref, DerefMut}; -use crate::internal::LazyLastBlockValue; +use crate::internal::LazyValueBlockLast; /// Circulating supply - lazy references to distribution's actual supply (KISS) #[derive(Clone, Deref, DerefMut, Traversable)] -pub struct Vecs(pub LazyLastBlockValue); +pub struct Vecs(pub LazyValueBlockLast); diff --git a/crates/brk_computer/src/supply/inflation/import.rs b/crates/brk_computer/src/supply/inflation/import.rs index c2300a771..fa3289a9b 100644 --- a/crates/brk_computer/src/supply/inflation/import.rs +++ b/crates/brk_computer/src/supply/inflation/import.rs @@ -3,11 +3,11 @@ use brk_types::Version; use vecdb::Database; use super::Vecs; -use crate::{indexes, internal::ComputedVecsDateAverage}; +use crate::{indexes, internal::ComputedDateAverage}; impl Vecs { pub fn forced_import(db: &Database, version: Version, indexes: &indexes::Vecs) -> Result { - Ok(Self(ComputedVecsDateAverage::forced_import( + Ok(Self(ComputedDateAverage::forced_import( db, "inflation_rate", version, diff --git a/crates/brk_computer/src/supply/inflation/vecs.rs b/crates/brk_computer/src/supply/inflation/vecs.rs index 014cc95a5..9bad0b793 100644 --- a/crates/brk_computer/src/supply/inflation/vecs.rs +++ b/crates/brk_computer/src/supply/inflation/vecs.rs @@ -2,9 +2,9 @@ use brk_traversable::Traversable; use brk_types::StoredF32; use derive_more::{Deref, DerefMut}; -use crate::internal::ComputedVecsDateAverage; +use crate::internal::ComputedDateAverage; /// Inflation rate metrics #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(transparent)] -pub struct Vecs(pub ComputedVecsDateAverage); +pub struct Vecs(pub ComputedDateAverage); diff --git a/crates/brk_computer/src/supply/velocity/import.rs b/crates/brk_computer/src/supply/velocity/import.rs index 520c9023e..cd83dfbbc 100644 --- a/crates/brk_computer/src/supply/velocity/import.rs +++ b/crates/brk_computer/src/supply/velocity/import.rs @@ -3,7 +3,7 @@ use brk_types::Version; use vecdb::Database; use super::Vecs; -use crate::{indexes, internal::ComputedVecsDateAverage}; +use crate::{indexes, internal::ComputedDateAverage}; impl Vecs { pub fn forced_import( @@ -13,9 +13,9 @@ impl Vecs { compute_dollars: bool, ) -> Result { Ok(Self { - btc: ComputedVecsDateAverage::forced_import(db, "btc_velocity", version, indexes)?, + btc: ComputedDateAverage::forced_import(db, "btc_velocity", version, indexes)?, usd: compute_dollars.then(|| { - ComputedVecsDateAverage::forced_import(db, "usd_velocity", version, indexes) + ComputedDateAverage::forced_import(db, "usd_velocity", version, indexes) .unwrap() }), }) diff --git a/crates/brk_computer/src/supply/velocity/vecs.rs b/crates/brk_computer/src/supply/velocity/vecs.rs index 9dd548acd..38f250d65 100644 --- a/crates/brk_computer/src/supply/velocity/vecs.rs +++ b/crates/brk_computer/src/supply/velocity/vecs.rs @@ -1,11 +1,11 @@ use brk_traversable::Traversable; use brk_types::StoredF64; -use crate::internal::ComputedVecsDateAverage; +use crate::internal::ComputedDateAverage; /// Velocity metrics (annualized volume / circulating supply) #[derive(Clone, Traversable)] pub struct Vecs { - pub btc: ComputedVecsDateAverage, - pub usd: Option>, + pub btc: ComputedDateAverage, + pub usd: Option>, } diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 22df26370..a327baeb5 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -517,13 +517,12 @@ * @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); /** @@ -536,7 +535,7 @@ class BrkError extends Error { */ constructor(message, status) { super(message); - this.name = "BrkError"; + this.name = 'BrkError'; this.status = status; } } @@ -585,14 +584,12 @@ 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; }, }; } @@ -604,7 +601,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); } @@ -617,9 +614,7 @@ 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); @@ -628,16 +623,13 @@ 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(); @@ -657,7 +649,8 @@ 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 @@ -677,52 +670,24 @@ 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); } - }, + } }; } @@ -742,48 +707,23 @@ 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); } - }, + } }; } @@ -803,48 +743,23 @@ 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); } - }, + } }; } @@ -864,44 +779,22 @@ 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); } - }, + } }; } @@ -921,40 +814,21 @@ 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); } - }, + } }; } @@ -974,21 +848,17 @@ 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); } - }, + } }; } @@ -1008,18 +878,16 @@ 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); } - }, + } }; } @@ -1039,18 +907,16 @@ 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); } - }, + } }; } @@ -1070,18 +936,16 @@ 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); } - }, + } }; } @@ -1101,18 +965,16 @@ 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); } - }, + } }; } @@ -1132,18 +994,16 @@ 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); } - }, + } }; } @@ -1163,18 +1023,16 @@ 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); } - }, + } }; } @@ -1194,18 +1052,16 @@ 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); } - }, + } }; } @@ -1225,18 +1081,16 @@ 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); } - }, + } }; } @@ -1256,18 +1110,16 @@ 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); } - }, + } }; } @@ -1287,18 +1139,16 @@ 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); } - }, + } }; } @@ -1318,18 +1168,16 @@ 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); } - }, + } }; } @@ -1349,18 +1197,16 @@ 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); } - }, + } }; } @@ -1380,18 +1226,16 @@ 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); } - }, + } }; } @@ -1411,18 +1255,16 @@ 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); } - }, + } }; } @@ -1442,18 +1284,16 @@ 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); } - }, + } }; } @@ -1473,18 +1313,16 @@ 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); } - }, + } }; } @@ -1504,18 +1342,16 @@ 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); } - }, + } }; } @@ -1535,18 +1371,16 @@ 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); } - }, + } }; } @@ -1566,18 +1400,16 @@ 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); } - }, + } }; } @@ -1597,18 +1429,16 @@ 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); } - }, + } }; } @@ -1628,18 +1458,16 @@ 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); } - }, + } }; } @@ -1659,18 +1487,16 @@ 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); } - }, + } }; } @@ -1690,18 +1516,16 @@ 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); } - }, + } }; } @@ -1721,18 +1545,16 @@ 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); } - }, + } }; } @@ -1752,18 +1574,16 @@ 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); } - }, + } }; } @@ -1783,18 +1603,16 @@ 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); } - }, + } }; } @@ -1814,18 +1632,16 @@ 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); } - }, + } }; } @@ -1875,98 +1691,38 @@ 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')), }; } @@ -2012,90 +1768,36 @@ 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')), }; } @@ -2139,34 +1841,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')), }; } @@ -2209,81 +1911,33 @@ 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')), }; } @@ -2324,73 +1978,31 @@ 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')), }; } @@ -2427,25 +2039,78 @@ 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')), + }; +} + +/** + * @typedef {Object} PercentilesPattern2 + * @property {MetricPattern4} costBasisPct05 + * @property {MetricPattern4} costBasisPct10 + * @property {MetricPattern4} costBasisPct15 + * @property {MetricPattern4} costBasisPct20 + * @property {MetricPattern4} costBasisPct25 + * @property {MetricPattern4} costBasisPct30 + * @property {MetricPattern4} costBasisPct35 + * @property {MetricPattern4} costBasisPct40 + * @property {MetricPattern4} costBasisPct45 + * @property {MetricPattern4} costBasisPct50 + * @property {MetricPattern4} costBasisPct55 + * @property {MetricPattern4} costBasisPct60 + * @property {MetricPattern4} costBasisPct65 + * @property {MetricPattern4} costBasisPct70 + * @property {MetricPattern4} costBasisPct75 + * @property {MetricPattern4} costBasisPct80 + * @property {MetricPattern4} costBasisPct85 + * @property {MetricPattern4} costBasisPct90 + * @property {MetricPattern4} costBasisPct95 + */ + +/** + * Create a PercentilesPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {PercentilesPattern2} + */ +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')), }; } @@ -2481,80 +2146,27 @@ 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), }; } -/** - * @typedef {Object} PercentilesPattern2 - * @property {MetricPattern4} costBasisPct05 - * @property {MetricPattern4} costBasisPct10 - * @property {MetricPattern4} costBasisPct15 - * @property {MetricPattern4} costBasisPct20 - * @property {MetricPattern4} costBasisPct25 - * @property {MetricPattern4} costBasisPct30 - * @property {MetricPattern4} costBasisPct35 - * @property {MetricPattern4} costBasisPct40 - * @property {MetricPattern4} costBasisPct45 - * @property {MetricPattern4} costBasisPct50 - * @property {MetricPattern4} costBasisPct55 - * @property {MetricPattern4} costBasisPct60 - * @property {MetricPattern4} costBasisPct65 - * @property {MetricPattern4} costBasisPct70 - * @property {MetricPattern4} costBasisPct75 - * @property {MetricPattern4} costBasisPct80 - * @property {MetricPattern4} costBasisPct85 - * @property {MetricPattern4} costBasisPct90 - * @property {MetricPattern4} costBasisPct95 - */ - -/** - * Create a PercentilesPattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {PercentilesPattern2} - */ -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")), - }; -} - /** * @typedef {Object} RelativePattern5 * @property {MetricPattern1} negUnrealizedLossRelToMarketCap @@ -2585,75 +2197,24 @@ 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')), }; } @@ -2683,20 +2244,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')), }; } @@ -2727,19 +2288,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')), }; } @@ -2767,18 +2328,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')), }; } @@ -2808,18 +2369,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')), }; } @@ -2848,82 +2409,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} RelativePattern2 - * @property {MetricPattern1} negUnrealizedLossRelToOwnMarketCap - * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} netUnrealizedPnlRelToOwnMarketCap - * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply - * @property {MetricPattern1} unrealizedLossRelToOwnMarketCap - * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} unrealizedProfitRelToOwnMarketCap - * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl - */ - -/** - * Create a RelativePattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {RelativePattern2} - */ -function createRelativePattern2(client, acc) { - return { - negUnrealizedLossRelToOwnMarketCap: createMetricPattern1( - client, - _m(acc, "neg_unrealized_loss_rel_to_own_market_cap"), - ), - negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1( - client, - _m(acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl"), - ), - netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1( - client, - _m(acc, "net_unrealized_pnl_rel_to_own_market_cap"), - ), - netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1( - client, - _m(acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl"), - ), - supplyInLossRelToOwnSupply: createMetricPattern1( - client, - _m(acc, "supply_in_loss_rel_to_own_supply"), - ), - supplyInProfitRelToOwnSupply: createMetricPattern1( - client, - _m(acc, "supply_in_profit_rel_to_own_supply"), - ), - unrealizedLossRelToOwnMarketCap: createMetricPattern1( - client, - _m(acc, "unrealized_loss_rel_to_own_market_cap"), - ), - unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1( - client, - _m(acc, "unrealized_loss_rel_to_own_total_unrealized_pnl"), - ), - unrealizedProfitRelToOwnMarketCap: createMetricPattern1( - client, - _m(acc, "unrealized_profit_rel_to_own_market_cap"), - ), - unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1( - client, - _m(acc, "unrealized_profit_rel_to_own_total_unrealized_pnl"), - ), + _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')), }; } @@ -2949,43 +2445,51 @@ function createRelativePattern2(client, acc) { */ 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"), - ), + 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')), + }; +} + +/** + * @typedef {Object} RelativePattern2 + * @property {MetricPattern1} negUnrealizedLossRelToOwnMarketCap + * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} netUnrealizedPnlRelToOwnMarketCap + * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply + * @property {MetricPattern1} unrealizedLossRelToOwnMarketCap + * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl + * @property {MetricPattern1} unrealizedProfitRelToOwnMarketCap + * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl + */ + +/** + * Create a RelativePattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RelativePattern2} + */ +function createRelativePattern2(client, acc) { + return { + negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), + negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')), + netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), + netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')), + supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), + supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), + unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), + unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')), + unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), + unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')), }; } @@ -3010,65 +2514,15 @@ function createRelativePattern(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", - ), - }; -} - -/** - * @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), + 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')), }; } @@ -3107,6 +2561,41 @@ 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 @@ -3128,146 +2617,12 @@ function createOhlcPattern(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")), - 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), - }; -} - -/** - * @typedef {Object} UnrealizedPattern - * @property {MetricPattern1} negUnrealizedLoss - * @property {MetricPattern1} netUnrealizedPnl - * @property {_24hCoinbaseSumPattern} supplyInLoss - * @property {_24hCoinbaseSumPattern} supplyInProfit - * @property {MetricPattern1} totalUnrealizedPnl - * @property {MetricPattern1} unrealizedLoss - * @property {MetricPattern1} unrealizedProfit - */ - -/** - * Create a UnrealizedPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {UnrealizedPattern} - */ -function createUnrealizedPattern(client, acc) { - return { - negUnrealizedLoss: createMetricPattern1( - client, - _m(acc, "neg_unrealized_loss"), - ), - netUnrealizedPnl: createMetricPattern1( - client, - _m(acc, "net_unrealized_pnl"), - ), - supplyInLoss: create_24hCoinbaseSumPattern( - client, - _m(acc, "supply_in_loss"), - ), - supplyInProfit: create_24hCoinbaseSumPattern( - client, - _m(acc, "supply_in_profit"), - ), - totalUnrealizedPnl: createMetricPattern1( - client, - _m(acc, "total_unrealized_pnl"), - ), - unrealizedLoss: createMetricPattern1(client, _m(acc, "unrealized_loss")), - unrealizedProfit: createMetricPattern1( - client, - _m(acc, "unrealized_profit"), - ), - }; -} - -/** - * @typedef {Object} _100btcPattern - * @property {ActivityPattern2} activity - * @property {CostBasisPattern} costBasis - * @property {OutputsPattern} outputs - * @property {RealizedPattern} realized - * @property {RelativePattern} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _100btcPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_100btcPattern} - */ -function create_100btcPattern(client, acc) { - return { - activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern(client, acc), - outputs: createOutputsPattern(client, acc), - realized: createRealizedPattern(client, acc), - relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, _m(acc, "supply")), - unrealized: createUnrealizedPattern(client, acc), - }; -} - -/** - * @typedef {Object} _10yTo12yPattern - * @property {ActivityPattern2} activity - * @property {CostBasisPattern2} costBasis - * @property {OutputsPattern} outputs - * @property {RealizedPattern2} realized - * @property {RelativePattern2} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _10yTo12yPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_10yTo12yPattern} - */ -function create_10yTo12yPattern(client, acc) { - return { - activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern2(client, acc), - outputs: createOutputsPattern(client, acc), - realized: createRealizedPattern2(client, acc), - relative: createRelativePattern2(client, acc), - supply: createSupplyPattern2(client, _m(acc, "supply")), + supply: createSupplyPattern2(client, _m(acc, 'supply')), unrealized: createUnrealizedPattern(client, acc), }; } @@ -3296,11 +2651,127 @@ function create_10yPattern(client, acc) { outputs: createOutputsPattern(client, acc), realized: createRealizedPattern4(client, acc), relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, _m(acc, "supply")), + supply: createSupplyPattern2(client, _m(acc, 'supply')), unrealized: createUnrealizedPattern(client, acc), }; } +/** + * @typedef {Object} _10yTo12yPattern + * @property {ActivityPattern2} activity + * @property {CostBasisPattern2} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern2} realized + * @property {RelativePattern2} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized + */ + +/** + * Create a _10yTo12yPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_10yTo12yPattern} + */ +function create_10yTo12yPattern(client, acc) { + return { + activity: createActivityPattern2(client, acc), + costBasis: createCostBasisPattern2(client, acc), + outputs: createOutputsPattern(client, acc), + realized: createRealizedPattern2(client, acc), + relative: createRelativePattern2(client, acc), + supply: createSupplyPattern2(client, _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), + }; +} + +/** + * @typedef {Object} _100btcPattern + * @property {ActivityPattern2} activity + * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern} realized + * @property {RelativePattern} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized + */ + +/** + * Create a _100btcPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_100btcPattern} + */ +function create_100btcPattern(client, acc) { + return { + activity: createActivityPattern2(client, acc), + costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, acc), + realized: createRealizedPattern(client, acc), + relative: createRelativePattern(client, acc), + supply: createSupplyPattern2(client, _m(acc, 'supply')), + unrealized: createUnrealizedPattern(client, acc), + }; +} + +/** + * @typedef {Object} UnrealizedPattern + * @property {MetricPattern1} negUnrealizedLoss + * @property {MetricPattern1} netUnrealizedPnl + * @property {_24hCoinbaseSumPattern} supplyInLoss + * @property {_24hCoinbaseSumPattern} supplyInProfit + * @property {MetricPattern1} totalUnrealizedPnl + * @property {MetricPattern1} unrealizedLoss + * @property {MetricPattern1} unrealizedProfit + */ + +/** + * Create a UnrealizedPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {UnrealizedPattern} + */ +function createUnrealizedPattern(client, acc) { + return { + negUnrealizedLoss: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')), + netUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl')), + supplyInLoss: create_24hCoinbaseSumPattern(client, _m(acc, 'supply_in_loss')), + supplyInProfit: create_24hCoinbaseSumPattern(client, _m(acc, 'supply_in_profit')), + totalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'total_unrealized_pnl')), + unrealizedLoss: createMetricPattern1(client, _m(acc, 'unrealized_loss')), + unrealizedProfit: createMetricPattern1(client, _m(acc, 'unrealized_profit')), + }; +} + /** * @typedef {Object} PeriodCagrPattern * @property {MetricPattern4} _10y @@ -3320,13 +2791,13 @@ function create_10yPattern(client, acc) { */ 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"), + _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')), }; } @@ -3334,7 +2805,7 @@ function createPeriodCagrPattern(client, acc) { * @template T * @typedef {Object} BitcoinPattern * @property {MetricPattern2} average - * @property {MetricPattern2} cumulative + * @property {MetricPattern1} cumulative * @property {MetricPattern12} height * @property {MetricPattern2} max * @property {MetricPattern2} min @@ -3351,13 +2822,13 @@ function createPeriodCagrPattern(client, acc) { */ function createBitcoinPattern(client, acc) { return { - average: createMetricPattern2(client, _m(acc, "average")), - cumulative: createMetricPattern2(client, _m(acc, "cumulative")), + average: createMetricPattern2(client, _m(acc, 'average')), + cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), height: createMetricPattern12(client, acc), - max: createMetricPattern2(client, _m(acc, "max")), - min: createMetricPattern2(client, _m(acc, "min")), + 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')), }; } @@ -3381,12 +2852,12 @@ function createBitcoinPattern(client, acc) { */ function createSizePattern(client, acc) { return { - average: createMetricPattern1(client, _m(acc, "average")), - cumulative: createMetricPattern1(client, _m(acc, "cumulative")), - max: createMetricPattern1(client, _m(acc, "max")), - min: createMetricPattern1(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: createMetricPattern1(client, _m(acc, "sum")), + sum: createMetricPattern1(client, _m(acc, 'sum')), }; } @@ -3407,23 +2878,11 @@ 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')), }; } @@ -3446,11 +2905,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')), }; } @@ -3470,10 +2929,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")), + 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')), }; } @@ -3496,9 +2955,9 @@ function createDateindexPattern2(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')), }; } @@ -3520,10 +2979,10 @@ function createHighPattern(client, acc) { */ 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: createMetricPattern1(client, _m(acc, 'close')), + high: createHighPattern(client, _m(acc, 'high')), + low: createHighPattern(client, _m(acc, 'low')), + open: createMetricPattern1(client, _m(acc, 'open')), }; } @@ -3542,8 +3001,8 @@ function createSplitPattern2(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), }; } @@ -3563,8 +3022,8 @@ function create_24hCoinbaseSumPattern(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), }; } @@ -3584,8 +3043,8 @@ function createCoinbasePattern(client, acc) { */ function createUnclaimedRewardsPattern(client, acc) { return { - bitcoin: createBlockCountPattern(client, _m(acc, "btc")), - dollars: createBlockCountPattern(client, _m(acc, "usd")), + bitcoin: createBlockCountPattern(client, _m(acc, 'btc')), + dollars: createBlockCountPattern(client, _m(acc, 'usd')), sats: createBlockCountPattern(client, acc), }; } @@ -3605,9 +3064,9 @@ function createUnclaimedRewardsPattern(client, acc) { */ 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")), + max: createMetricPattern1(client, _m(acc, 'max_cost_basis')), + min: createMetricPattern1(client, _m(acc, 'min_cost_basis')), + percentiles: createPercentilesPattern2(client, _m(acc, 'cost_basis')), }; } @@ -3626,9 +3085,9 @@ function createCostBasisPattern2(client, acc) { */ function createSegwitAdoptionPattern(client, acc) { return { - cumulative: createMetricPattern2(client, _m(acc, "cumulative")), + cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), height: createMetricPattern12(client, acc), - sum: createMetricPattern2(client, _m(acc, "sum")), + sum: createMetricPattern2(client, _m(acc, 'sum')), }; } @@ -3646,27 +3105,8 @@ function createSegwitAdoptionPattern(client, acc) { */ function createSatsPattern(client, acc) { return { - 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), + ohlc: createOhlcPattern(client, _m(acc, 'ohlc_sats')), + split: createSplitPattern2(client, _m(acc, 'sats')), }; } @@ -3684,8 +3124,8 @@ function createSupplyPattern2(client, acc) { */ function createCostBasisPattern(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')), }; } @@ -3703,8 +3143,27 @@ function createCostBasisPattern(client, acc) { */ function create_1dReturns1mSdPattern(client, acc) { return { - sd: createMetricPattern4(client, _m(acc, "sd")), - sma: createMetricPattern4(client, _m(acc, "sma")), + sd: createMetricPattern4(client, _m(acc, 'sd')), + sma: createMetricPattern4(client, _m(acc, 'sma')), + }; +} + +/** + * @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), }; } @@ -3722,21 +3181,15 @@ function create_1dReturns1mSdPattern(client, acc) { */ 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"), - ), + supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'loss_rel_to_own_supply')), + supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'profit_rel_to_own_supply')), }; } /** * @template T * @typedef {Object} BlockCountPattern - * @property {MetricPattern1} cumulative + * @property {MetricPattern2} cumulative * @property {MetricPattern1} sum */ @@ -3749,28 +3202,11 @@ function createRelativePattern4(client, acc) { */ function createBlockCountPattern(client, acc) { return { - cumulative: createMetricPattern1(client, _m(acc, "cumulative")), + cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), sum: createMetricPattern1(client, acc), }; } -/** - * @typedef {Object} OutputsPattern - * @property {MetricPattern1} utxoCount - */ - -/** - * Create a OutputsPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {OutputsPattern} - */ -function createOutputsPattern(client, acc) { - return { - utxoCount: createMetricPattern1(client, _m(acc, "utxo_count")), - }; -} - /** * @typedef {Object} RealizedPriceExtraPattern * @property {MetricPattern4} ratio @@ -3784,7 +3220,24 @@ function createOutputsPattern(client, acc) { */ function createRealizedPriceExtraPattern(client, acc) { return { - ratio: createMetricPattern4(client, _m(acc, "ratio")), + ratio: createMetricPattern4(client, _m(acc, 'ratio')), + }; +} + +/** + * @typedef {Object} OutputsPattern + * @property {MetricPattern1} utxoCount + */ + +/** + * Create a OutputsPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {OutputsPattern} + */ +function createOutputsPattern(client, acc) { + return { + utxoCount: createMetricPattern1(client, _m(acc, 'utxo_count')), }; } @@ -5041,868 +4494,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", - }, - short: { - id: "sth", - long: "Short Term Holders", - short: "STH", + "long": { + "id": "lth", + "long": "Long Term Holders", + "short": "LTH" }, + "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", - }, - _4: { - id: "epoch_4", - long: "Epoch 4", - short: "Epoch 4", + "_3": { + "id": "epoch_3", + "long": "Epoch 3", + "short": "Epoch 3" }, + "_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", - }, - _2026: { - id: "year_2026", - long: "Year 2026", - short: "2026", + "_2025": { + "id": "year_2025", + "long": "Year 2025", + "short": "2025" }, + "_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", - }, - unknown: { - id: "unknown_outputs", - long: "Unknown Output Type", - short: "Unknown", + "p2wsh": { + "id": "p2wsh", + "long": "Pay to Witness Script Hash", + "short": "P2WSH" }, + "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+", - }, - upTo1h: { - id: "up_to_1h_old", - long: "Up to 1 Hour Old", - short: "<1h", + "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" + } }); 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", - }, - _8y: { - id: "up_to_8y_old", - long: "Up to 8 Years Old", - short: "<8y", + "_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" + } }); 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+", - }, - _8y: { - id: "at_least_8y_old", - long: "At Least 8 Years Old", - short: "8y+", + "_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+" + } }); 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", - }, - _1satTo10sats: { - id: "above_1sat_under_10sats", - long: "1 to 10 Sats", - short: "1-10 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" + } }); 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", - }, - _1sat: { - id: "above_1sat", - long: "Above 1 Sat", - short: "1+ sats", + "_1mSats": { + "id": "above_1m_sats", + "long": "Above 1M Sats", + "short": "1M+ 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", - }, - _1mSats: { - id: "under_1m_sats", - long: "Under 1M Sats", - short: "<1M 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" + } }); /** @@ -5911,7 +5364,7 @@ class BrkClient extends BrkClientBase { constructor(options) { super(options); /** @type {CatalogTree} */ - this.tree = this._buildTree(""); + this.tree = this._buildTree(''); } /** @@ -5922,1266 +5375,939 @@ 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) { @@ -7191,41 +6317,39 @@ 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) { @@ -7235,7 +6359,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) { @@ -7245,7 +6369,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) { @@ -7255,7 +6379,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) { @@ -7265,7 +6389,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) { @@ -7275,7 +6399,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) { @@ -7296,7 +6420,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) { @@ -7326,7 +6450,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) { @@ -7354,7 +6478,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) { @@ -7374,14 +6498,12 @@ 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 : ''}`); } /** @@ -7397,14 +6519,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 : ''}`); } /** @@ -7442,29 +6564,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) { @@ -7474,7 +6596,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) { @@ -7495,7 +6617,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) { @@ -7505,7 +6627,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) { @@ -7542,7 +6664,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) { @@ -7552,7 +6674,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) { @@ -7562,7 +6684,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) { @@ -7572,7 +6694,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) { @@ -7591,7 +6713,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) { @@ -7610,7 +6732,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) { @@ -7620,7 +6742,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) { @@ -7639,7 +6761,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) { @@ -7683,6 +6805,7 @@ 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 fc9042492..1f17db017 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -1951,31 +1951,6 @@ class Price111dSmaPattern: self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct99_usd')) self.ratio_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio')) -class ActivePriceRatioPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, acc) - self.ratio_1m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, '1m_sma')) - self.ratio_1w_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, '1w_sma')) - self.ratio_1y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '1y')) - self.ratio_2y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '2y')) - self.ratio_4y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '4y')) - self.ratio_pct1: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct1')) - self.ratio_pct1_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct1_usd')) - self.ratio_pct2: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct2')) - self.ratio_pct2_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct2_usd')) - self.ratio_pct5: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct5')) - self.ratio_pct5_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct5_usd')) - self.ratio_pct95: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct95')) - self.ratio_pct95_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct95_usd')) - self.ratio_pct98: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct98')) - self.ratio_pct98_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct98_usd')) - self.ratio_pct99: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct99')) - self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct99_usd')) - self.ratio_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, acc) - class PercentilesPattern2: """Pattern struct for repeated tree structure.""" @@ -2001,6 +1976,31 @@ class PercentilesPattern2: self.cost_basis_pct90: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct90')) self.cost_basis_pct95: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct95')) +class ActivePriceRatioPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, acc) + self.ratio_1m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, '1m_sma')) + self.ratio_1w_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, '1w_sma')) + self.ratio_1y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '1y')) + self.ratio_2y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '2y')) + self.ratio_4y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '4y')) + self.ratio_pct1: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct1')) + self.ratio_pct1_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct1_usd')) + self.ratio_pct2: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct2')) + self.ratio_pct2_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct2_usd')) + self.ratio_pct5: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct5')) + self.ratio_pct5_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct5_usd')) + self.ratio_pct95: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct95')) + self.ratio_pct95_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct95_usd')) + self.ratio_pct98: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct98')) + self.ratio_pct98_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct98_usd')) + self.ratio_pct99: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct99')) + self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct99_usd')) + self.ratio_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, acc) + class RelativePattern5: """Pattern struct for repeated tree structure.""" @@ -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 RelativePattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) - self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) - self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) - self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) - class RelativePattern: """Pattern struct for repeated tree structure.""" @@ -2149,6 +2133,22 @@ class RelativePattern: self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) +class RelativePattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) + self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) + self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) + self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) + self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) + class AddrCountPattern: """Pattern struct for repeated tree structure.""" @@ -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 FeeRatePattern(Generic[T]): - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) - self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max')) - self.median: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'median')) - self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min')) - self.pct10: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct10')) - self.pct25: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct25')) - self.pct75: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct75')) - self.pct90: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct90')) - self.txindex: MetricPattern28[T] = MetricPattern28(client, acc) - class OhlcPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2194,6 +2179,21 @@ class OhlcPattern(Generic[T]): self.week: MetricPattern30[T] = MetricPattern30(client, acc) self.year: MetricPattern31[T] = MetricPattern31(client, acc) +class FeeRatePattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) + self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max')) + self.median: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'median')) + self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min')) + self.pct10: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct10')) + self.pct25: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct25')) + self.pct75: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct75')) + self.pct90: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct90')) + self.txindex: MetricPattern28[T] = MetricPattern28(client, acc) + class _0satsPattern: """Pattern struct for repeated tree structure.""" @@ -2208,7 +2208,7 @@ class _0satsPattern: self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) -class _0satsPattern2: +class _10yPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2216,33 +2216,7 @@ class _0satsPattern2: 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.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss')) - self.net_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl')) - self.supply_in_loss: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'supply_in_loss')) - self.supply_in_profit: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'supply_in_profit')) - self.total_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_unrealized_pnl')) - self.unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_loss')) - self.unrealized_profit: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_profit')) - -class _100btcPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.outputs: OutputsPattern = OutputsPattern(client, acc) - self.realized: RealizedPattern = RealizedPattern(client, acc) + self.realized: RealizedPattern4 = RealizedPattern4(client, acc) self.relative: RelativePattern = RelativePattern(client, acc) self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) @@ -2260,7 +2234,7 @@ class _10yTo12yPattern: self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) -class _10yPattern: +class _0satsPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2268,11 +2242,37 @@ class _10yPattern: self.activity: ActivityPattern2 = ActivityPattern2(client, acc) self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) self.outputs: OutputsPattern = OutputsPattern(client, acc) - self.realized: RealizedPattern4 = RealizedPattern4(client, acc) + self.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 _100btcPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) + self.realized: RealizedPattern = RealizedPattern(client, acc) self.relative: RelativePattern = RelativePattern(client, acc) self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) +class UnrealizedPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.neg_unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss')) + self.net_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl')) + self.supply_in_loss: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'supply_in_loss')) + self.supply_in_profit: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'supply_in_profit')) + self.total_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_unrealized_pnl')) + self.unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_loss')) + self.unrealized_profit: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_profit')) + class PeriodCagrPattern: """Pattern struct for repeated tree structure.""" @@ -2292,7 +2292,7 @@ class BitcoinPattern(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.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative')) + self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) self.height: MetricPattern12[T] = MetricPattern12(client, acc) self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max')) self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min')) @@ -2416,14 +2416,6 @@ 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.""" @@ -2440,6 +2432,14 @@ class _1dReturns1mSdPattern: self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd')) self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma')) +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 RelativePattern4: """Pattern struct for repeated tree structure.""" @@ -2453,16 +2453,9 @@ class BlockCountPattern(Generic[T]): def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) + self.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative')) self.sum: MetricPattern1[T] = MetricPattern1(client, acc) -class OutputsPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'utxo_count')) - class RealizedPriceExtraPattern: """Pattern struct for repeated tree structure.""" @@ -2470,6 +2463,13 @@ class RealizedPriceExtraPattern: """Create pattern node with accumulated metric name.""" self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio')) +class OutputsPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'utxo_count')) + class EmptyPattern(Generic[T]): """Pattern struct for repeated tree structure.""" diff --git a/websites/bitview/index.html b/websites/bitview/index.html index 02aa58c62..0e5df449c 100644 --- a/websites/bitview/index.html +++ b/websites/bitview/index.html @@ -1558,12 +1558,12 @@ - + - - + + @@ -1575,22 +1575,22 @@ - + - + - + - + - + - + @@ -1603,7 +1603,7 @@ - + @@ -1628,12 +1628,12 @@