global: snapshot

This commit is contained in:
nym21
2026-03-11 13:43:46 +01:00
parent c5d63b3090
commit 984122f394
82 changed files with 3962 additions and 3412 deletions
@@ -59,7 +59,7 @@ impl Amount<Height> {
self.cents.compute_binary::<Sats, Cents, SatsToCents>(
max_from,
&self.sats,
&prices.price.cents.height,
&prices.spot.cents.height,
exit,
)?;
Ok(())
@@ -68,7 +68,7 @@ impl AmountPerBlock {
self.cents.compute_binary::<Sats, Cents, SatsToCents>(
max_from,
&self.sats.height,
&prices.price.cents.height,
&prices.spot.cents.height,
exit,
)?;
Ok(())
@@ -62,7 +62,7 @@ impl AmountPerBlockCumulative {
self.base.cents.compute_binary::<Sats, Cents, SatsToCents>(
max_from,
&self.base.sats.height,
&prices.price.cents.height,
&prices.spot.cents.height,
exit,
)?;
@@ -60,7 +60,7 @@ impl AmountPerBlockCumulativeSum {
.compute_binary::<Sats, Cents, SatsToCents>(
max_from,
&self.base.sats.height,
&prices.price.cents.height,
&prices.spot.cents.height,
exit,
)?;
@@ -61,7 +61,7 @@ impl AmountPerBlockFull {
.compute_binary::<Sats, Cents, SatsToCents>(
max_from,
&self.base.sats.height,
&prices.price.cents.height,
&prices.spot.cents.height,
exit,
)?;
@@ -1,7 +1,7 @@
use brk_traversable::Traversable;
use brk_types::{
Day1, Day3, Epoch, FromCoarserIndex, Halving, Height, Hour1, Hour4, Hour12,
Minute10, Minute30, Month1, Month3, Month6, Version, Week1, Year1, Year10,
Day1, Day3, Epoch, FromCoarserIndex, Halving, Height, Hour1, Hour4, Hour12, Minute10, Minute30,
Month1, Month3, Month6, Version, Week1, Year1, Year10,
};
use derive_more::{Deref, DerefMut};
use schemars::JsonSchema;
@@ -70,7 +70,7 @@ where
};
}
fn for_each_range_from_coarser<
fn for_each_range<
I: VecIndex,
O: VecValue,
S1I: VecIndex + FromCoarserIndex<I>,
@@ -103,7 +103,7 @@ where
version,
height_source.clone(),
indexes.$idx.identity.read_only_boxed_clone(),
for_each_range_from_coarser,
for_each_range,
)
};
}
@@ -71,7 +71,7 @@ impl PriceWithRatioPerBlock {
F: FnMut(&mut EagerVec<PcoVec<Height, Cents>>) -> Result<()>,
{
compute_price(&mut self.cents.height)?;
self.compute_ratio(starting_indexes, &prices.price.cents.height, exit)
self.compute_ratio(starting_indexes, &prices.spot.cents.height, exit)
}
}
@@ -104,7 +104,7 @@ impl PriceWithRatioExtendedPerBlock {
starting_indexes: &Indexes,
exit: &Exit,
) -> Result<()> {
let close_price = &prices.price.cents.height;
let close_price = &prices.spot.cents.height;
self.base.compute_ratio(starting_indexes, close_price, exit)?;
self.percentiles.compute(
starting_indexes,