global: snapshot

This commit is contained in:
nym21
2026-03-14 14:00:03 +01:00
parent d53e533c9f
commit 7bcc32fea1
31 changed files with 413 additions and 287 deletions

View File

@@ -297,7 +297,7 @@ impl CostBasisFenwick {
if total <= 0 {
0
} else {
(range as f64 / total as f64 * 10000.0) as u16
(range as f64 / total as f64 * 10000.0).round() as u16
}
};

View File

@@ -461,4 +461,34 @@ impl RealizedState {
}
Cents::new((self.peak_regret_raw / Sats::ONE_BTC_U128) as u64)
}
/// Raw profit value created for lossless aggregation.
#[inline]
pub(crate) fn profit_value_created_raw(&self) -> u128 {
self.profit_value_created_raw
}
/// Raw profit value destroyed for lossless aggregation.
#[inline]
pub(crate) fn profit_value_destroyed_raw(&self) -> u128 {
self.profit_value_destroyed_raw
}
/// Raw loss value created for lossless aggregation.
#[inline]
pub(crate) fn loss_value_created_raw(&self) -> u128 {
self.loss_value_created_raw
}
/// Raw loss value destroyed for lossless aggregation.
#[inline]
pub(crate) fn loss_value_destroyed_raw(&self) -> u128 {
self.loss_value_destroyed_raw
}
/// Raw peak regret for lossless aggregation.
#[inline]
pub(crate) fn peak_regret_raw(&self) -> u128 {
self.peak_regret_raw
}
}