global: snapshot part 16

This commit is contained in:
nym21
2026-03-21 17:15:53 +01:00
parent b45c6ec05f
commit 2991562234
31 changed files with 355 additions and 423 deletions
@@ -133,13 +133,6 @@ impl Vecs {
exit,
)?;
self.subsidy_sma_1y.cents.height.compute_rolling_average(
starting_indexes.height,
&lookback._1y,
&self.subsidy.block.cents,
exit,
)?;
self.fee_to_subsidy_ratio
.compute_binary::<Dollars, Dollars, RatioDollarsBp32, _, _>(
starting_indexes.height,
@@ -7,7 +7,7 @@ use crate::{
indexes,
internal::{
AmountPerBlockCumulative, AmountPerBlockCumulativeRolling, AmountPerBlockFull,
CachedWindowStarts, FiatPerBlock, LazyPercentRollingWindows, OneMinusBp16,
CachedWindowStarts, LazyPercentRollingWindows, OneMinusBp16,
PercentPerBlock, PercentRollingWindows, RatioRollingWindows,
},
};
@@ -55,7 +55,6 @@ impl Vecs {
indexes,
)?,
subsidy_dominance_rolling,
subsidy_sma_1y: FiatPerBlock::forced_import(db, "subsidy_sma_1y", version, indexes)?,
fee_to_subsidy_ratio: RatioRollingWindows::forced_import(
db,
"fee_to_subsidy_ratio",
@@ -1,11 +1,10 @@
use brk_traversable::Traversable;
use brk_types::{BasisPoints16, BasisPoints32, Cents};
use brk_types::{BasisPoints16, BasisPoints32};
use vecdb::{Rw, StorageMode};
use crate::internal::{
AmountPerBlockCumulative, AmountPerBlockCumulativeRolling, AmountPerBlockFull,
FiatPerBlock, LazyPercentRollingWindows, PercentPerBlock, PercentRollingWindows,
RatioRollingWindows,
LazyPercentRollingWindows, PercentPerBlock, PercentRollingWindows, RatioRollingWindows,
};
#[derive(Traversable)]
@@ -22,8 +21,6 @@ pub struct Vecs<M: StorageMode = Rw> {
pub subsidy_dominance: PercentPerBlock<BasisPoints16, M>,
#[traversable(wrap = "subsidy", rename = "dominance")]
pub subsidy_dominance_rolling: LazyPercentRollingWindows<BasisPoints16>,
#[traversable(wrap = "subsidy", rename = "sma_1y")]
pub subsidy_sma_1y: FiatPerBlock<Cents, M>,
#[traversable(wrap = "fees", rename = "to_subsidy_ratio")]
pub fee_to_subsidy_ratio: RatioRollingWindows<BasisPoints32, M>,
}