global: snapshot

This commit is contained in:
nym21
2026-03-01 21:20:47 +01:00
parent 4abb00b86d
commit 159c983a3f
27 changed files with 246 additions and 172 deletions
@@ -190,10 +190,10 @@ impl Vecs {
exit,
)?;
self.subsidy_usd_1y_sma.height.compute_rolling_average(
self.subsidy_usd_1y_sma.cents.height.compute_rolling_average(
starting_indexes.height,
&count_vecs.height_1y_ago,
&self.subsidy.base.usd.height,
&self.subsidy.base.cents.height,
exit,
)?;
@@ -6,7 +6,7 @@ use super::Vecs;
use crate::{
indexes,
internal::{
ComputedFromHeightLast, ValueFromHeightFull,
ComputedFromHeightLast, FiatFromHeightLast, ValueFromHeightFull,
ValueFromHeightSumCumulative,
},
};
@@ -87,7 +87,7 @@ impl Vecs {
version,
indexes,
)?,
subsidy_usd_1y_sma: ComputedFromHeightLast::forced_import(
subsidy_usd_1y_sma: FiatFromHeightLast::forced_import(
db,
"subsidy_usd_1y_sma",
version,
@@ -1,9 +1,9 @@
use brk_traversable::Traversable;
use brk_types::{Dollars, StoredF32};
use brk_types::{Cents, StoredF32};
use vecdb::{Rw, StorageMode};
use crate::internal::{
ComputedFromHeightLast, ValueFromHeightFull,
ComputedFromHeightLast, FiatFromHeightLast, ValueFromHeightFull,
ValueFromHeightSumCumulative,
};
@@ -24,5 +24,5 @@ pub struct Vecs<M: StorageMode = Rw> {
pub subsidy_dominance_7d: ComputedFromHeightLast<StoredF32, M>,
pub subsidy_dominance_30d: ComputedFromHeightLast<StoredF32, M>,
pub subsidy_dominance_1y: ComputedFromHeightLast<StoredF32, M>,
pub subsidy_usd_1y_sma: ComputedFromHeightLast<Dollars, M>,
pub subsidy_usd_1y_sma: FiatFromHeightLast<Cents, M>,
}