website: snapshot

This commit is contained in:
nym21
2026-02-03 23:43:52 +01:00
parent 277a0eb6a7
commit 0d5d7da70f
44 changed files with 2999 additions and 1591 deletions
@@ -1,5 +1,6 @@
use brk_error::Result;
use vecdb::Exit;
use brk_types::{Bitcoin, Close, Dollars, StoredF64};
use vecdb::{Exit, TypedVecIterator};
use super::super::activity;
use super::Vecs;
@@ -29,6 +30,15 @@ impl Vecs {
.activity
.coindays_destroyed;
let circulating_supply = &distribution
.utxo_cohorts
.all
.metrics
.supply
.total
.bitcoin
.height;
self.cointime_value_destroyed
.compute_all(indexes, starting_indexes, exit, |vec| {
vec.compute_multiply(
@@ -62,14 +72,27 @@ impl Vecs {
Ok(())
})?;
// VOCDD: Value-weighted Coin Days Destroyed = CDD × price
// This is a key input for Reserve Risk calculation
// VOCDD: Value of Coin Days Destroyed = price × (CDD / circulating_supply)
// Supply-adjusted to account for growing supply over time
// This is a key input for Reserve Risk / HODL Bank calculation
self.vocdd
.compute_all(indexes, starting_indexes, exit, |vec| {
vec.compute_multiply(
let mut supply_iter = circulating_supply.into_iter();
vec.compute_transform2(
starting_indexes.height,
&price.usd.split.close.height,
&coindays_destroyed.height,
|(i, price, cdd, _): (_, Close<Dollars>, StoredF64, _)| {
let supply: Bitcoin = supply_iter.get_unwrap(i);
let supply_f64 = f64::from(supply);
if supply_f64 == 0.0 {
(i, StoredF64::from(0.0))
} else {
// VOCDD = price × (CDD / supply)
let vocdd = f64::from(price) * f64::from(cdd) / supply_f64;
(i, StoredF64::from(vocdd))
}
},
exit,
)?;
Ok(())
@@ -29,7 +29,7 @@ impl Vecs {
vocdd: ComputedFromHeightSumCum::forced_import(
db,
"vocdd",
version,
version + Version::ONE,
indexes,
)?,
})