mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-01 01:50:00 -07:00
global: sats version of all prices
This commit is contained in:
@@ -8,7 +8,7 @@ use crate::{
|
||||
ComputeIndexes,
|
||||
distribution::state::CohortState,
|
||||
indexes,
|
||||
internal::{ComputedFromHeightLast, CostBasisPercentiles},
|
||||
internal::{CostBasisPercentiles, PriceFromHeight},
|
||||
};
|
||||
|
||||
use super::ImportConfig;
|
||||
@@ -17,10 +17,10 @@ use super::ImportConfig;
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct CostBasisMetrics {
|
||||
/// Minimum cost basis for any UTXO at this height
|
||||
pub min: ComputedFromHeightLast<Dollars>,
|
||||
pub min: PriceFromHeight,
|
||||
|
||||
/// Maximum cost basis for any UTXO at this height
|
||||
pub max: ComputedFromHeightLast<Dollars>,
|
||||
pub max: PriceFromHeight,
|
||||
|
||||
/// Cost basis distribution percentiles (median, quartiles, etc.)
|
||||
pub percentiles: Option<CostBasisPercentiles>,
|
||||
@@ -32,13 +32,13 @@ impl CostBasisMetrics {
|
||||
let extended = cfg.extended();
|
||||
|
||||
Ok(Self {
|
||||
min: ComputedFromHeightLast::forced_import(
|
||||
min: PriceFromHeight::forced_import(
|
||||
cfg.db,
|
||||
&cfg.name("min_cost_basis"),
|
||||
cfg.version,
|
||||
cfg.indexes,
|
||||
)?,
|
||||
max: ComputedFromHeightLast::forced_import(
|
||||
max: PriceFromHeight::forced_import(
|
||||
cfg.db,
|
||||
&cfg.name("max_cost_basis"),
|
||||
cfg.version,
|
||||
|
||||
@@ -14,7 +14,8 @@ use crate::{
|
||||
internal::{
|
||||
ComputedFromHeightLast, ComputedFromHeightSum, ComputedFromHeightSumCum, ComputedFromDateLast,
|
||||
ComputedFromDateRatio, DollarsMinus, LazyBinaryFromHeightSum, LazyBinaryFromHeightSumCum,
|
||||
LazyFromHeightSum, LazyFromHeightSumCum, LazyFromDateLast, PercentageDollarsF32, StoredF32Identity,
|
||||
LazyFromHeightSum, LazyFromHeightSumCum, LazyFromDateLast, PercentageDollarsF32,
|
||||
PriceFromHeight, StoredF32Identity,
|
||||
},
|
||||
price,
|
||||
};
|
||||
@@ -26,7 +27,7 @@ use super::ImportConfig;
|
||||
pub struct RealizedMetrics {
|
||||
// === Realized Cap ===
|
||||
pub realized_cap: ComputedFromHeightLast<Dollars>,
|
||||
pub realized_price: ComputedFromHeightLast<Dollars>,
|
||||
pub realized_price: PriceFromHeight,
|
||||
pub realized_price_extra: ComputedFromDateRatio,
|
||||
pub realized_cap_rel_to_own_market_cap: Option<ComputedFromHeightLast<StoredF32>>,
|
||||
pub realized_cap_30d_delta: ComputedFromDateLast<Dollars>,
|
||||
@@ -169,7 +170,7 @@ impl RealizedMetrics {
|
||||
&realized_cap,
|
||||
);
|
||||
|
||||
let realized_price = ComputedFromHeightLast::forced_import(
|
||||
let realized_price = PriceFromHeight::forced_import(
|
||||
cfg.db,
|
||||
&cfg.name("realized_price"),
|
||||
cfg.version + v1,
|
||||
|
||||
Reference in New Issue
Block a user