diff --git a/crates/brk_computer/src/vecs/cointime.rs b/crates/brk_computer/src/vecs/cointime.rs new file mode 100644 index 000000000..641177395 --- /dev/null +++ b/crates/brk_computer/src/vecs/cointime.rs @@ -0,0 +1,681 @@ +use std::{fs, path::Path}; + +use brk_core::{Bitcoin, CheckedSub, Dollars, StoredF64, Version}; +use brk_exit::Exit; +use brk_indexer::Indexer; +use brk_vec::{AnyCollectableVec, Computation, Format, VecIterator}; + +use crate::vecs::{ + fetched, + grouped::{ComputedRatioVecsFromDateIndex, ComputedValueVecsFromHeight}, + stateful, transactions, +}; + +use super::{ + Indexes, + grouped::{ComputedVecsFromHeight, StorableVecGeneatorOptions}, + indexes, +}; + +const VERSION: Version = Version::ZERO; + +#[derive(Clone)] +pub struct Vecs { + pub indexes_to_coinblocks_created: ComputedVecsFromHeight, + pub indexes_to_coinblocks_stored: ComputedVecsFromHeight, + pub indexes_to_liveliness: ComputedVecsFromHeight, + pub indexes_to_vaultedness: ComputedVecsFromHeight, + pub indexes_to_activity_to_vaultedness_ratio: ComputedVecsFromHeight, + pub indexes_to_vaulted_supply: ComputedValueVecsFromHeight, + pub indexes_to_active_supply: ComputedValueVecsFromHeight, + pub indexes_to_thermo_cap: ComputedVecsFromHeight, + pub indexes_to_investor_cap: ComputedVecsFromHeight, + pub indexes_to_vaulted_cap: ComputedVecsFromHeight, + pub indexes_to_active_cap: ComputedVecsFromHeight, + pub indexes_to_vaulted_price: ComputedVecsFromHeight, + pub indexes_to_vaulted_price_ratio: ComputedRatioVecsFromDateIndex, + pub indexes_to_active_price: ComputedVecsFromHeight, + pub indexes_to_active_price_ratio: ComputedRatioVecsFromDateIndex, + pub indexes_to_true_market_mean: ComputedVecsFromHeight, + pub indexes_to_true_market_mean_ratio: ComputedRatioVecsFromDateIndex, + pub indexes_to_cointime_value_destroyed: ComputedVecsFromHeight, + pub indexes_to_cointime_value_created: ComputedVecsFromHeight, + pub indexes_to_cointime_value_stored: ComputedVecsFromHeight, + pub indexes_to_cointime_price: ComputedVecsFromHeight, + pub indexes_to_cointime_cap: ComputedVecsFromHeight, + pub indexes_to_cointime_price_ratio: ComputedRatioVecsFromDateIndex, + // pub indexes_to_thermo_cap_relative_to_investor_cap: ComputedValueVecsFromHeight, +} + +impl Vecs { + pub fn forced_import( + path: &Path, + version: Version, + _computation: Computation, + format: Format, + fetched: Option<&fetched::Vecs>, + ) -> color_eyre::Result { + let compute_dollars = fetched.is_some(); + + fs::create_dir_all(path)?; + + Ok(Self { + indexes_to_coinblocks_created: ComputedVecsFromHeight::forced_import( + path, + "coinblocks_created", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default() + .add_sum() + .add_cumulative(), + )?, + indexes_to_coinblocks_stored: ComputedVecsFromHeight::forced_import( + path, + "coinblocks_stored", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default() + .add_sum() + .add_cumulative(), + )?, + indexes_to_liveliness: ComputedVecsFromHeight::forced_import( + path, + "liveliness", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_vaultedness: ComputedVecsFromHeight::forced_import( + path, + "vaultedness", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_activity_to_vaultedness_ratio: ComputedVecsFromHeight::forced_import( + path, + "activity_to_vaultedness_ratio", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_vaulted_supply: ComputedValueVecsFromHeight::forced_import( + path, + "vaulted_supply", + true, + version + VERSION + Version::ONE, + format, + StorableVecGeneatorOptions::default().add_last(), + compute_dollars, + )?, + indexes_to_active_supply: ComputedValueVecsFromHeight::forced_import( + path, + "active_supply", + true, + version + VERSION + Version::ONE, + format, + StorableVecGeneatorOptions::default().add_last(), + compute_dollars, + )?, + indexes_to_thermo_cap: ComputedVecsFromHeight::forced_import( + path, + "thermo_cap", + true, + version + VERSION + Version::ONE, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_investor_cap: ComputedVecsFromHeight::forced_import( + path, + "investor_cap", + true, + version + VERSION + Version::ONE, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_vaulted_cap: ComputedVecsFromHeight::forced_import( + path, + "vaulted_cap", + true, + version + VERSION + Version::ONE, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_active_cap: ComputedVecsFromHeight::forced_import( + path, + "active_cap", + true, + version + VERSION + Version::ONE, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_vaulted_price: ComputedVecsFromHeight::forced_import( + path, + "vaulted_price", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_vaulted_price_ratio: ComputedRatioVecsFromDateIndex::forced_import( + path, + "vaulted_price", + false, + version + VERSION + Version::ZERO, + format, + )?, + indexes_to_active_price: ComputedVecsFromHeight::forced_import( + path, + "active_price", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_active_price_ratio: ComputedRatioVecsFromDateIndex::forced_import( + path, + "active_price", + false, + version + VERSION + Version::ZERO, + format, + )?, + indexes_to_true_market_mean: ComputedVecsFromHeight::forced_import( + path, + "true_market_mean", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_true_market_mean_ratio: ComputedRatioVecsFromDateIndex::forced_import( + path, + "true_market_mean", + false, + version + VERSION + Version::ZERO, + format, + )?, + indexes_to_cointime_value_destroyed: ComputedVecsFromHeight::forced_import( + path, + "cointime_value_destroyed", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default() + .add_sum() + .add_cumulative(), + )?, + indexes_to_cointime_value_created: ComputedVecsFromHeight::forced_import( + path, + "cointime_value_created", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default() + .add_sum() + .add_cumulative(), + )?, + indexes_to_cointime_value_stored: ComputedVecsFromHeight::forced_import( + path, + "cointime_value_stored", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default() + .add_sum() + .add_cumulative(), + )?, + indexes_to_cointime_price: ComputedVecsFromHeight::forced_import( + path, + "cointime_price", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_cointime_cap: ComputedVecsFromHeight::forced_import( + path, + "cointime_cap", + true, + version + VERSION + Version::ZERO, + format, + StorableVecGeneatorOptions::default().add_last(), + )?, + indexes_to_cointime_price_ratio: ComputedRatioVecsFromDateIndex::forced_import( + path, + "cointime_price", + false, + version + VERSION + Version::ZERO, + format, + )?, + }) + } + + #[allow(clippy::too_many_arguments)] + pub fn compute( + &mut self, + indexer: &Indexer, + indexes: &indexes::Vecs, + starting_indexes: &Indexes, + fetched: Option<&fetched::Vecs>, + transactions: &transactions::Vecs, + stateful: &stateful::Vecs, + exit: &Exit, + ) -> color_eyre::Result<()> { + let circulating_supply = &stateful.utxos_vecs.all.1.height_to_supply; + + self.indexes_to_coinblocks_created.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_transform( + starting_indexes.height, + circulating_supply, + |(i, v, ..)| (i, StoredF64::from(Bitcoin::from(v))), + exit, + ) + }, + )?; + + let indexes_to_coinblocks_destroyed = + &stateful.utxos_vecs.all.1.indexes_to_coinblocks_destroyed; + + self.indexes_to_coinblocks_stored.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + let mut coinblocks_destroyed_iter = indexes_to_coinblocks_destroyed + .height + .as_ref() + .unwrap() + .into_iter(); + vec.compute_transform( + starting_indexes.height, + self.indexes_to_coinblocks_created.height.as_ref().unwrap(), + |(i, created, ..)| { + let destroyed = coinblocks_destroyed_iter.unwrap_get_inner(i); + (i, created.checked_sub(destroyed).unwrap()) + }, + exit, + ) + }, + )?; + + self.indexes_to_liveliness.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_divide( + starting_indexes.height, + indexes_to_coinblocks_destroyed + .height_extra + .unwrap_cumulative(), + self.indexes_to_coinblocks_created + .height_extra + .unwrap_cumulative(), + exit, + ) + }, + )?; + let liveliness = &self.indexes_to_liveliness; + + self.indexes_to_vaultedness.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_transform( + starting_indexes.height, + liveliness.height.as_ref().unwrap(), + |(i, v, ..)| (i, StoredF64::from(1.0).checked_sub(v).unwrap()), + exit, + ) + }, + )?; + let vaultedness = &self.indexes_to_vaultedness; + + self.indexes_to_activity_to_vaultedness_ratio.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_divide( + starting_indexes.height, + liveliness.height.as_ref().unwrap(), + vaultedness.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_vaulted_supply.compute_all( + indexer, + indexes, + fetched, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_multiply( + starting_indexes.height, + circulating_supply, + vaultedness.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_active_supply.compute_all( + indexer, + indexes, + fetched, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_multiply( + starting_indexes.height, + circulating_supply, + liveliness.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + if let Some(fetched) = fetched { + let realized_cap = stateful + .utxos_vecs + .all + .1 + .height_to_realized_cap + .as_ref() + .unwrap(); + + let realized_price = stateful + .utxos_vecs + .all + .1 + .indexes_to_realized_price + .as_ref() + .unwrap() + .height + .as_ref() + .unwrap(); + + self.indexes_to_thermo_cap.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_transform( + starting_indexes.height, + transactions + .indexes_to_subsidy + .dollars + .as_ref() + .unwrap() + .height_extra + .unwrap_cumulative(), + |(i, v, ..)| (i, v), + exit, + ) + }, + )?; + + self.indexes_to_investor_cap.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_subtract( + starting_indexes.height, + realized_cap, + self.indexes_to_thermo_cap.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_vaulted_cap.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_divide( + starting_indexes.height, + realized_cap, + self.indexes_to_vaultedness.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_active_cap.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_multiply( + starting_indexes.height, + realized_cap, + self.indexes_to_liveliness.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_vaulted_price.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_divide( + starting_indexes.height, + realized_price, + self.indexes_to_vaultedness.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_vaulted_price_ratio.compute_rest( + indexer, + indexes, + fetched, + starting_indexes, + exit, + Some(self.indexes_to_vaulted_price.dateindex.unwrap_last()), + )?; + + self.indexes_to_active_price.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_multiply( + starting_indexes.height, + realized_price, + self.indexes_to_liveliness.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_active_price_ratio.compute_rest( + indexer, + indexes, + fetched, + starting_indexes, + exit, + Some(self.indexes_to_active_price.dateindex.unwrap_last()), + )?; + + self.indexes_to_true_market_mean.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_divide( + starting_indexes.height, + self.indexes_to_investor_cap.height.as_ref().unwrap(), + self.indexes_to_active_supply + .bitcoin + .height + .as_ref() + .unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_true_market_mean_ratio.compute_rest( + indexer, + indexes, + fetched, + starting_indexes, + exit, + Some(self.indexes_to_true_market_mean.dateindex.unwrap_last()), + )?; + + self.indexes_to_cointime_value_destroyed.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + // TODO: Another example when the callback should be applied to each index, instead of to base then merging from more granular to less + // The price taken won't be correct for time based indexes + vec.compute_multiply( + starting_indexes.height, + &fetched.chainindexes_to_close.height, + indexes_to_coinblocks_destroyed.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_cointime_value_created.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_multiply( + starting_indexes.height, + &fetched.chainindexes_to_close.height, + self.indexes_to_coinblocks_created.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_cointime_value_stored.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_multiply( + starting_indexes.height, + &fetched.chainindexes_to_close.height, + self.indexes_to_coinblocks_stored.height.as_ref().unwrap(), + exit, + ) + }, + )?; + + self.indexes_to_cointime_price.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_divide( + starting_indexes.height, + self.indexes_to_cointime_value_destroyed + .height_extra + .unwrap_cumulative(), + self.indexes_to_coinblocks_stored + .height_extra + .unwrap_cumulative(), + exit, + ) + }, + )?; + + self.indexes_to_cointime_cap.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, _, starting_indexes, exit| { + vec.compute_multiply( + starting_indexes.height, + self.indexes_to_cointime_price.height.as_ref().unwrap(), + circulating_supply, + exit, + ) + }, + )?; + + self.indexes_to_cointime_price_ratio.compute_rest( + indexer, + indexes, + fetched, + starting_indexes, + exit, + Some(self.indexes_to_cointime_price.dateindex.unwrap_last()), + )?; + } + + Ok(()) + } + + pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> { + [ + self.indexes_to_coinblocks_created.vecs(), + self.indexes_to_coinblocks_stored.vecs(), + self.indexes_to_liveliness.vecs(), + self.indexes_to_vaultedness.vecs(), + self.indexes_to_activity_to_vaultedness_ratio.vecs(), + self.indexes_to_vaulted_supply.vecs(), + self.indexes_to_active_supply.vecs(), + self.indexes_to_thermo_cap.vecs(), + self.indexes_to_investor_cap.vecs(), + self.indexes_to_vaulted_cap.vecs(), + self.indexes_to_active_cap.vecs(), + self.indexes_to_vaulted_price.vecs(), + self.indexes_to_vaulted_price_ratio.vecs(), + self.indexes_to_active_price.vecs(), + self.indexes_to_active_price_ratio.vecs(), + self.indexes_to_true_market_mean.vecs(), + self.indexes_to_true_market_mean_ratio.vecs(), + self.indexes_to_cointime_price.vecs(), + self.indexes_to_cointime_cap.vecs(), + self.indexes_to_cointime_price_ratio.vecs(), + self.indexes_to_cointime_value_destroyed.vecs(), + self.indexes_to_cointime_value_created.vecs(), + self.indexes_to_cointime_value_stored.vecs(), + ] + .into_iter() + .flatten() + .collect::>() + } +} diff --git a/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs b/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs index c6aaf178e..903a15add 100644 --- a/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs +++ b/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs @@ -65,8 +65,9 @@ impl ComputedRatioVecsFromDateIndex { compute_source: bool, version: Version, format: Format, - options: StorableVecGeneatorOptions, ) -> color_eyre::Result { + let options = StorableVecGeneatorOptions::default().add_last(); + Ok(Self { price: compute_source.then(|| { ComputedVecsFromDateIndex::forced_import( diff --git a/crates/brk_computer/src/vecs/market.rs b/crates/brk_computer/src/vecs/market.rs index 6b2cb01b7..e1d002b39 100644 --- a/crates/brk_computer/src/vecs/market.rs +++ b/crates/brk_computer/src/vecs/market.rs @@ -244,7 +244,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_8d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -252,7 +251,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_13d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -260,7 +258,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_21d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -268,7 +265,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_1m_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -276,7 +272,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_34d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -284,7 +279,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_55d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -292,7 +286,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_89d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -300,7 +293,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_144d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -308,7 +300,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_200d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -316,7 +307,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_1y_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -324,7 +314,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_2y_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -332,7 +321,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_200w_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -340,7 +328,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, indexes_to_4y_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -348,7 +335,6 @@ impl Vecs { true, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), )?, _1d_returns: ComputedVecsFromDateIndex::forced_import( diff --git a/crates/brk_computer/src/vecs/mod.rs b/crates/brk_computer/src/vecs/mod.rs index ab60aee42..5a65c91b8 100644 --- a/crates/brk_computer/src/vecs/mod.rs +++ b/crates/brk_computer/src/vecs/mod.rs @@ -7,6 +7,7 @@ use brk_indexer::Indexer; use brk_vec::{AnyCollectableVec, Computation, Format}; pub mod blocks; +pub mod cointime; pub mod constants; pub mod fetched; pub mod grouped; @@ -31,6 +32,7 @@ pub struct Vecs { pub transactions: transactions::Vecs, pub stateful: stateful::Vecs, pub fetched: Option, + pub cointime: cointime::Vecs, } impl Vecs { @@ -112,6 +114,13 @@ impl Vecs { format, fetched.as_ref(), )?, + cointime: cointime::Vecs::forced_import( + path, + version + VERSION + Version::ZERO, + computation, + format, + fetched.as_ref(), + )?, indexes, fetched, }) @@ -125,7 +134,7 @@ impl Vecs { exit: &Exit, ) -> color_eyre::Result<()> { info!("Computing indexes..."); - let starting_indexes = self.indexes.compute(indexer, starting_indexes, exit)?; + let mut starting_indexes = self.indexes.compute(indexer, starting_indexes, exit)?; info!("Computing constants..."); self.constants @@ -178,7 +187,17 @@ impl Vecs { &self.transactions, self.fetched.as_ref(), &self.market, - starting_indexes, + &mut starting_indexes, + exit, + )?; + + self.cointime.compute( + indexer, + &self.indexes, + &starting_indexes, + self.fetched.as_ref(), + &self.transactions, + &self.stateful, exit, )?; @@ -194,6 +213,7 @@ impl Vecs { self.market.vecs(), self.transactions.vecs(), self.stateful.vecs(), + self.cointime.vecs(), self.fetched.as_ref().map_or(vec![], |v| v.vecs()), ] .into_iter() diff --git a/crates/brk_computer/src/vecs/stateful/cohort.rs b/crates/brk_computer/src/vecs/stateful/cohort.rs index 3c8aa796e..00477cc94 100644 --- a/crates/brk_computer/src/vecs/stateful/cohort.rs +++ b/crates/brk_computer/src/vecs/stateful/cohort.rs @@ -422,7 +422,6 @@ impl Vecs { false, version + VERSION + Version::ZERO, format, - StorableVecGeneatorOptions::default().add_last(), ) .unwrap() }), diff --git a/crates/brk_computer/src/vecs/stateful/mod.rs b/crates/brk_computer/src/vecs/stateful/mod.rs index f5f2b71fc..abab21196 100644 --- a/crates/brk_computer/src/vecs/stateful/mod.rs +++ b/crates/brk_computer/src/vecs/stateful/mod.rs @@ -39,7 +39,7 @@ pub struct Vecs { pub indexes_to_unspendable_supply: ComputedValueVecsFromHeight, pub height_to_opreturn_supply: EagerVec, pub indexes_to_opreturn_supply: ComputedValueVecsFromHeight, - utxos_vecs: Outputs<(OutputFilter, cohort::Vecs)>, + pub utxos_vecs: Outputs<(OutputFilter, cohort::Vecs)>, } impl Vecs { @@ -1202,7 +1202,7 @@ impl Vecs { fetched: Option<&fetched::Vecs>, market: &market::Vecs, // Must take ownership as its indexes will be updated for this specific function - mut starting_indexes: Indexes, + starting_indexes: &mut Indexes, exit: &Exit, ) -> color_eyre::Result<()> { let indexer_vecs = indexer.vecs(); @@ -1601,7 +1601,7 @@ impl Vecs { info!("Computing overlapping..."); self.utxos_vecs - .compute_overlapping_vecs(&starting_indexes, exit)?; + .compute_overlapping_vecs(starting_indexes, exit)?; info!("Computing rest part 1..."); @@ -1609,7 +1609,7 @@ impl Vecs { .as_mut_vecs() .par_iter_mut() .try_for_each(|(_, v)| { - v.compute_rest_part1(indexer, indexes, fetched, &starting_indexes, exit) + v.compute_rest_part1(indexer, indexes, fetched, starting_indexes, exit) })?; info!("Computing rest part 2..."); @@ -1640,7 +1640,7 @@ impl Vecs { indexer, indexes, fetched, - &starting_indexes, + starting_indexes, market, &height_to_supply, dateindex_to_supply.as_ref().unwrap(), @@ -1653,7 +1653,7 @@ impl Vecs { indexer, indexes, fetched, - &starting_indexes, + starting_indexes, exit, Some(&self.height_to_unspendable_supply), )?; @@ -1661,7 +1661,7 @@ impl Vecs { indexer, indexes, fetched, - &starting_indexes, + starting_indexes, exit, Some(&self.height_to_opreturn_supply), )?; diff --git a/crates/brk_core/src/structs/dollars.rs b/crates/brk_core/src/structs/dollars.rs index 024050b41..0cbb62303 100644 --- a/crates/brk_core/src/structs/dollars.rs +++ b/crates/brk_core/src/structs/dollars.rs @@ -139,6 +139,24 @@ impl Div for Dollars { } } +impl Div for Dollars { + type Output = Self; + fn div(self, rhs: StoredF64) -> Self::Output { + self / f64::from(rhs) + } +} + +impl Div for Dollars { + type Output = Self; + fn div(self, rhs: f64) -> Self::Output { + if self.is_nan() || rhs == 0.0 { + Dollars::NAN + } else { + Dollars::from(Cents::from(Self::from(self.0 / rhs))) + } + } +} + impl Div for Dollars { type Output = Self; fn div(self, rhs: Bitcoin) -> Self::Output { @@ -178,6 +196,13 @@ impl Mul for Close { } } +impl Mul for Close { + type Output = Dollars; + fn mul(self, rhs: StoredF64) -> Self::Output { + *self * rhs + } +} + impl Mul for Dollars { type Output = Dollars; fn mul(self, rhs: f64) -> Self::Output { diff --git a/crates/brk_core/src/structs/ohlc.rs b/crates/brk_core/src/structs/ohlc.rs index bc3db0e82..7afaceda2 100644 --- a/crates/brk_core/src/structs/ohlc.rs +++ b/crates/brk_core/src/structs/ohlc.rs @@ -524,3 +524,13 @@ where Self(self.0 / rhs) } } + +// impl Mul for Close +// where +// T: Mul, +// { +// type Output = Self; +// fn mul(self, rhs: usize) -> Self::Output { +// Self(self.0 * rhs) +// } +// } diff --git a/crates/brk_core/src/structs/sats.rs b/crates/brk_core/src/structs/sats.rs index 68236504c..129be399b 100644 --- a/crates/brk_core/src/structs/sats.rs +++ b/crates/brk_core/src/structs/sats.rs @@ -9,7 +9,7 @@ use byteview::ByteView; use serde::{Deserialize, Serialize}; use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout}; -use crate::{CheckedSub, copy_first_8bytes}; +use crate::{CheckedSub, StoredF64, copy_first_8bytes}; use super::{Bitcoin, Cents, Dollars, Height}; @@ -112,6 +112,13 @@ impl Mul for Sats { } } +impl Mul for Sats { + type Output = Self; + fn mul(self, rhs: StoredF64) -> Self::Output { + Sats::from((self.0 as f64 * f64::from(rhs)) as u64) + } +} + impl Sum for Sats { fn sum>(iter: I) -> Self { let sats: u64 = iter.map(|sats| sats.0).sum(); diff --git a/crates/brk_core/src/structs/stored_f64.rs b/crates/brk_core/src/structs/stored_f64.rs index 778f83bd2..d9e0b6cf2 100644 --- a/crates/brk_core/src/structs/stored_f64.rs +++ b/crates/brk_core/src/structs/stored_f64.rs @@ -51,6 +51,13 @@ impl Div for StoredF64 { } } +impl Div for StoredF64 { + type Output = Self; + fn div(self, rhs: Self) -> Self::Output { + Self(self.0 / rhs.0) + } +} + impl Add for StoredF64 { type Output = Self; fn add(self, rhs: Self) -> Self::Output { diff --git a/crates/brk_query/src/vec_trees.rs b/crates/brk_query/src/vec_trees.rs index 03a7456b8..448366e3a 100644 --- a/crates/brk_query/src/vec_trees.rs +++ b/crates/brk_query/src/vec_trees.rs @@ -26,6 +26,7 @@ impl<'a> VecTrees<'a> { || s == &"cumulative_up" || s.starts_with("cumulative_start") || s.starts_with("cumulative_from") + || s == &"activity" })) && !(split.len() == 4 && split.get(1).is_some_and(|s| { diff --git a/websites/default/scripts/main.js b/websites/default/scripts/main.js index 9b69f7e73..f921e3cb4 100644 --- a/websites/default/scripts/main.js +++ b/websites/default/scripts/main.js @@ -744,12 +744,14 @@ function createUtils() { id === "open" || id === "marketcap" || id.includes("in-usd") || + id.includes("cointime-value") || id.startsWith("price") || id.endsWith("price-paid") || id.endsWith("price") || + (id.endsWith("-cap") && !id.includes("relative-to")) || id.endsWith("value-created") || id.endsWith("value-destroyed") || - (id.includes("realized") && + ((id.includes("realized") || id.includes("true-market-mean")) && !id.includes("ratio") && !id.includes("relative-to")) || ((id.endsWith("sma") || id.includes("sma-x")) && @@ -764,18 +766,20 @@ function createUtils() { unit = "Cents"; } if ( - (!unit || thoroughUnitCheck) && - (id.endsWith("ratio") || - (id.includes("ratio") && id.endsWith("sma")) || - id.endsWith("1sd") || - id.endsWith("2sd") || - id.endsWith("3sd") || - id.endsWith("p0-1") || - id.endsWith("p0-5") || - id.endsWith("p1") || - id.endsWith("p99") || - id.endsWith("p99-5") || - id.endsWith("p99-9")) + ((!unit || thoroughUnitCheck) && + (id.endsWith("ratio") || + (id.includes("ratio") && id.endsWith("sma")) || + id.endsWith("1sd") || + id.endsWith("2sd") || + id.endsWith("3sd") || + id.endsWith("p0-1") || + id.endsWith("p0-5") || + id.endsWith("p1") || + id.endsWith("p99") || + id.endsWith("p99-5") || + id.endsWith("p99-9"))) || + id.includes("liveliness") || + id.includes("vaultedness") ) { if (unit) throw Error(`Unit "${unit}" already assigned "${id}"`); unit = "Ratio"; diff --git a/websites/default/scripts/options.js b/websites/default/scripts/options.js index 44f7dcddf..3076f9022 100644 --- a/websites/default/scripts/options.js +++ b/websites/default/scripts/options.js @@ -210,7 +210,7 @@ function createPartialOptions(colors) { }, ]); - const upTo = /** @type {const} */ ([ + const upToDate = /** @type {const} */ ([ { key: "up-to-1d", name: "1d", @@ -321,7 +321,7 @@ function createPartialOptions(colors) { }, ]); - const from = /** @type {const} */ ([ + const fromDate = /** @type {const} */ ([ { key: "from-1d", name: "1d", @@ -432,7 +432,7 @@ function createPartialOptions(colors) { }, ]); - const range = /** @type {const} */ ([ + const dateRange = /** @type {const} */ ([ { key: "start-to-1d", name: "24h", @@ -804,6 +804,66 @@ function createPartialOptions(colors) { }, ]); + const cointimePrices = /** @type {const} */ ([ + { + key: `vaulted-price`, + name: "Vaulted", + title: "Vaulted Price", + color: colors.lime, + }, + { + key: `active-price`, + name: "Active", + title: "Active Price", + color: colors.rose, + }, + { + key: `true-market-mean`, + name: "True market mean", + title: "True market mean", + color: colors.blue, + }, + { + key: `cointime-price`, + name: "cointime", + title: "Cointime Price", + color: colors.yellow, + }, + ]); + + const cointimeCapitalizations = /** @type {const} */ ([ + { + key: `thermo-cap`, + name: "Thermo", + title: "Thermo Capitalization", + color: colors.emerald, + }, + { + key: `investor-cap`, + name: "Investor", + title: "Investor Capitalization", + color: colors.fuchsia, + }, + { + key: `active-cap`, + name: "Active", + title: "Active Capitalization", + color: colors.rose, + }, + { + key: `vaulted-cap`, + name: "Vaulted", + title: "Vaulted Capitalization", + color: colors.lime, + }, + { + key: `cointime-cap`, + name: "Cointime", + title: "Cointime Capitalization", + color: colors.yellow, + }, + ]); + /** * @param {Object} args * @param {VecId} args.key @@ -2915,9 +2975,9 @@ function createPartialOptions(colors) { createUTXOGroupFolder({ name: "Compare", title: "Compare By Up To", - list: upTo, + list: upToDate, }), - ...upTo.map(createUTXOGroupFolder), + ...upToDate.map(createUTXOGroupFolder), ], }, { @@ -2926,9 +2986,9 @@ function createPartialOptions(colors) { createUTXOGroupFolder({ name: "Compare", title: "Compare By From", - list: from, + list: fromDate, }), - ...from.map(createUTXOGroupFolder), + ...fromDate.map(createUTXOGroupFolder), ], }, { @@ -2937,9 +2997,9 @@ function createPartialOptions(colors) { createUTXOGroupFolder({ name: "Compare", title: "Compare By Range", - list: range, + list: dateRange, }), - ...range.map(createUTXOGroupFolder), + ...dateRange.map(createUTXOGroupFolder), ], }, { @@ -3061,6 +3121,182 @@ function createPartialOptions(colors) { }, ], }, + { + name: "Cointime", + tree: [ + { + name: "Coinblocks", + title: "Coinblocks", + bottom: [ + createBaseSeries({ + key: "coinblocks-destroyed", + name: "Destroyed", + color: colors.red, + }), + createBaseSeries({ + key: "cumulative-coinblocks-destroyed", + name: "Cumulative Destroyed", + color: colors.red, + defaultActive: false, + }), + createBaseSeries({ + key: "coinblocks-created", + name: "created", + color: colors.orange, + }), + createBaseSeries({ + key: "cumulative-coinblocks-created", + name: "Cumulative created", + color: colors.orange, + defaultActive: false, + }), + createBaseSeries({ + key: "coinblocks-stored", + name: "stored", + color: colors.green, + }), + createBaseSeries({ + key: "cumulative-coinblocks-stored", + name: "Cumulative stored", + color: colors.green, + defaultActive: false, + }), + ], + }, + { + name: "Liveliness & Vaultedness", + title: "Liveliness & Vaultedness", + bottom: [ + createBaseSeries({ + key: "liveliness", + name: "Liveliness", + color: colors.rose, + }), + createBaseSeries({ + key: "vaultedness", + name: "Vaultedness", + color: colors.lime, + }), + ], + }, + { + name: "Supply", + title: "Cointime Supply", + bottom: /** @type {const} */ ([ + { + name: "all", + color: colors.orange, + }, + { + name: "vaulted", + color: colors.lime, + }, + { name: "active", color: colors.rose }, + ]).flatMap( + ({ name, color }) => + /** @type {const} */ ([ + createBaseSeries({ + key: `${ + name !== "all" ? /** @type {const} */ (`${name}-`) : "" + }supply`, + name, + color, + }), + createBaseSeries({ + key: `${ + name !== "all" ? /** @type {const} */ (`${name}-`) : "" + }supply-in-btc`, + name, + color, + }), + createBaseSeries({ + key: `${ + name !== "all" ? /** @type {const} */ (`${name}-`) : "" + }supply-in-usd`, + name, + color, + }), + ]) + ), + }, + { + name: "Capitalization", + tree: [ + { + name: "Compare", + title: "Compare Cointime Capitalizations", + bottom: [ + createBaseSeries({ + key: `marketcap`, + name: "Market", + color: colors.default, + }), + createBaseSeries({ + key: `realized-cap`, + name: "Realized", + color: colors.orange, + }), + ...cointimeCapitalizations.map(({ key, name, color }) => + createBaseSeries({ + key, + name, + color, + }) + ), + ], + }, + ...cointimeCapitalizations.map( + ({ key, name, color, title }) => ({ + name, + title, + bottom: [ + createBaseSeries({ + key, + name, + color, + }), + createBaseSeries({ + key: `marketcap`, + name: "Market", + color: colors.default, + }), + createBaseSeries({ + key: `realized-cap`, + name: "Realized", + color: colors.orange, + }), + ], + }) + ), + ], + }, + { + name: "Prices", + tree: [ + { + name: "Compare", + title: "Compare Cointime Prices", + top: cointimePrices.map(({ key, name, color }) => + createBaseSeries({ + key, + name, + color, + }) + ), + }, + ...cointimePrices.map(({ key, name, color, title }) => + createPriceWithRatio({ + key, + legend: name, + color, + name, + title, + }) + ), + ], + }, + ], + }, ], }, { diff --git a/websites/default/scripts/vecid-to-indexes.js b/websites/default/scripts/vecid-to-indexes.js index e52c00def..4daf0c427 100644 --- a/websites/default/scripts/vecid-to-indexes.js +++ b/websites/default/scripts/vecid-to-indexes.js @@ -696,6 +696,47 @@ export function createVecIdToIndexes() { "8y-dca-returns": [0, 1, 7, 19, 22, 23], "8y-dca-stack": [0, 1, 7, 19, 22, 23], "8y-returns": [0, 1, 7, 19, 22, 23], + "active-cap": [0, 1, 2, 5, 7, 19, 22, 23], + "active-price": [0, 1, 2, 5, 7, 19, 22, 23], + "active-price-ratio": [0, 1, 7, 19, 22, 23], + "active-price-ratio-1m-sma": [0, 1, 7, 19, 22, 23], + "active-price-ratio-1w-sma": [0, 1, 7, 19, 22, 23], + "active-price-ratio-1y-sma": [0, 1, 7, 19, 22, 23], + "active-price-ratio-1y-sma-momentum-oscillator": [0, 1, 7, 19, 22, 23], + "active-price-ratio-4y-sd": [0, 1, 7, 19, 22, 23], + "active-price-ratio-4y-sma": [0, 1, 7, 19, 22, 23], + "active-price-ratio-4y-zscore": [0, 1, 7, 19, 22, 23], + "active-price-ratio-m1sd": [0, 1, 7, 19, 22, 23], + "active-price-ratio-m1sd-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-m2sd": [0, 1, 7, 19, 22, 23], + "active-price-ratio-m2sd-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-m3sd": [0, 1, 7, 19, 22, 23], + "active-price-ratio-m3sd-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p0-1": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p0-1-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p0-5": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p0-5-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p1": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p1-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p1sd": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p1sd-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p2sd": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p2sd-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p3sd": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p3sd-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p99": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p99-5": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p99-5-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p99-9": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p99-9-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-p99-as-price": [0, 1, 7, 19, 22, 23], + "active-price-ratio-sd": [0, 1, 7, 19, 22, 23], + "active-price-ratio-sma": [0, 1, 7, 19, 22, 23], + "active-price-ratio-zscore": [0, 1, 7, 19, 22, 23], + "active-supply": [0, 1, 2, 5, 7, 19, 22, 23], + "active-supply-in-btc": [0, 1, 2, 5, 7, 19, 22, 23], + "active-supply-in-usd": [0, 1, 2, 5, 7, 19, 22, 23], + "activity-to-vaultedness-ratio": [0, 1, 2, 5, 7, 19, 22, 23], "adjusted-spent-output-profit-ratio": [0], "adjusted-value-created": [0, 1, 2, 5, 7, 19, 22, 23], "adjusted-value-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], @@ -744,8 +785,50 @@ export function createVecIdToIndexes() { "coinbase-max": [0, 1, 2, 7, 19, 22, 23], "coinbase-median": [0], "coinbase-min": [0, 1, 2, 7, 19, 22, 23], + "coinblocks-created": [0, 1, 2, 5, 7, 19, 22, 23], "coinblocks-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], + "coinblocks-stored": [0, 1, 2, 5, 7, 19, 22, 23], "coindays-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], + "cointime-cap": [0, 1, 2, 5, 7, 19, 22, 23], + "cointime-price": [0, 1, 2, 5, 7, 19, 22, 23], + "cointime-price-ratio": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-1m-sma": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-1w-sma": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-1y-sma": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-1y-sma-momentum-oscillator": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-4y-sd": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-4y-sma": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-4y-zscore": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-m1sd": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-m1sd-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-m2sd": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-m2sd-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-m3sd": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-m3sd-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p0-1": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p0-1-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p0-5": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p0-5-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p1": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p1-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p1sd": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p1sd-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p2sd": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p2sd-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p3sd": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p3sd-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p99": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p99-5": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p99-5-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p99-9": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p99-9-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-p99-as-price": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-sd": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-sma": [0, 1, 7, 19, 22, 23], + "cointime-price-ratio-zscore": [0, 1, 7, 19, 22, 23], + "cointime-value-created": [0, 1, 2, 5, 7, 19, 22, 23], + "cointime-value-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], + "cointime-value-stored": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-0sats-coinblocks-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-0sats-coindays-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-0sats-negative-realized-loss": [0, 1, 2, 5, 7, 19, 22, 23], @@ -762,8 +845,13 @@ export function createVecIdToIndexes() { "cumulative-coinbase": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-coinbase-in-btc": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-coinbase-in-usd": [0, 1, 2, 5, 7, 19, 22, 23], + "cumulative-coinblocks-created": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-coinblocks-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], + "cumulative-coinblocks-stored": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-coindays-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], + "cumulative-cointime-value-created": [0, 1, 2, 5, 7, 19, 22, 23], + "cumulative-cointime-value-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], + "cumulative-cointime-value-stored": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-empty-coinblocks-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-empty-coindays-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], "cumulative-empty-negative-realized-loss": [0, 1, 2, 5, 7, 19, 22, 23], @@ -7011,8 +7099,10 @@ export function createVecIdToIndexes() { "input-value": [20], "inputindex": [6], "interval": [5], + "investor-cap": [0, 1, 2, 5, 7, 19, 22, 23], "is-coinbase": [20], "is-explicitly-rbf": [20], + "liveliness": [0, 1, 2, 5, 7, 19, 22, 23], "low": [0, 1, 2, 5, 7, 19, 22, 23], "low-in-cents": [0, 5], "low-in-sats": [0, 1, 2, 5, 7, 19, 22, 23], @@ -8307,9 +8397,46 @@ export function createVecIdToIndexes() { "supply-in-profit-in-usd": [0, 1, 5, 7, 19, 22, 23], "supply-in-profit-relative-to-own-supply": [0, 1, 5, 7, 19, 22, 23], "supply-in-usd": [0, 1, 5, 7, 19, 22, 23], + "thermo-cap": [0, 1, 2, 5, 7, 19, 22, 23], "timestamp": [0, 1, 2, 4, 5, 7, 19, 22, 23], "timestamp-fixed": [5], "total-size": [5, 20], + "true-market-mean": [0, 1, 2, 5, 7, 19, 22, 23], + "true-market-mean-ratio": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-1m-sma": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-1w-sma": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-1y-sma": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-1y-sma-momentum-oscillator": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-4y-sd": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-4y-sma": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-4y-zscore": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-m1sd": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-m1sd-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-m2sd": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-m2sd-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-m3sd": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-m3sd-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p0-1": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p0-1-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p0-5": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p0-5-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p1": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p1-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p1sd": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p1sd-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p2sd": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p2sd-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p3sd": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p3sd-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p99": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p99-5": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p99-5-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p99-9": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p99-9-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-p99-as-price": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-sd": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-sma": [0, 1, 7, 19, 22, 23], + "true-market-mean-ratio-zscore": [0, 1, 7, 19, 22, 23], "tx-count": [0, 1, 2, 5, 7, 19, 22, 23], "tx-count-10p": [0], "tx-count-25p": [0], @@ -10452,6 +10579,47 @@ export function createVecIdToIndexes() { "value": [6, 9], "value-created": [0, 1, 2, 5, 7, 19, 22, 23], "value-destroyed": [0, 1, 2, 5, 7, 19, 22, 23], + "vaulted-cap": [0, 1, 2, 5, 7, 19, 22, 23], + "vaulted-price": [0, 1, 2, 5, 7, 19, 22, 23], + "vaulted-price-ratio": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-1m-sma": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-1w-sma": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-1y-sma": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-1y-sma-momentum-oscillator": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-4y-sd": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-4y-sma": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-4y-zscore": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-m1sd": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-m1sd-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-m2sd": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-m2sd-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-m3sd": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-m3sd-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p0-1": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p0-1-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p0-5": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p0-5-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p1": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p1-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p1sd": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p1sd-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p2sd": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p2sd-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p3sd": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p3sd-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p99": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p99-5": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p99-5-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p99-9": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p99-9-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-p99-as-price": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-sd": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-sma": [0, 1, 7, 19, 22, 23], + "vaulted-price-ratio-zscore": [0, 1, 7, 19, 22, 23], + "vaulted-supply": [0, 1, 2, 5, 7, 19, 22, 23], + "vaulted-supply-in-btc": [0, 1, 2, 5, 7, 19, 22, 23], + "vaulted-supply-in-usd": [0, 1, 2, 5, 7, 19, 22, 23], + "vaultedness": [0, 1, 2, 5, 7, 19, 22, 23], "vbytes": [5], "vsize": [20], "weekindex": [0, 22],