mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-24 17:38:09 -07:00
global: snapshot
This commit is contained in:
@@ -17,8 +17,8 @@ impl Vecs {
|
||||
// velocity = rolling_1y_sum(volume) / circulating_supply
|
||||
let circulating_supply = &distribution.utxo_cohorts.all.metrics.supply.total;
|
||||
|
||||
// BTC velocity at height level
|
||||
self.btc.height.compute_rolling_ratio(
|
||||
// Native velocity at height level
|
||||
self.native.height.compute_rolling_ratio(
|
||||
starting_indexes.height,
|
||||
&blocks.lookback._1y,
|
||||
&transactions.volume.sent_sum.base.sats.height,
|
||||
@@ -26,8 +26,8 @@ impl Vecs {
|
||||
exit,
|
||||
)?;
|
||||
|
||||
// USD velocity at height level
|
||||
self.usd.height.compute_rolling_ratio(
|
||||
// Fiat velocity at height level
|
||||
self.fiat.height.compute_rolling_ratio(
|
||||
starting_indexes.height,
|
||||
&blocks.lookback._1y,
|
||||
&transactions.volume.sent_sum.base.usd.height,
|
||||
|
||||
@@ -12,8 +12,8 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
Ok(Self {
|
||||
btc: PerBlock::forced_import(db, "velocity_btc", version, indexes)?,
|
||||
usd: PerBlock::forced_import(db, "velocity_usd", version, indexes)?,
|
||||
native: PerBlock::forced_import(db, "velocity", version, indexes)?,
|
||||
fiat: PerBlock::forced_import(db, "velocity_fiat", version, indexes)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ use crate::internal::PerBlock;
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub btc: PerBlock<StoredF64, M>,
|
||||
pub usd: PerBlock<StoredF64, M>,
|
||||
pub native: PerBlock<StoredF64, M>,
|
||||
pub fiat: PerBlock<StoredF64, M>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user