computer: snapshot

This commit is contained in:
nym21
2026-03-09 11:16:50 +01:00
parent 0bff57fb43
commit 3e8cf4a975
92 changed files with 853 additions and 825 deletions

View File

@@ -98,7 +98,7 @@ impl AddressCohorts {
self.par_iter_mut().try_for_each(|v| {
v.addr_count_delta.compute(
starting_indexes.height,
&blocks.count.height_1m_ago,
&blocks.lookback.height_1m_ago,
&v.addr_count.height,
exit,
)

View File

@@ -8,7 +8,9 @@ use brk_error::Result;
use brk_traversable::Traversable;
use brk_types::{Dollars, Height, Indexes, Sats, Version};
use rayon::prelude::*;
use vecdb::{AnyStoredVec, Database, Exit, ReadOnlyClone, ReadableVec, Rw, StorageMode, WritableVec};
use vecdb::{
AnyStoredVec, Database, Exit, ReadOnlyClone, ReadableVec, Rw, StorageMode, WritableVec,
};
use crate::{
blocks,
@@ -22,7 +24,7 @@ use crate::{
state::UTXOCohortState,
},
indexes,
internal::ValueFromHeight,
internal::AmountFromHeight,
prices,
};
@@ -47,7 +49,7 @@ pub struct UTXOCohorts<M: StorageMode = Rw> {
#[traversable(rename = "type")]
pub type_: BySpendableType<UTXOCohortVecs<MinimalCohortMetrics<M>>>,
pub profitability: ProfitabilityMetrics<M>,
pub matured: ByAgeRange<ValueFromHeight<M>>,
pub matured: ByAgeRange<AmountFromHeight<M>>,
#[traversable(skip)]
pub(super) fenwick: CostBasisFenwick,
/// Cached partition_point positions for tick_tock boundary searches.
@@ -226,8 +228,10 @@ impl UTXOCohorts<Rw> {
let lt_amount = ByLowerThanAmount::try_new(&minimal_no_state)?;
let ge_amount = ByGreatEqualAmount::try_new(&minimal_no_state)?;
let matured = ByAgeRange::try_new(&|_f: Filter, name: &'static str| -> Result<ValueFromHeight> {
ValueFromHeight::forced_import(db, &format!("utxo_{name}_matured"), v, indexes)
let matured = ByAgeRange::try_new(&|_f: Filter,
name: &'static str|
-> Result<AmountFromHeight> {
AmountFromHeight::forced_import(db, &format!("utxo_{name}_matured"), v, indexes)
})?;
Ok(Self {
@@ -257,7 +261,10 @@ impl UTXOCohorts<Rw> {
return;
}
let Self {
sth, fenwick, age_range, ..
sth,
fenwick,
age_range,
..
} = self;
fenwick.compute_is_sth(&sth.metrics.filter, age_range.iter().map(|v| v.filter()));
@@ -334,9 +341,7 @@ impl UTXOCohorts<Rw> {
/// Sequential mutable iterator over all separate (stateful) cohorts.
/// Use instead of `par_iter_separate_mut` when per-item work is trivial.
pub(crate) fn iter_separate_mut(
&mut self,
) -> impl Iterator<Item = &mut dyn DynCohortVecs> {
pub(crate) fn iter_separate_mut(&mut self) -> impl Iterator<Item = &mut dyn DynCohortVecs> {
let Self {
age_range,
epoch,
@@ -575,35 +580,20 @@ impl UTXOCohorts<Rw> {
}),
Box::new(|| {
age_range.par_iter_mut().try_for_each(|v| {
v.metrics.compute_rest_part2(
blocks,
prices,
starting_indexes,
ss,
exit,
)
v.metrics
.compute_rest_part2(blocks, prices, starting_indexes, ss, exit)
})
}),
Box::new(|| {
max_age.par_iter_mut().try_for_each(|v| {
v.metrics.compute_rest_part2(
blocks,
prices,
starting_indexes,
ss,
exit,
)
v.metrics
.compute_rest_part2(blocks, prices, starting_indexes, ss, exit)
})
}),
Box::new(|| {
min_age.par_iter_mut().try_for_each(|v| {
v.metrics.compute_rest_part2(
blocks,
prices,
starting_indexes,
ss,
exit,
)
v.metrics
.compute_rest_part2(blocks, prices, starting_indexes, ss, exit)
})
}),
Box::new(|| {
@@ -613,24 +603,14 @@ impl UTXOCohorts<Rw> {
}),
Box::new(|| {
epoch.par_iter_mut().try_for_each(|v| {
v.metrics.compute_rest_part2(
blocks,
prices,
starting_indexes,
ss,
exit,
)
v.metrics
.compute_rest_part2(blocks, prices, starting_indexes, ss, exit)
})
}),
Box::new(|| {
class.par_iter_mut().try_for_each(|v| {
v.metrics.compute_rest_part2(
blocks,
prices,
starting_indexes,
ss,
exit,
)
v.metrics
.compute_rest_part2(blocks, prices, starting_indexes, ss, exit)
})
}),
Box::new(|| {
@@ -695,9 +675,8 @@ impl UTXOCohorts<Rw> {
}
vecs.extend(self.profitability.collect_all_vecs_mut());
for v in self.matured.iter_mut() {
let base = &mut v.base;
vecs.push(&mut base.sats.height);
vecs.push(&mut base.cents.height);
vecs.push(&mut v.sats.height);
vecs.push(&mut v.cents.height);
}
vecs.into_par_iter()
}
@@ -712,13 +691,23 @@ impl UTXOCohorts<Rw> {
pub(crate) fn min_separate_stateful_height_len(&self) -> Height {
self.iter_separate()
.map(|v| Height::from(v.min_stateful_height_len()))
.chain(self.matured.iter().map(|v| Height::from(v.min_stateful_len())))
.chain(
self.matured
.iter()
.map(|v| Height::from(v.min_stateful_len())),
)
.min()
.unwrap_or_default()
.min(Height::from(self.profitability.min_stateful_height_len()))
.min(Height::from(self.all.metrics.realized.min_stateful_height_len()))
.min(Height::from(self.sth.metrics.realized.min_stateful_height_len()))
.min(Height::from(self.lth.metrics.realized.min_stateful_height_len()))
.min(Height::from(
self.all.metrics.realized.min_stateful_height_len(),
))
.min(Height::from(
self.sth.metrics.realized.min_stateful_height_len(),
))
.min(Height::from(
self.lth.metrics.realized.min_stateful_height_len(),
))
}
/// Import state for all separate cohorts at or before given height.
@@ -770,7 +759,11 @@ impl UTXOCohorts<Rw> {
/// Called during the block loop after separate cohorts' truncate_push but before reset.
pub(crate) fn push_overlapping_realized_full(&mut self, height: Height) -> Result<()> {
let Self {
all, sth, lth, age_range, ..
all,
sth,
lth,
age_range,
..
} = self;
let sth_filter = &sth.metrics.filter;

View File

@@ -64,7 +64,7 @@ impl ActivityCore {
) -> Result<()> {
self.sent_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&blocks.lookback.height_24h_ago,
&self.sent.height,
exit,
)?;

View File

@@ -21,6 +21,7 @@ pub struct ActivityFull<M: StorageMode = Rw> {
pub coindays_destroyed_cumulative: ComputedFromHeight<StoredF64, M>,
pub coindays_destroyed_sum: RollingWindows<StoredF64, M>,
#[traversable(rename = "sent_sum")]
pub sent_sum_extended: RollingWindowsFrom1w<Sats, M>,
}
@@ -72,7 +73,7 @@ impl ActivityFull {
exit,
)?;
let window_starts = blocks.count.window_starts();
let window_starts = blocks.lookback.window_starts();
self.coindays_destroyed_sum.compute_rolling_sum(
starting_indexes.height,
&window_starts,

View File

@@ -35,7 +35,9 @@ pub struct AllCohortMetrics<M: StorageMode = Rw> {
pub dormancy: ComputedFromHeight<StoredF32, M>,
pub velocity: ComputedFromHeight<StoredF32, M>,
#[traversable(wrap = "supply", rename = "delta")]
pub supply_delta_extended: RollingDeltaExcept1m<Sats, SatsSigned, M>,
#[traversable(wrap = "outputs", rename = "utxo_count_delta")]
pub utxo_count_delta_extended: RollingDeltaExcept1m<StoredU64, StoredI64, M>,
}
@@ -147,7 +149,7 @@ impl AllCohortMetrics {
exit,
)?;
let window_starts = blocks.count.window_starts();
let window_starts = blocks.lookback.window_starts();
self.supply_delta_extended.compute(
starting_indexes.height,
&window_starts,

View File

@@ -32,7 +32,9 @@ pub struct ExtendedCohortMetrics<M: StorageMode = Rw> {
pub dormancy: ComputedFromHeight<StoredF32, M>,
pub velocity: ComputedFromHeight<StoredF32, M>,
#[traversable(wrap = "supply", rename = "delta")]
pub supply_delta_extended: RollingDeltaExcept1m<Sats, SatsSigned, M>,
#[traversable(wrap = "outputs", rename = "utxo_count_delta")]
pub utxo_count_delta_extended: RollingDeltaExcept1m<StoredU64, StoredI64, M>,
}
@@ -126,7 +128,7 @@ impl ExtendedCohortMetrics {
exit,
)?;
let window_starts = blocks.count.window_starts();
let window_starts = blocks.lookback.window_starts();
self.supply_delta_extended.compute(
starting_indexes.height,
&window_starts,

View File

@@ -1,19 +1,17 @@
use brk_cohort::Filter;
use brk_error::Result;
use brk_types::{
BasisPoints16, BasisPoints32, BasisPointsSigned32, Cents, Height, Version,
};
use brk_types::{BasisPoints16, BasisPoints32, BasisPointsSigned32, Cents, Height, Version};
use schemars::JsonSchema;
use vecdb::{BytesVec, BytesVecValue, Database, ImportableVec};
use crate::{
indexes,
internal::{
CentsType, ComputedFromHeight, ComputedFromHeightCumulative,
ComputedFromHeightCumulativeSum, ComputedFromHeightRatio, FiatFromHeight,
FiatRollingDelta1m, FiatRollingDeltaExcept1m, NumericValue, PercentFromHeight,
PercentRollingWindows, Price, RollingDelta1m, RollingDeltaExcept1m, RollingWindow24h,
RollingWindows, RollingWindowsFrom1w, ValueFromHeight, ValueFromHeightCumulative,
AmountFromHeight, AmountFromHeightCumulative, CentsType, ComputedFromHeight,
ComputedFromHeightCumulative, ComputedFromHeightCumulativeSum, ComputedFromHeightRatio,
FiatFromHeight, FiatRollingDelta1m, FiatRollingDeltaExcept1m, NumericValue,
PercentFromHeight, PercentRollingWindows, Price, RollingDelta1m, RollingDeltaExcept1m,
RollingWindow24h, RollingWindows, RollingWindowsFrom1w,
},
};
@@ -37,8 +35,8 @@ macro_rules! impl_config_import {
// Non-generic types
impl_config_import!(
ValueFromHeight,
ValueFromHeightCumulative,
AmountFromHeight,
AmountFromHeightCumulative,
ComputedFromHeightRatio,
PercentFromHeight<BasisPoints16>,
PercentFromHeight<BasisPoints32>,
@@ -83,7 +81,8 @@ impl<C: CentsType> ConfigImport for FiatFromHeight<C> {
Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes)
}
}
impl<S: NumericValue + JsonSchema, C: NumericValue + JsonSchema> ConfigImport for RollingDelta1m<S, C>
impl<S: NumericValue + JsonSchema, C: NumericValue + JsonSchema> ConfigImport
for RollingDelta1m<S, C>
{
fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result<Self> {
Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes)
@@ -136,11 +135,7 @@ impl<'a> ImportConfig<'a> {
}
}
pub(crate) fn import<T: ConfigImport>(
&self,
suffix: &str,
offset: Version,
) -> Result<T> {
pub(crate) fn import<T: ConfigImport>(&self, suffix: &str, offset: Version) -> Result<T> {
T::config_import(self, suffix, offset)
}
}

View File

@@ -67,7 +67,7 @@ impl OutputsMetrics {
) -> Result<()> {
self.utxo_count_delta.compute(
starting_indexes.height,
&blocks.count.height_1m_ago,
&blocks.lookback.height_1m_ago,
&self.utxo_count.height,
exit,
)?;

View File

@@ -12,23 +12,21 @@ use crate::distribution::metrics::ImportConfig;
#[derive(Traversable)]
pub struct RealizedAdjusted<M: StorageMode = Rw> {
pub adjusted_value_created: ComputedFromHeight<Cents, M>,
pub adjusted_value_destroyed: ComputedFromHeight<Cents, M>,
pub adjusted_value_created_sum: RollingWindows<Cents, M>,
pub adjusted_value_destroyed_sum: RollingWindows<Cents, M>,
pub adjusted_sopr: RollingWindows<StoredF64, M>,
pub value_created: ComputedFromHeight<Cents, M>,
pub value_destroyed: ComputedFromHeight<Cents, M>,
pub value_created_sum: RollingWindows<Cents, M>,
pub value_destroyed_sum: RollingWindows<Cents, M>,
pub sopr: RollingWindows<StoredF64, M>,
}
impl RealizedAdjusted {
pub(crate) fn forced_import(cfg: &ImportConfig) -> Result<Self> {
Ok(RealizedAdjusted {
adjusted_value_created: cfg.import("adjusted_value_created", Version::ZERO)?,
adjusted_value_destroyed: cfg.import("adjusted_value_destroyed", Version::ZERO)?,
adjusted_value_created_sum: cfg.import("adjusted_value_created", Version::ONE)?,
adjusted_value_destroyed_sum: cfg.import("adjusted_value_destroyed", Version::ONE)?,
adjusted_sopr: cfg.import("adjusted_sopr", Version::ONE)?,
value_created: cfg.import("adjusted_value_created", Version::ZERO)?,
value_destroyed: cfg.import("adjusted_value_destroyed", Version::ZERO)?,
value_created_sum: cfg.import("adjusted_value_created", Version::ONE)?,
value_destroyed_sum: cfg.import("adjusted_value_destroyed", Version::ONE)?,
sopr: cfg.import("adjusted_sopr", Version::ONE)?,
})
}
@@ -43,14 +41,14 @@ impl RealizedAdjusted {
up_to_1h_value_destroyed: &impl ReadableVec<Height, Cents>,
exit: &Exit,
) -> Result<()> {
// Compute adjusted_value_created = base.value_created - up_to_1h.value_created
self.adjusted_value_created.height.compute_subtract(
// Compute value_created = base.value_created - up_to_1h.value_created
self.value_created.height.compute_subtract(
starting_indexes.height,
base_value_created,
up_to_1h_value_created,
exit,
)?;
self.adjusted_value_destroyed.height.compute_subtract(
self.value_destroyed.height.compute_subtract(
starting_indexes.height,
base_value_destroyed,
up_to_1h_value_destroyed,
@@ -58,27 +56,27 @@ impl RealizedAdjusted {
)?;
// Adjusted value created/destroyed rolling sums
let window_starts = blocks.count.window_starts();
self.adjusted_value_created_sum.compute_rolling_sum(
let window_starts = blocks.lookback.window_starts();
self.value_created_sum.compute_rolling_sum(
starting_indexes.height,
&window_starts,
&self.adjusted_value_created.height,
&self.value_created.height,
exit,
)?;
self.adjusted_value_destroyed_sum.compute_rolling_sum(
self.value_destroyed_sum.compute_rolling_sum(
starting_indexes.height,
&window_starts,
&self.adjusted_value_destroyed.height,
&self.value_destroyed.height,
exit,
)?;
// SOPR ratios from rolling sums
for ((sopr, vc), vd) in self
.adjusted_sopr
.sopr
.as_mut_array()
.into_iter()
.zip(self.adjusted_value_created_sum.as_array())
.zip(self.adjusted_value_destroyed_sum.as_array())
.zip(self.value_created_sum.as_array())
.zip(self.value_destroyed_sum.as_array())
{
sopr.compute_binary::<Cents, Cents, RatioCents64>(
starting_indexes.height,

View File

@@ -91,13 +91,13 @@ impl RealizedBase {
self.core.compute_rest_part1(blocks, starting_indexes, exit)?;
self.sent_in_profit_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&blocks.lookback.height_24h_ago,
&self.sent_in_profit.height,
exit,
)?;
self.sent_in_loss_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&blocks.lookback.height_24h_ago,
&self.sent_in_loss.height,
exit,
)?;

View File

@@ -155,27 +155,27 @@ impl RealizedCore {
self.realized_cap_delta.compute(
starting_indexes.height,
&blocks.count.height_1m_ago,
&blocks.lookback.height_1m_ago,
&self.minimal.realized_cap_cents.height,
exit,
)?;
self.net_realized_pnl_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&blocks.lookback.height_24h_ago,
&self.net_realized_pnl.height,
exit,
)?;
self.value_created_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&blocks.lookback.height_24h_ago,
&self.value_created.height,
exit,
)?;
self.value_destroyed_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&blocks.lookback.height_24h_ago,
&self.value_destroyed.height,
exit,
)?;

View File

@@ -57,13 +57,16 @@ pub struct RealizedFull<M: StorageMode = Rw> {
pub gross_pnl_sum: RollingWindows<Cents, M>,
pub net_realized_pnl_cumulative: ComputedFromHeight<CentsSigned, M>,
#[traversable(rename = "net_realized_pnl_sum")]
pub net_realized_pnl_sum_extended: RollingWindowsFrom1w<CentsSigned, M>,
pub net_pnl_delta: FiatRollingDelta1m<CentsSigned, CentsSigned, M>,
#[traversable(rename = "net_pnl_delta")]
pub net_pnl_delta_extended: FiatRollingDeltaExcept1m<CentsSigned, CentsSigned, M>,
pub net_pnl_change_1m_rel_to_realized_cap: PercentFromHeight<BasisPointsSigned32, M>,
pub net_pnl_change_1m_rel_to_market_cap: PercentFromHeight<BasisPointsSigned32, M>,
#[traversable(rename = "realized_cap_delta")]
pub realized_cap_delta_extended: FiatRollingDeltaExcept1m<Cents, CentsSigned, M>,
pub investor_price: Price<ComputedFromHeight<Cents, M>>,
@@ -82,15 +85,22 @@ pub struct RealizedFull<M: StorageMode = Rw> {
pub realized_cap_rel_to_own_market_cap: PercentFromHeight<BasisPoints32, M>,
#[traversable(rename = "realized_profit_sum")]
pub realized_profit_sum_extended: RollingWindowsFrom1w<Cents, M>,
#[traversable(rename = "realized_loss_sum")]
pub realized_loss_sum_extended: RollingWindowsFrom1w<Cents, M>,
pub realized_profit_to_loss_ratio: RollingWindows<StoredF64, M>,
#[traversable(rename = "value_created_sum")]
pub value_created_sum_extended: RollingWindowsFrom1w<Cents, M>,
#[traversable(rename = "value_destroyed_sum")]
pub value_destroyed_sum_extended: RollingWindowsFrom1w<Cents, M>,
#[traversable(rename = "sopr")]
pub sopr_extended: RollingWindowsFrom1w<StoredF64, M>,
#[traversable(rename = "sent_in_profit_sum")]
pub sent_in_profit_sum_extended: RollingWindowsFrom1w<Sats, M>,
#[traversable(rename = "sent_in_loss_sum")]
pub sent_in_loss_sum_extended: RollingWindowsFrom1w<Sats, M>,
pub realized_price_ratio_percentiles: ComputedFromHeightRatioPercentiles<M>,
@@ -377,7 +387,7 @@ impl RealizedFull {
exit,
)?;
let window_starts = blocks.count.window_starts();
let window_starts = blocks.lookback.window_starts();
// Extended rolling sum (1w, 1m, 1y) for net_realized_pnl
self.net_realized_pnl_sum_extended.compute_rolling_sum(
@@ -496,7 +506,7 @@ impl RealizedFull {
// Net PnL delta (1m base + 24h/1w/1y extended)
self.net_pnl_delta.compute(
starting_indexes.height,
&blocks.count.height_1m_ago,
&blocks.lookback.height_1m_ago,
&self.net_realized_pnl_cumulative.height,
exit,
)?;

View File

@@ -127,13 +127,13 @@ impl RealizedMinimal {
.compute_rest(starting_indexes.height, exit)?;
self.realized_profit_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&blocks.lookback.height_24h_ago,
&self.realized_profit.height,
exit,
)?;
self.realized_loss_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&blocks.lookback.height_24h_ago,
&self.realized_loss.height,
exit,
)?;

View File

@@ -6,8 +6,8 @@ use crate::{blocks, prices};
use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec};
use crate::internal::{
HalveCents, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyValueFromHeight,
RollingDelta1m, ValueFromHeight,
AmountFromHeight, HalveCents, HalveDollars, HalveSats, HalveSatsToBitcoin,
LazyAmountFromHeight, RollingDelta1m,
};
use super::ImportConfig;
@@ -15,8 +15,8 @@ use super::ImportConfig;
/// Supply metrics for a cohort.
#[derive(Traversable)]
pub struct SupplyMetrics<M: StorageMode = Rw> {
pub total: ValueFromHeight<M>,
pub halved: LazyValueFromHeight,
pub total: AmountFromHeight<M>,
pub halved: LazyAmountFromHeight,
pub delta: RollingDelta1m<Sats, SatsSigned, M>,
}
@@ -25,7 +25,7 @@ impl SupplyMetrics {
pub(crate) fn forced_import(cfg: &ImportConfig) -> Result<Self> {
let supply = cfg.import("supply", Version::ZERO)?;
let supply_halved = LazyValueFromHeight::from_block_source::<
let supply_halved = LazyAmountFromHeight::from_block_source::<
HalveSats,
HalveSatsToBitcoin,
HalveCents,
@@ -54,8 +54,8 @@ impl SupplyMetrics {
pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> {
vec![
&mut self.total.base.sats.height as &mut dyn AnyStoredVec,
&mut self.total.base.cents.height as &mut dyn AnyStoredVec,
&mut self.total.sats.height as &mut dyn AnyStoredVec,
&mut self.total.cents.height as &mut dyn AnyStoredVec,
]
}
@@ -102,7 +102,7 @@ impl SupplyMetrics {
) -> Result<()> {
self.delta.compute(
starting_indexes.height,
&blocks.count.height_1m_ago,
&blocks.lookback.height_1m_ago,
&self.total.sats.height,
exit,
)

View File

@@ -5,15 +5,15 @@ use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec};
use crate::prices;
use crate::internal::ValueFromHeight;
use crate::internal::AmountFromHeight;
use crate::distribution::{metrics::ImportConfig, state::UnrealizedState};
/// Minimal unrealized metrics: supply in profit/loss only.
#[derive(Traversable)]
pub struct UnrealizedMinimal<M: StorageMode = Rw> {
pub supply_in_profit: ValueFromHeight<M>,
pub supply_in_loss: ValueFromHeight<M>,
pub supply_in_profit: AmountFromHeight<M>,
pub supply_in_loss: AmountFromHeight<M>,
}
impl UnrealizedMinimal {
@@ -46,10 +46,10 @@ impl UnrealizedMinimal {
pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> {
vec![
&mut self.supply_in_profit.base.sats.height as &mut dyn AnyStoredVec,
&mut self.supply_in_profit.base.cents.height as &mut dyn AnyStoredVec,
&mut self.supply_in_loss.base.sats.height as &mut dyn AnyStoredVec,
&mut self.supply_in_loss.base.cents.height as &mut dyn AnyStoredVec,
&mut self.supply_in_profit.sats.height as &mut dyn AnyStoredVec,
&mut self.supply_in_profit.cents.height as &mut dyn AnyStoredVec,
&mut self.supply_in_loss.sats.height as &mut dyn AnyStoredVec,
&mut self.supply_in_loss.cents.height as &mut dyn AnyStoredVec,
]
}
@@ -59,8 +59,8 @@ impl UnrealizedMinimal {
others: &[&Self],
exit: &Exit,
) -> Result<()> {
sum_others!(self, starting_indexes, others, exit; supply_in_profit.base.sats.height);
sum_others!(self, starting_indexes, others, exit; supply_in_loss.base.sats.height);
sum_others!(self, starting_indexes, others, exit; supply_in_profit.sats.height);
sum_others!(self, starting_indexes, others, exit; supply_in_loss.sats.height);
Ok(())
}

View File

@@ -414,7 +414,7 @@ impl Vecs {
exit,
)?;
let window_starts = blocks.count.window_starts();
let window_starts = blocks.lookback.window_starts();
self.address_activity
.compute_rest(starting_indexes.height, &window_starts, exit)?;