global: snap

This commit is contained in:
nym21
2026-04-04 00:59:37 +02:00
parent 59c767a9e2
commit 883b38c77c
35 changed files with 86 additions and 65 deletions
@@ -119,7 +119,7 @@ impl AllCohortMetrics {
self.unrealized.compute(
starting_indexes.height,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized.price.cents.height,
exit,
)?;
@@ -139,7 +139,7 @@ impl AllCohortMetrics {
self.cost_basis.compute_prices(
starting_indexes,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.unrealized.invested_capital.in_profit.cents.height,
&self.unrealized.invested_capital.in_loss.cents.height,
&self.supply.in_profit.sats.height,
@@ -150,7 +150,7 @@ impl AllCohortMetrics {
)?;
self.unrealized
.compute_sentiment(starting_indexes, &prices.spot.cents.height, exit)?;
.compute_sentiment(starting_indexes, &prices.cached_spot_cents, exit)?;
self.relative.compute(
starting_indexes.height,
@@ -82,7 +82,7 @@ impl BasicCohortMetrics {
self.unrealized.compute(
starting_indexes.height,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized.price.cents.height,
exit,
)?;
@@ -140,7 +140,7 @@ impl CoreCohortMetrics {
self.unrealized.compute(
starting_indexes.height,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized.price.cents.height,
exit,
)?;
@@ -108,14 +108,14 @@ impl ExtendedCohortMetrics {
self.unrealized.compute(
starting_indexes.height,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized.price.cents.height,
exit,
)?;
self.cost_basis.compute_prices(
starting_indexes,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.unrealized.invested_capital.in_profit.cents.height,
&self.unrealized.invested_capital.in_loss.cents.height,
&self.supply.in_profit.sats.height,
@@ -126,7 +126,7 @@ impl ExtendedCohortMetrics {
)?;
self.unrealized
.compute_sentiment(starting_indexes, &prices.spot.cents.height, exit)?;
.compute_sentiment(starting_indexes, &prices.cached_spot_cents, exit)?;
self.relative.compute(
starting_indexes.height,
@@ -124,7 +124,7 @@ impl MinimalCohortMetrics {
self.unrealized.compute(
starting_indexes.height,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized.price.cents.height,
exit,
)?;
@@ -86,7 +86,7 @@ impl TypeCohortMetrics {
self.unrealized.compute(
starting_indexes.height,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized.price.cents.height,
exit,
)?;
@@ -126,7 +126,7 @@ impl ProfitabilityBucket {
self.unrealized_pnl.all.height.compute_transform3(
max_from,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized_cap.all.height,
&self.supply.all.sats.height,
|(i, spot, cap, supply, ..)| {
@@ -139,7 +139,7 @@ impl ProfitabilityBucket {
)?;
self.unrealized_pnl.sth.height.compute_transform3(
max_from,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized_cap.sth.height,
&self.supply.sth.sats.height,
|(i, spot, cap, supply, ..)| {
@@ -153,7 +153,7 @@ impl ProfitabilityBucket {
self.nupl.bps.height.compute_transform3(
max_from,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.realized_cap.all.height,
&self.supply.all.sats.height,
|(i, spot, cap_dollars, supply_sats, ..)| {
@@ -122,7 +122,7 @@ impl UnrealizedFull {
.compute_transform3(
starting_indexes.height,
supply_in_profit_sats,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.inner.basic.profit.cents.height,
|(h, supply_sats, spot, profit, ..): (_, Sats, Cents, Cents, _)| {
let market_value = supply_sats.as_u128() * spot.as_u128() / Sats::ONE_BTC_U128;
@@ -142,7 +142,7 @@ impl UnrealizedFull {
.compute_transform3(
starting_indexes.height,
supply_in_loss_sats,
&prices.spot.cents.height,
&prices.cached_spot_cents,
&self.inner.basic.loss.cents.height,
|(h, supply_sats, spot, loss, ..): (_, Sats, Cents, Cents, _)| {
let market_value = supply_sats.as_u128() * spot.as_u128() / Sats::ONE_BTC_U128;