global: snapshot

This commit is contained in:
nym21
2026-03-07 21:24:04 +01:00
parent ee59731ed2
commit a0efe491e5
12 changed files with 420 additions and 369 deletions

View File

@@ -950,7 +950,9 @@ pub struct CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSell
pub investor_price_ratio: BpsRatioPattern, pub investor_price_ratio: BpsRatioPattern,
pub investor_price_ratio_percentiles: RatioPattern, pub investor_price_ratio_percentiles: RatioPattern,
pub loss_value_created: MetricPattern1<Cents>, pub loss_value_created: MetricPattern1<Cents>,
pub loss_value_created_sum: _1m1w1y24hPattern<Cents>,
pub loss_value_destroyed: MetricPattern1<Cents>, pub loss_value_destroyed: MetricPattern1<Cents>,
pub loss_value_destroyed_sum: _1m1w1y24hPattern<Cents>,
pub lower_price_band: CentsSatsUsdPattern, pub lower_price_band: CentsSatsUsdPattern,
pub mvrv: MetricPattern1<StoredF32>, pub mvrv: MetricPattern1<StoredF32>,
pub neg_realized_loss: MetricPattern1<Dollars>, pub neg_realized_loss: MetricPattern1<Dollars>,
@@ -958,38 +960,39 @@ pub struct CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSell
pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern,
pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern,
pub net_realized_pnl: CumulativeHeightPattern<CentsSigned>, pub net_realized_pnl: CumulativeHeightPattern<CentsSigned>,
pub net_realized_pnl_ema_1w: MetricPattern1<CentsSigned>,
pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern,
pub peak_regret: CumulativeHeightPattern<Cents>, pub peak_regret: CumulativeHeightPattern<Cents>,
pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern, pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern,
pub profit_flow: MetricPattern1<Dollars>, pub profit_flow: MetricPattern1<Dollars>,
pub profit_value_created: MetricPattern1<Cents>, pub profit_value_created: MetricPattern1<Cents>,
pub profit_value_created_sum: _1m1w1y24hPattern<Cents>,
pub profit_value_destroyed: MetricPattern1<Cents>, pub profit_value_destroyed: MetricPattern1<Cents>,
pub profit_value_destroyed_sum: _1m1w1y24hPattern<Cents>,
pub realized_cap: MetricPattern1<Dollars>, pub realized_cap: MetricPattern1<Dollars>,
pub realized_cap_cents: MetricPattern1<Cents>, pub realized_cap_cents: MetricPattern1<Cents>,
pub realized_cap_change_1m: MetricPattern1<CentsSigned>, pub realized_cap_change_1m: MetricPattern1<CentsSigned>,
pub realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern, pub realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern,
pub realized_loss: CumulativeHeightPattern<Cents>, pub realized_loss: CumulativeHeightPattern<Cents>,
pub realized_loss_ema_1w: MetricPattern1<Cents>,
pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern,
pub realized_loss_sum: _1m1w1y24hPattern<Cents>, pub realized_loss_sum: _24hPattern<Cents>,
pub realized_loss_sum_extended: _1m1w1yPattern<Cents>,
pub realized_price: CentsSatsUsdPattern, pub realized_price: CentsSatsUsdPattern,
pub realized_price_ratio: BpsRatioPattern, pub realized_price_ratio: BpsRatioPattern,
pub realized_price_ratio_percentiles: RatioPattern, pub realized_price_ratio_percentiles: RatioPattern,
pub realized_price_ratio_std_dev: RatioPattern2, pub realized_price_ratio_std_dev: RatioPattern2,
pub realized_profit: CumulativeHeightPattern<Cents>, pub realized_profit: CumulativeHeightPattern<Cents>,
pub realized_profit_ema_1w: MetricPattern1<Cents>,
pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern,
pub realized_profit_sum: _1m1w1y24hPattern<Cents>, pub realized_profit_sum: _24hPattern<Cents>,
pub realized_profit_sum_extended: _1m1w1yPattern<Cents>,
pub realized_profit_to_loss_ratio: _1m1w1y24hPattern<StoredF64>, pub realized_profit_to_loss_ratio: _1m1w1y24hPattern<StoredF64>,
pub sell_side_risk_ratio: _1m1w1y24hPattern2, pub sell_side_risk_ratio: _1m1w1y24hPattern2,
pub sell_side_risk_ratio_24h_ema: _1m1wPattern2,
pub sent_in_loss: MetricPattern1<Sats>, pub sent_in_loss: MetricPattern1<Sats>,
pub sent_in_loss_sum: _1m1w1y24hPattern<Sats>, pub sent_in_loss_sum: _24hPattern<Sats>,
pub sent_in_loss_sum_extended: _1m1w1yPattern<Sats>,
pub sent_in_profit: MetricPattern1<Sats>, pub sent_in_profit: MetricPattern1<Sats>,
pub sent_in_profit_sum: _1m1w1y24hPattern<Sats>, pub sent_in_profit_sum: _24hPattern<Sats>,
pub sent_in_profit_sum_extended: _1m1w1yPattern<Sats>,
pub sopr: _24hPattern<StoredF64>, pub sopr: _24hPattern<StoredF64>,
pub sopr_24h_ema: _1m1wPattern,
pub sopr_extended: _1m1w1yPattern<StoredF64>, pub sopr_extended: _1m1w1yPattern<StoredF64>,
pub upper_price_band: CentsSatsUsdPattern, pub upper_price_band: CentsSatsUsdPattern,
pub value_created: MetricPattern1<Cents>, pub value_created: MetricPattern1<Cents>,
@@ -1013,7 +1016,9 @@ impl CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSo
investor_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), investor_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")),
investor_price_ratio_percentiles: RatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), investor_price_ratio_percentiles: RatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")),
loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")), loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")),
loss_value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "loss_value_created")),
loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")),
loss_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "loss_value_destroyed")),
lower_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), lower_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")),
mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")),
neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")),
@@ -1021,38 +1026,39 @@ impl CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSo
net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")), net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")),
net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")), net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")),
net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")),
net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")),
net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")),
peak_regret: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), peak_regret: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_peak_regret")),
peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_peak_regret_rel_to_realized_cap")), peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_peak_regret_rel_to_realized_cap")),
profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")), profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")),
profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")), profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")),
profit_value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "profit_value_created")),
profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")), profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")),
profit_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "profit_value_destroyed")),
realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")),
realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")),
realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")),
realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")), realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")),
realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")),
realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")),
realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")),
realized_loss_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_loss_sum: _24hPattern::new(client.clone(), _m(&acc, "realized_loss_24h")),
realized_loss_sum_extended: _1m1w1yPattern::new(client.clone(), _m(&acc, "realized_loss")),
realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")),
realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")),
realized_price_ratio_percentiles: RatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), realized_price_ratio_percentiles: RatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")),
realized_price_ratio_std_dev: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), realized_price_ratio_std_dev: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")),
realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")),
realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")),
realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")),
realized_profit_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_sum: _24hPattern::new(client.clone(), _m(&acc, "realized_profit_24h")),
realized_profit_sum_extended: _1m1w1yPattern::new(client.clone(), _m(&acc, "realized_profit")),
realized_profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), realized_profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")),
sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")),
sell_side_risk_ratio_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")),
sent_in_loss: MetricPattern1::new(client.clone(), _m(&acc, "sent_in_loss")), sent_in_loss: MetricPattern1::new(client.clone(), _m(&acc, "sent_in_loss")),
sent_in_loss_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sent_in_loss")), sent_in_loss_sum: _24hPattern::new(client.clone(), _m(&acc, "sent_in_loss_24h")),
sent_in_loss_sum_extended: _1m1w1yPattern::new(client.clone(), _m(&acc, "sent_in_loss")),
sent_in_profit: MetricPattern1::new(client.clone(), _m(&acc, "sent_in_profit")), sent_in_profit: MetricPattern1::new(client.clone(), _m(&acc, "sent_in_profit")),
sent_in_profit_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sent_in_profit")), sent_in_profit_sum: _24hPattern::new(client.clone(), _m(&acc, "sent_in_profit_24h")),
sent_in_profit_sum_extended: _1m1w1yPattern::new(client.clone(), _m(&acc, "sent_in_profit")),
sopr: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")), sopr: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")),
sopr_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sopr_24h_ema")),
sopr_extended: _1m1w1yPattern::new(client.clone(), _m(&acc, "sopr")), sopr_extended: _1m1w1yPattern::new(client.clone(), _m(&acc, "sopr")),
upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")),
value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")),
@@ -1133,6 +1139,60 @@ impl _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern {
} }
} }
/// Pattern struct for repeated tree structure.
pub struct MvrvNegNetRealizedSentSoprValuePattern {
pub mvrv: MetricPattern1<StoredF32>,
pub neg_realized_loss: MetricPattern1<Dollars>,
pub net_realized_pnl: CumulativeHeightPattern<CentsSigned>,
pub realized_cap: MetricPattern1<Dollars>,
pub realized_cap_cents: MetricPattern1<Cents>,
pub realized_cap_change_1m: MetricPattern1<CentsSigned>,
pub realized_loss: CumulativeHeightPattern<Cents>,
pub realized_loss_sum: _24hPattern<Cents>,
pub realized_price: CentsSatsUsdPattern,
pub realized_price_ratio: BpsRatioPattern,
pub realized_profit: CumulativeHeightPattern<Cents>,
pub realized_profit_sum: _24hPattern<Cents>,
pub sent_in_loss: MetricPattern1<Sats>,
pub sent_in_loss_sum: _24hPattern<Sats>,
pub sent_in_profit: MetricPattern1<Sats>,
pub sent_in_profit_sum: _24hPattern<Sats>,
pub sopr: _24hPattern<StoredF64>,
pub value_created: MetricPattern1<Cents>,
pub value_created_sum: _24hPattern<Cents>,
pub value_destroyed: MetricPattern1<Cents>,
pub value_destroyed_sum: _24hPattern<Cents>,
}
impl MvrvNegNetRealizedSentSoprValuePattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")),
neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")),
net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")),
realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")),
realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")),
realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")),
realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")),
realized_loss_sum: _24hPattern::new(client.clone(), _m(&acc, "realized_loss_24h")),
realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")),
realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")),
realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")),
realized_profit_sum: _24hPattern::new(client.clone(), _m(&acc, "realized_profit_24h")),
sent_in_loss: MetricPattern1::new(client.clone(), _m(&acc, "sent_in_loss")),
sent_in_loss_sum: _24hPattern::new(client.clone(), _m(&acc, "sent_in_loss_24h")),
sent_in_profit: MetricPattern1::new(client.clone(), _m(&acc, "sent_in_profit")),
sent_in_profit_sum: _24hPattern::new(client.clone(), _m(&acc, "sent_in_profit_24h")),
sopr: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")),
value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")),
value_created_sum: _24hPattern::new(client.clone(), _m(&acc, "value_created_24h")),
value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")),
value_destroyed_sum: _24hPattern::new(client.clone(), _m(&acc, "value_destroyed_24h")),
}
}
}
/// Pattern struct for repeated tree structure. /// Pattern struct for repeated tree structure.
pub struct Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern { pub struct Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern {
pub pct05: CentsSatsUsdPattern, pub pct05: CentsSatsUsdPattern,
@@ -1184,7 +1244,7 @@ impl Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75
} }
/// Pattern struct for repeated tree structure. /// Pattern struct for repeated tree structure.
pub struct MvrvNegNetRealizedSentSoprValuePattern { pub struct MvrvNegNetRealizedSoprValuePattern {
pub mvrv: MetricPattern1<StoredF32>, pub mvrv: MetricPattern1<StoredF32>,
pub neg_realized_loss: MetricPattern1<Dollars>, pub neg_realized_loss: MetricPattern1<Dollars>,
pub net_realized_pnl: CumulativeHeightPattern<CentsSigned>, pub net_realized_pnl: CumulativeHeightPattern<CentsSigned>,
@@ -1192,11 +1252,11 @@ pub struct MvrvNegNetRealizedSentSoprValuePattern {
pub realized_cap_cents: MetricPattern1<Cents>, pub realized_cap_cents: MetricPattern1<Cents>,
pub realized_cap_change_1m: MetricPattern1<CentsSigned>, pub realized_cap_change_1m: MetricPattern1<CentsSigned>,
pub realized_loss: CumulativeHeightPattern<Cents>, pub realized_loss: CumulativeHeightPattern<Cents>,
pub realized_loss_sum: _24hPattern<Cents>,
pub realized_price: CentsSatsUsdPattern, pub realized_price: CentsSatsUsdPattern,
pub realized_price_ratio: BpsRatioPattern, pub realized_price_ratio: BpsRatioPattern,
pub realized_profit: CumulativeHeightPattern<Cents>, pub realized_profit: CumulativeHeightPattern<Cents>,
pub sent_in_loss: MetricPattern1<Sats>, pub realized_profit_sum: _24hPattern<Cents>,
pub sent_in_profit: MetricPattern1<Sats>,
pub sopr: _24hPattern<StoredF64>, pub sopr: _24hPattern<StoredF64>,
pub value_created: MetricPattern1<Cents>, pub value_created: MetricPattern1<Cents>,
pub value_created_sum: _24hPattern<Cents>, pub value_created_sum: _24hPattern<Cents>,
@@ -1204,7 +1264,7 @@ pub struct MvrvNegNetRealizedSentSoprValuePattern {
pub value_destroyed_sum: _24hPattern<Cents>, pub value_destroyed_sum: _24hPattern<Cents>,
} }
impl MvrvNegNetRealizedSentSoprValuePattern { impl MvrvNegNetRealizedSoprValuePattern {
/// Create a new pattern node with accumulated metric name. /// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self { pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self { Self {
@@ -1215,11 +1275,11 @@ impl MvrvNegNetRealizedSentSoprValuePattern {
realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")),
realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")),
realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")),
realized_loss_sum: _24hPattern::new(client.clone(), _m(&acc, "realized_loss_24h")),
realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")),
realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")),
realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")),
sent_in_loss: MetricPattern1::new(client.clone(), _m(&acc, "sent_in_loss")), realized_profit_sum: _24hPattern::new(client.clone(), _m(&acc, "realized_profit_24h")),
sent_in_profit: MetricPattern1::new(client.clone(), _m(&acc, "sent_in_profit")),
sopr: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")), sopr: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")),
value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")),
value_created_sum: _24hPattern::new(client.clone(), _m(&acc, "value_created_24h")), value_created_sum: _24hPattern::new(client.clone(), _m(&acc, "value_created_24h")),
@@ -1317,48 +1377,6 @@ impl GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern {
} }
} }
/// Pattern struct for repeated tree structure.
pub struct MvrvNegNetRealizedSoprValuePattern {
pub mvrv: MetricPattern1<StoredF32>,
pub neg_realized_loss: MetricPattern1<Dollars>,
pub net_realized_pnl: CumulativeHeightPattern<CentsSigned>,
pub realized_cap: MetricPattern1<Dollars>,
pub realized_cap_cents: MetricPattern1<Cents>,
pub realized_cap_change_1m: MetricPattern1<CentsSigned>,
pub realized_loss: CumulativeHeightPattern<Cents>,
pub realized_price: CentsSatsUsdPattern,
pub realized_price_ratio: BpsRatioPattern,
pub realized_profit: CumulativeHeightPattern<Cents>,
pub sopr: _24hPattern<StoredF64>,
pub value_created: MetricPattern1<Cents>,
pub value_created_sum: _24hPattern<Cents>,
pub value_destroyed: MetricPattern1<Cents>,
pub value_destroyed_sum: _24hPattern<Cents>,
}
impl MvrvNegNetRealizedSoprValuePattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")),
neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")),
net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")),
realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")),
realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")),
realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")),
realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")),
realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")),
realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")),
realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")),
sopr: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")),
value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")),
value_created_sum: _24hPattern::new(client.clone(), _m(&acc, "value_created_24h")),
value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")),
value_destroyed_sum: _24hPattern::new(client.clone(), _m(&acc, "value_destroyed_24h")),
}
}
}
/// Pattern struct for repeated tree structure. /// Pattern struct for repeated tree structure.
pub struct NetNuplSupplyUnrealizedPattern2 { pub struct NetNuplSupplyUnrealizedPattern2 {
pub net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern, pub net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern,
@@ -1769,6 +1787,36 @@ impl AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern {
} }
} }
/// Pattern struct for repeated tree structure.
pub struct MvrvRealizedPattern {
pub mvrv: MetricPattern1<StoredF32>,
pub realized_cap: MetricPattern1<Dollars>,
pub realized_cap_cents: MetricPattern1<Cents>,
pub realized_loss: CumulativeHeightPattern<Cents>,
pub realized_loss_sum: _24hPattern<Cents>,
pub realized_price: CentsSatsUsdPattern,
pub realized_price_ratio: BpsRatioPattern,
pub realized_profit: CumulativeHeightPattern<Cents>,
pub realized_profit_sum: _24hPattern<Cents>,
}
impl MvrvRealizedPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")),
realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")),
realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")),
realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")),
realized_loss_sum: _24hPattern::new(client.clone(), _m(&acc, "realized_loss_24h")),
realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")),
realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")),
realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")),
realized_profit_sum: _24hPattern::new(client.clone(), _m(&acc, "realized_profit_24h")),
}
}
}
/// Pattern struct for repeated tree structure. /// Pattern struct for repeated tree structure.
pub struct _1m1w1y24hBtcCentsSatsUsdPattern { pub struct _1m1w1y24hBtcCentsSatsUsdPattern {
pub _1m: BtcCentsSatsUsdPattern, pub _1m: BtcCentsSatsUsdPattern,
@@ -1931,32 +1979,6 @@ impl ActivityAddrOutputsRealizedSupplyUnrealizedPattern {
} }
} }
/// Pattern struct for repeated tree structure.
pub struct MvrvRealizedPattern {
pub mvrv: MetricPattern1<StoredF32>,
pub realized_cap: MetricPattern1<Dollars>,
pub realized_cap_cents: MetricPattern1<Cents>,
pub realized_loss: CumulativeHeightPattern<Cents>,
pub realized_price: CentsSatsUsdPattern,
pub realized_price_ratio: BpsRatioPattern,
pub realized_profit: CumulativeHeightPattern<Cents>,
}
impl MvrvRealizedPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")),
realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")),
realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")),
realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")),
realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")),
realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")),
realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")),
}
}
}
/// Pattern struct for repeated tree structure. /// Pattern struct for repeated tree structure.
pub struct ActivityOutputsRealizedRelativeSupplyUnrealizedPattern { pub struct ActivityOutputsRealizedRelativeSupplyUnrealizedPattern {
pub activity: SentPattern, pub activity: SentPattern,
@@ -2453,38 +2475,6 @@ impl<T: DeserializeOwned> CumulativeHeightSumPattern<T> {
} }
} }
/// Pattern struct for repeated tree structure.
pub struct _1m1wPattern2 {
pub _1m: BpsPercentRatioPattern,
pub _1w: BpsPercentRatioPattern,
}
impl _1m1wPattern2 {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
_1m: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1m")),
_1w: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1w")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct _1m1wPattern {
pub _1m: MetricPattern1<StoredF64>,
pub _1w: MetricPattern1<StoredF64>,
}
impl _1m1wPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
_1m: MetricPattern1::new(client.clone(), _m(&acc, "1m")),
_1w: MetricPattern1::new(client.clone(), _m(&acc, "1w")),
}
}
}
/// Pattern struct for repeated tree structure. /// Pattern struct for repeated tree structure.
pub struct BaseCumulativePattern { pub struct BaseCumulativePattern {
pub base: BtcCentsSatsUsdPattern, pub base: BtcCentsSatsUsdPattern,
@@ -5567,7 +5557,6 @@ pub struct MetricsTree_Distribution_UtxoCohorts_All_Adjusted {
pub adjusted_value_created_sum: _1m1w1y24hPattern<Cents>, pub adjusted_value_created_sum: _1m1w1y24hPattern<Cents>,
pub adjusted_value_destroyed_sum: _1m1w1y24hPattern<Cents>, pub adjusted_value_destroyed_sum: _1m1w1y24hPattern<Cents>,
pub adjusted_sopr: _1m1w1y24hPattern<StoredF64>, pub adjusted_sopr: _1m1w1y24hPattern<StoredF64>,
pub adjusted_sopr_ema: _1m1wPattern,
} }
impl MetricsTree_Distribution_UtxoCohorts_All_Adjusted { impl MetricsTree_Distribution_UtxoCohorts_All_Adjusted {
@@ -5578,7 +5567,6 @@ impl MetricsTree_Distribution_UtxoCohorts_All_Adjusted {
adjusted_value_created_sum: _1m1w1y24hPattern::new(client.clone(), "adjusted_value_created".to_string()), adjusted_value_created_sum: _1m1w1y24hPattern::new(client.clone(), "adjusted_value_created".to_string()),
adjusted_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), "adjusted_value_destroyed".to_string()), adjusted_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), "adjusted_value_destroyed".to_string()),
adjusted_sopr: _1m1w1y24hPattern::new(client.clone(), "adjusted_sopr".to_string()), adjusted_sopr: _1m1w1y24hPattern::new(client.clone(), "adjusted_sopr".to_string()),
adjusted_sopr_ema: _1m1wPattern::new(client.clone(), "adjusted_sopr_24h_ema".to_string()),
} }
} }
} }
@@ -5628,7 +5616,6 @@ pub struct MetricsTree_Distribution_UtxoCohorts_Sth {
pub adjusted_value_created_sum: _1m1w1y24hPattern<Cents>, pub adjusted_value_created_sum: _1m1w1y24hPattern<Cents>,
pub adjusted_value_destroyed_sum: _1m1w1y24hPattern<Cents>, pub adjusted_value_destroyed_sum: _1m1w1y24hPattern<Cents>,
pub adjusted_sopr: _1m1w1y24hPattern<StoredF64>, pub adjusted_sopr: _1m1w1y24hPattern<StoredF64>,
pub adjusted_sopr_ema: _1m1wPattern,
} }
impl MetricsTree_Distribution_UtxoCohorts_Sth { impl MetricsTree_Distribution_UtxoCohorts_Sth {
@@ -5648,7 +5635,6 @@ impl MetricsTree_Distribution_UtxoCohorts_Sth {
adjusted_value_created_sum: _1m1w1y24hPattern::new(client.clone(), "sth_adjusted_value_created".to_string()), adjusted_value_created_sum: _1m1w1y24hPattern::new(client.clone(), "sth_adjusted_value_created".to_string()),
adjusted_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), "sth_adjusted_value_destroyed".to_string()), adjusted_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), "sth_adjusted_value_destroyed".to_string()),
adjusted_sopr: _1m1w1y24hPattern::new(client.clone(), "sth_adjusted_sopr".to_string()), adjusted_sopr: _1m1w1y24hPattern::new(client.clone(), "sth_adjusted_sopr".to_string()),
adjusted_sopr_ema: _1m1wPattern::new(client.clone(), "sth_adjusted_sopr_24h_ema".to_string()),
} }
} }
} }

View File

@@ -115,7 +115,7 @@ impl CoreCohortMetrics {
.compute_rest_part1(blocks, starting_indexes, exit)?; .compute_rest_part1(blocks, starting_indexes, exit)?;
self.realized self.realized
.compute_rest_part1(starting_indexes, exit)?; .compute_rest_part1(blocks, starting_indexes, exit)?;
self.unrealized.compute_rest(starting_indexes, exit)?; self.unrealized.compute_rest(starting_indexes, exit)?;

View File

@@ -193,7 +193,7 @@ impl MinimalCohortMetrics {
self.activity self.activity
.compute_rest_part1(blocks, starting_indexes, exit)?; .compute_rest_part1(blocks, starting_indexes, exit)?;
self.realized self.realized
.compute_rest_part1(starting_indexes, exit)?; .compute_rest_part1(blocks, starting_indexes, exit)?;
self.unrealized self.unrealized
.compute_rest(prices, starting_indexes.height, exit)?; .compute_rest(prices, starting_indexes.height, exit)?;
Ok(()) Ok(())

View File

@@ -208,7 +208,7 @@ pub trait CohortMetricsBase: CohortMetricsState<Realized = RealizedState> + Send
.compute_rest_part1(blocks, starting_indexes, exit)?; .compute_rest_part1(blocks, starting_indexes, exit)?;
self.realized_mut() self.realized_mut()
.compute_rest_part1(starting_indexes, exit)?; .compute_rest_part1(blocks, starting_indexes, exit)?;
self.unrealized_mut() self.unrealized_mut()
.compute_rest(prices, starting_indexes, exit)?; .compute_rest(prices, starting_indexes, exit)?;

View File

@@ -5,8 +5,9 @@ use derive_more::{Deref, DerefMut};
use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec}; use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec};
use crate::{ use crate::{
blocks,
distribution::state::RealizedOps, distribution::state::RealizedOps,
internal::ComputedFromHeight, internal::{ComputedFromHeight, RollingWindow24h},
}; };
use crate::distribution::metrics::ImportConfig; use crate::distribution::metrics::ImportConfig;
@@ -22,6 +23,9 @@ pub struct RealizedBase<M: StorageMode = Rw> {
pub sent_in_profit: ComputedFromHeight<Sats, M>, pub sent_in_profit: ComputedFromHeight<Sats, M>,
pub sent_in_loss: ComputedFromHeight<Sats, M>, pub sent_in_loss: ComputedFromHeight<Sats, M>,
pub sent_in_profit_sum: RollingWindow24h<Sats, M>,
pub sent_in_loss_sum: RollingWindow24h<Sats, M>,
} }
impl RealizedBase { impl RealizedBase {
@@ -32,6 +36,8 @@ impl RealizedBase {
core: RealizedCore::forced_import(cfg)?, core: RealizedCore::forced_import(cfg)?,
sent_in_profit: cfg.import("sent_in_profit", v1)?, sent_in_profit: cfg.import("sent_in_profit", v1)?,
sent_in_loss: cfg.import("sent_in_loss", v1)?, sent_in_loss: cfg.import("sent_in_loss", v1)?,
sent_in_profit_sum: cfg.import("sent_in_profit", v1)?,
sent_in_loss_sum: cfg.import("sent_in_loss", v1)?,
}) })
} }
@@ -78,9 +84,23 @@ impl RealizedBase {
pub(crate) fn compute_rest_part1( pub(crate) fn compute_rest_part1(
&mut self, &mut self,
blocks: &blocks::Vecs,
starting_indexes: &Indexes, starting_indexes: &Indexes,
exit: &Exit, exit: &Exit,
) -> Result<()> { ) -> Result<()> {
self.core.compute_rest_part1(starting_indexes, exit) 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,
&self.sent_in_profit.height,
exit,
)?;
self.sent_in_loss_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&self.sent_in_loss.height,
exit,
)?;
Ok(())
} }
} }

View File

@@ -117,10 +117,11 @@ impl RealizedCore {
pub(crate) fn compute_rest_part1( pub(crate) fn compute_rest_part1(
&mut self, &mut self,
blocks: &blocks::Vecs,
starting_indexes: &Indexes, starting_indexes: &Indexes,
exit: &Exit, exit: &Exit,
) -> Result<()> { ) -> Result<()> {
self.minimal.compute_rest_part1(starting_indexes, exit)?; self.minimal.compute_rest_part1(blocks, starting_indexes, exit)?;
self.net_realized_pnl self.net_realized_pnl
.compute(starting_indexes.height, exit, |vec| { .compute(starting_indexes.height, exit, |vec| {

View File

@@ -46,6 +46,11 @@ pub struct RealizedFull<M: StorageMode = Rw> {
pub loss_value_created: ComputedFromHeight<Cents, M>, pub loss_value_created: ComputedFromHeight<Cents, M>,
pub loss_value_destroyed: ComputedFromHeight<Cents, M>, pub loss_value_destroyed: ComputedFromHeight<Cents, M>,
pub profit_value_created_sum: RollingWindows<Cents, M>,
pub profit_value_destroyed_sum: RollingWindows<Cents, M>,
pub loss_value_created_sum: RollingWindows<Cents, M>,
pub loss_value_destroyed_sum: RollingWindows<Cents, M>,
pub capitulation_flow: LazyFromHeight<Dollars, Cents>, pub capitulation_flow: LazyFromHeight<Dollars, Cents>,
pub profit_flow: LazyFromHeight<Dollars, Cents>, pub profit_flow: LazyFromHeight<Dollars, Cents>,
@@ -71,16 +76,16 @@ pub struct RealizedFull<M: StorageMode = Rw> {
pub realized_cap_rel_to_own_market_cap: PercentFromHeight<BasisPoints32, M>, pub realized_cap_rel_to_own_market_cap: PercentFromHeight<BasisPoints32, M>,
pub realized_profit_sum: RollingWindows<Cents, M>, pub realized_profit_sum_extended: RollingWindowsFrom1w<Cents, M>,
pub realized_loss_sum: RollingWindows<Cents, M>, pub realized_loss_sum_extended: RollingWindowsFrom1w<Cents, M>,
pub realized_profit_to_loss_ratio: RollingWindows<StoredF64, M>, pub realized_profit_to_loss_ratio: RollingWindows<StoredF64, M>,
pub value_created_sum_extended: RollingWindowsFrom1w<Cents, M>, pub value_created_sum_extended: RollingWindowsFrom1w<Cents, M>,
pub value_destroyed_sum_extended: RollingWindowsFrom1w<Cents, M>, pub value_destroyed_sum_extended: RollingWindowsFrom1w<Cents, M>,
pub sopr_extended: RollingWindowsFrom1w<StoredF64, M>, pub sopr_extended: RollingWindowsFrom1w<StoredF64, M>,
pub sent_in_profit_sum: RollingWindows<Sats, M>, pub sent_in_profit_sum_extended: RollingWindowsFrom1w<Sats, M>,
pub sent_in_loss_sum: RollingWindows<Sats, M>, pub sent_in_loss_sum_extended: RollingWindowsFrom1w<Sats, M>,
pub realized_price_ratio_percentiles: ComputedFromHeightRatioPercentiles<M>, pub realized_price_ratio_percentiles: ComputedFromHeightRatioPercentiles<M>,
pub realized_price_ratio_std_dev: ComputedFromHeightRatioStdDevBands<M>, pub realized_price_ratio_std_dev: ComputedFromHeightRatioStdDevBands<M>,
@@ -103,6 +108,11 @@ impl RealizedFull {
let loss_value_destroyed: ComputedFromHeight<Cents> = let loss_value_destroyed: ComputedFromHeight<Cents> =
cfg.import("loss_value_destroyed", v0)?; cfg.import("loss_value_destroyed", v0)?;
let profit_value_created_sum = cfg.import("profit_value_created", v1)?;
let profit_value_destroyed_sum = cfg.import("profit_value_destroyed", v1)?;
let loss_value_created_sum = cfg.import("loss_value_created", v1)?;
let loss_value_destroyed_sum = cfg.import("loss_value_destroyed", v1)?;
let capitulation_flow = LazyFromHeight::from_computed::<CentsUnsignedToDollars>( let capitulation_flow = LazyFromHeight::from_computed::<CentsUnsignedToDollars>(
&cfg.name("capitulation_flow"), &cfg.name("capitulation_flow"),
cfg.version, cfg.version,
@@ -159,6 +169,10 @@ impl RealizedFull {
profit_value_destroyed, profit_value_destroyed,
loss_value_created, loss_value_created,
loss_value_destroyed, loss_value_destroyed,
profit_value_created_sum,
profit_value_destroyed_sum,
loss_value_created_sum,
loss_value_destroyed_sum,
capitulation_flow, capitulation_flow,
profit_flow, profit_flow,
gross_pnl_sum, gross_pnl_sum,
@@ -178,15 +192,15 @@ impl RealizedFull {
peak_regret_rel_to_realized_cap, peak_regret_rel_to_realized_cap,
realized_cap_rel_to_own_market_cap: cfg realized_cap_rel_to_own_market_cap: cfg
.import("realized_cap_rel_to_own_market_cap", v1)?, .import("realized_cap_rel_to_own_market_cap", v1)?,
realized_profit_sum: cfg.import("realized_profit", v1)?, realized_profit_sum_extended: cfg.import("realized_profit", v1)?,
realized_loss_sum: cfg.import("realized_loss", v1)?, realized_loss_sum_extended: cfg.import("realized_loss", v1)?,
realized_profit_to_loss_ratio: cfg realized_profit_to_loss_ratio: cfg
.import("realized_profit_to_loss_ratio", v1)?, .import("realized_profit_to_loss_ratio", v1)?,
value_created_sum_extended, value_created_sum_extended,
value_destroyed_sum_extended, value_destroyed_sum_extended,
sopr_extended, sopr_extended,
sent_in_profit_sum: cfg.import("sent_in_profit", v1)?, sent_in_profit_sum_extended: cfg.import("sent_in_profit", v1)?,
sent_in_loss_sum: cfg.import("sent_in_loss", v1)?, sent_in_loss_sum_extended: cfg.import("sent_in_loss", v1)?,
realized_price_ratio_percentiles: ComputedFromHeightRatioPercentiles::forced_import( realized_price_ratio_percentiles: ComputedFromHeightRatioPercentiles::forced_import(
cfg.db, cfg.db,
&realized_price_name, &realized_price_name,
@@ -276,10 +290,11 @@ impl RealizedFull {
pub(crate) fn compute_rest_part1( pub(crate) fn compute_rest_part1(
&mut self, &mut self,
blocks: &blocks::Vecs,
starting_indexes: &Indexes, starting_indexes: &Indexes,
exit: &Exit, exit: &Exit,
) -> Result<()> { ) -> Result<()> {
self.base.compute_rest_part1(starting_indexes, exit)?; self.base.compute_rest_part1(blocks, starting_indexes, exit)?;
self.peak_regret self.peak_regret
.compute_rest(starting_indexes.height, exit)?; .compute_rest(starting_indexes.height, exit)?;
Ok(()) Ok(())
@@ -302,8 +317,9 @@ impl RealizedFull {
exit, exit,
)?; )?;
// Extended rolling windows (1w, 1m, 1y) for value_created/destroyed/sopr
let window_starts = blocks.count.window_starts(); let window_starts = blocks.count.window_starts();
// Extended rolling windows (1w, 1m, 1y) for value_created/destroyed/sopr
self.value_created_sum_extended.compute_rolling_sum( self.value_created_sum_extended.compute_rolling_sum(
starting_indexes.height, starting_indexes.height,
&window_starts, &window_starts,
@@ -354,21 +370,46 @@ impl RealizedFull {
exit, exit,
)?; )?;
// Sent in profit/loss rolling sums // Sent in profit/loss extended rolling sums (1w, 1m, 1y)
let window_starts = blocks.count.window_starts(); self.sent_in_profit_sum_extended.compute_rolling_sum(
self.sent_in_profit_sum.compute_rolling_sum(
starting_indexes.height, starting_indexes.height,
&window_starts, &window_starts,
&self.base.sent_in_profit.height, &self.base.sent_in_profit.height,
exit, exit,
)?; )?;
self.sent_in_loss_sum.compute_rolling_sum( self.sent_in_loss_sum_extended.compute_rolling_sum(
starting_indexes.height, starting_indexes.height,
&window_starts, &window_starts,
&self.base.sent_in_loss.height, &self.base.sent_in_loss.height,
exit, exit,
)?; )?;
// Profit/loss value created/destroyed rolling sums
self.profit_value_created_sum.compute_rolling_sum(
starting_indexes.height,
&window_starts,
&self.profit_value_created.height,
exit,
)?;
self.profit_value_destroyed_sum.compute_rolling_sum(
starting_indexes.height,
&window_starts,
&self.profit_value_destroyed.height,
exit,
)?;
self.loss_value_created_sum.compute_rolling_sum(
starting_indexes.height,
&window_starts,
&self.loss_value_created.height,
exit,
)?;
self.loss_value_destroyed_sum.compute_rolling_sum(
starting_indexes.height,
&window_starts,
&self.loss_value_destroyed.height,
exit,
)?;
// Gross PnL // Gross PnL
self.gross_pnl.cents.height.compute_add( self.gross_pnl.cents.height.compute_add(
starting_indexes.height, starting_indexes.height,
@@ -377,7 +418,6 @@ impl RealizedFull {
exit, exit,
)?; )?;
let window_starts = blocks.count.window_starts();
self.gross_pnl_sum.compute_rolling_sum( self.gross_pnl_sum.compute_rolling_sum(
starting_indexes.height, starting_indexes.height,
&window_starts, &window_starts,
@@ -471,15 +511,14 @@ impl RealizedFull {
)?; )?;
} }
// Extended: realized profit/loss rolling sums // Extended: realized profit/loss rolling sums (1w, 1m, 1y)
let window_starts = blocks.count.window_starts(); self.realized_profit_sum_extended.compute_rolling_sum(
self.realized_profit_sum.compute_rolling_sum(
starting_indexes.height, starting_indexes.height,
&window_starts, &window_starts,
&self.base.core.minimal.realized_profit.height, &self.base.core.minimal.realized_profit.height,
exit, exit,
)?; )?;
self.realized_loss_sum.compute_rolling_sum( self.realized_loss_sum_extended.compute_rolling_sum(
starting_indexes.height, starting_indexes.height,
&window_starts, &window_starts,
&self.base.core.minimal.realized_loss.height, &self.base.core.minimal.realized_loss.height,
@@ -496,12 +535,18 @@ impl RealizedFull {
)?; )?;
// Realized profit to loss ratios // Realized profit to loss ratios
self.realized_profit_to_loss_ratio._24h.compute_binary::<Cents, Cents, RatioCents64>(
starting_indexes.height,
&self.base.core.minimal.realized_profit_sum._24h.height,
&self.base.core.minimal.realized_loss_sum._24h.height,
exit,
)?;
for ((ratio, profit), loss) in self for ((ratio, profit), loss) in self
.realized_profit_to_loss_ratio .realized_profit_to_loss_ratio
.as_mut_array() .as_mut_array_from_1w()
.into_iter() .into_iter()
.zip(self.realized_profit_sum.as_array()) .zip(self.realized_profit_sum_extended.as_array())
.zip(self.realized_loss_sum.as_array()) .zip(self.realized_loss_sum_extended.as_array())
{ {
ratio.compute_binary::<Cents, Cents, RatioCents64>( ratio.compute_binary::<Cents, Cents, RatioCents64>(
starting_indexes.height, starting_indexes.height,

View File

@@ -6,10 +6,11 @@ use brk_types::{
use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, WritableVec}; use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, WritableVec};
use crate::{ use crate::{
blocks,
distribution::state::RealizedOps, distribution::state::RealizedOps,
internal::{ internal::{
CentsUnsignedToDollars, ComputedFromHeight, ComputedFromHeightCumulative, CentsUnsignedToDollars, ComputedFromHeight, ComputedFromHeightCumulative,
ComputedFromHeightRatio, Identity, LazyFromHeight, Price, ComputedFromHeightRatio, Identity, LazyFromHeight, Price, RollingWindow24h,
}, },
prices, prices,
}; };
@@ -25,6 +26,9 @@ pub struct RealizedMinimal<M: StorageMode = Rw> {
pub realized_price: Price<ComputedFromHeight<Cents, M>>, pub realized_price: Price<ComputedFromHeight<Cents, M>>,
pub realized_price_ratio: ComputedFromHeightRatio<M>, pub realized_price_ratio: ComputedFromHeightRatio<M>,
pub mvrv: LazyFromHeight<StoredF32>, pub mvrv: LazyFromHeight<StoredF32>,
pub realized_profit_sum: RollingWindow24h<Cents, M>,
pub realized_loss_sum: RollingWindow24h<Cents, M>,
} }
impl RealizedMinimal { impl RealizedMinimal {
@@ -50,6 +54,9 @@ impl RealizedMinimal {
&realized_price_ratio.ratio, &realized_price_ratio.ratio,
); );
let realized_profit_sum = cfg.import("realized_profit", Version::ONE)?;
let realized_loss_sum = cfg.import("realized_loss", Version::ONE)?;
Ok(Self { Ok(Self {
realized_cap_cents, realized_cap_cents,
realized_profit, realized_profit,
@@ -58,6 +65,8 @@ impl RealizedMinimal {
realized_price, realized_price,
realized_price_ratio, realized_price_ratio,
mvrv, mvrv,
realized_profit_sum,
realized_loss_sum,
}) })
} }
@@ -108,6 +117,7 @@ impl RealizedMinimal {
pub(crate) fn compute_rest_part1( pub(crate) fn compute_rest_part1(
&mut self, &mut self,
blocks: &blocks::Vecs,
starting_indexes: &Indexes, starting_indexes: &Indexes,
exit: &Exit, exit: &Exit,
) -> Result<()> { ) -> Result<()> {
@@ -115,6 +125,18 @@ impl RealizedMinimal {
.compute_rest(starting_indexes.height, exit)?; .compute_rest(starting_indexes.height, exit)?;
self.realized_loss self.realized_loss
.compute_rest(starting_indexes.height, exit)?; .compute_rest(starting_indexes.height, exit)?;
self.realized_profit_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&self.realized_profit.height,
exit,
)?;
self.realized_loss_sum.compute_rolling_sum(
starting_indexes.height,
&blocks.count.height_24h_ago,
&self.realized_loss.height,
exit,
)?;
Ok(()) Ok(())
} }

View File

@@ -14,7 +14,7 @@ use brk_error::Result;
use brk_types::{Height, Indexes}; use brk_types::{Height, Indexes};
use vecdb::Exit; use vecdb::Exit;
use crate::distribution::state::RealizedState; use crate::{blocks, distribution::state::RealizedState};
/// Polymorphic dispatch for realized metric types. /// Polymorphic dispatch for realized metric types.
/// ///
@@ -26,7 +26,7 @@ pub trait RealizedLike: Send + Sync {
fn as_base_mut(&mut self) -> &mut RealizedBase; fn as_base_mut(&mut self) -> &mut RealizedBase;
fn min_stateful_height_len(&self) -> usize; fn min_stateful_height_len(&self) -> usize;
fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()>; fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()>;
fn compute_rest_part1(&mut self, starting_indexes: &Indexes, exit: &Exit) -> Result<()>; fn compute_rest_part1(&mut self, blocks: &blocks::Vecs, starting_indexes: &Indexes, exit: &Exit) -> Result<()>;
fn compute_from_stateful( fn compute_from_stateful(
&mut self, &mut self,
starting_indexes: &Indexes, starting_indexes: &Indexes,
@@ -42,8 +42,8 @@ impl RealizedLike for RealizedBase {
fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()> { fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()> {
self.truncate_push(height, state) self.truncate_push(height, state)
} }
fn compute_rest_part1(&mut self, starting_indexes: &Indexes, exit: &Exit) -> Result<()> { fn compute_rest_part1(&mut self, blocks: &blocks::Vecs, starting_indexes: &Indexes, exit: &Exit) -> Result<()> {
self.compute_rest_part1(starting_indexes, exit) self.compute_rest_part1(blocks, starting_indexes, exit)
} }
fn compute_from_stateful(&mut self, starting_indexes: &Indexes, others: &[&RealizedBase], exit: &Exit) -> Result<()> { fn compute_from_stateful(&mut self, starting_indexes: &Indexes, others: &[&RealizedBase], exit: &Exit) -> Result<()> {
self.compute_from_stateful(starting_indexes, others, exit) self.compute_from_stateful(starting_indexes, others, exit)
@@ -57,8 +57,8 @@ impl RealizedLike for RealizedFull {
fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()> { fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()> {
self.truncate_push(height, state) self.truncate_push(height, state)
} }
fn compute_rest_part1(&mut self, starting_indexes: &Indexes, exit: &Exit) -> Result<()> { fn compute_rest_part1(&mut self, blocks: &blocks::Vecs, starting_indexes: &Indexes, exit: &Exit) -> Result<()> {
self.compute_rest_part1(starting_indexes, exit) self.compute_rest_part1(blocks, starting_indexes, exit)
} }
fn compute_from_stateful(&mut self, starting_indexes: &Indexes, others: &[&RealizedBase], exit: &Exit) -> Result<()> { fn compute_from_stateful(&mut self, starting_indexes: &Indexes, others: &[&RealizedBase], exit: &Exit) -> Result<()> {
self.compute_from_stateful(starting_indexes, others, exit) self.compute_from_stateful(starting_indexes, others, exit)

View File

@@ -33,4 +33,8 @@ impl<A> Windows<A> {
pub fn as_mut_array(&mut self) -> [&mut A; 4] { pub fn as_mut_array(&mut self) -> [&mut A; 4] {
[&mut self._24h, &mut self._1w, &mut self._1m, &mut self._1y] [&mut self._24h, &mut self._1w, &mut self._1m, &mut self._1y]
} }
pub fn as_mut_array_from_1w(&mut self) -> [&mut A; 3] {
[&mut self._1w, &mut self._1m, &mut self._1y]
}
} }

View File

@@ -1585,7 +1585,9 @@ function createMetricPattern35(client, name) { return /** @type {MetricPattern35
* @property {BpsRatioPattern} investorPriceRatio * @property {BpsRatioPattern} investorPriceRatio
* @property {RatioPattern} investorPriceRatioPercentiles * @property {RatioPattern} investorPriceRatioPercentiles
* @property {MetricPattern1<Cents>} lossValueCreated * @property {MetricPattern1<Cents>} lossValueCreated
* @property {_1m1w1y24hPattern<Cents>} lossValueCreatedSum
* @property {MetricPattern1<Cents>} lossValueDestroyed * @property {MetricPattern1<Cents>} lossValueDestroyed
* @property {_1m1w1y24hPattern<Cents>} lossValueDestroyedSum
* @property {CentsSatsUsdPattern} lowerPriceBand * @property {CentsSatsUsdPattern} lowerPriceBand
* @property {MetricPattern1<StoredF32>} mvrv * @property {MetricPattern1<StoredF32>} mvrv
* @property {MetricPattern1<Dollars>} negRealizedLoss * @property {MetricPattern1<Dollars>} negRealizedLoss
@@ -1593,38 +1595,39 @@ function createMetricPattern35(client, name) { return /** @type {MetricPattern35
* @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap
* @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap
* @property {CumulativeHeightPattern<CentsSigned>} netRealizedPnl * @property {CumulativeHeightPattern<CentsSigned>} netRealizedPnl
* @property {MetricPattern1<CentsSigned>} netRealizedPnlEma1w
* @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap
* @property {CumulativeHeightPattern<Cents>} peakRegret * @property {CumulativeHeightPattern<Cents>} peakRegret
* @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap * @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap
* @property {MetricPattern1<Dollars>} profitFlow * @property {MetricPattern1<Dollars>} profitFlow
* @property {MetricPattern1<Cents>} profitValueCreated * @property {MetricPattern1<Cents>} profitValueCreated
* @property {_1m1w1y24hPattern<Cents>} profitValueCreatedSum
* @property {MetricPattern1<Cents>} profitValueDestroyed * @property {MetricPattern1<Cents>} profitValueDestroyed
* @property {_1m1w1y24hPattern<Cents>} profitValueDestroyedSum
* @property {MetricPattern1<Dollars>} realizedCap * @property {MetricPattern1<Dollars>} realizedCap
* @property {MetricPattern1<Cents>} realizedCapCents * @property {MetricPattern1<Cents>} realizedCapCents
* @property {MetricPattern1<CentsSigned>} realizedCapChange1m * @property {MetricPattern1<CentsSigned>} realizedCapChange1m
* @property {BpsPercentRatioPattern} realizedCapRelToOwnMarketCap * @property {BpsPercentRatioPattern} realizedCapRelToOwnMarketCap
* @property {CumulativeHeightPattern<Cents>} realizedLoss * @property {CumulativeHeightPattern<Cents>} realizedLoss
* @property {MetricPattern1<Cents>} realizedLossEma1w
* @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap
* @property {_1m1w1y24hPattern<Cents>} realizedLossSum * @property {_24hPattern<Cents>} realizedLossSum
* @property {_1m1w1yPattern<Cents>} realizedLossSumExtended
* @property {CentsSatsUsdPattern} realizedPrice * @property {CentsSatsUsdPattern} realizedPrice
* @property {BpsRatioPattern} realizedPriceRatio * @property {BpsRatioPattern} realizedPriceRatio
* @property {RatioPattern} realizedPriceRatioPercentiles * @property {RatioPattern} realizedPriceRatioPercentiles
* @property {RatioPattern2} realizedPriceRatioStdDev * @property {RatioPattern2} realizedPriceRatioStdDev
* @property {CumulativeHeightPattern<Cents>} realizedProfit * @property {CumulativeHeightPattern<Cents>} realizedProfit
* @property {MetricPattern1<Cents>} realizedProfitEma1w
* @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap
* @property {_1m1w1y24hPattern<Cents>} realizedProfitSum * @property {_24hPattern<Cents>} realizedProfitSum
* @property {_1m1w1yPattern<Cents>} realizedProfitSumExtended
* @property {_1m1w1y24hPattern<StoredF64>} realizedProfitToLossRatio * @property {_1m1w1y24hPattern<StoredF64>} realizedProfitToLossRatio
* @property {_1m1w1y24hPattern2} sellSideRiskRatio * @property {_1m1w1y24hPattern2} sellSideRiskRatio
* @property {_1m1wPattern2} sellSideRiskRatio24hEma
* @property {MetricPattern1<Sats>} sentInLoss * @property {MetricPattern1<Sats>} sentInLoss
* @property {_1m1w1y24hPattern<Sats>} sentInLossSum * @property {_24hPattern<Sats>} sentInLossSum
* @property {_1m1w1yPattern<Sats>} sentInLossSumExtended
* @property {MetricPattern1<Sats>} sentInProfit * @property {MetricPattern1<Sats>} sentInProfit
* @property {_1m1w1y24hPattern<Sats>} sentInProfitSum * @property {_24hPattern<Sats>} sentInProfitSum
* @property {_1m1w1yPattern<Sats>} sentInProfitSumExtended
* @property {_24hPattern<StoredF64>} sopr * @property {_24hPattern<StoredF64>} sopr
* @property {_1m1wPattern} sopr24hEma
* @property {_1m1w1yPattern<StoredF64>} soprExtended * @property {_1m1w1yPattern<StoredF64>} soprExtended
* @property {CentsSatsUsdPattern} upperPriceBand * @property {CentsSatsUsdPattern} upperPriceBand
* @property {MetricPattern1<Cents>} valueCreated * @property {MetricPattern1<Cents>} valueCreated
@@ -1652,7 +1655,9 @@ function createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealized
investorPriceRatio: createBpsRatioPattern(client, _m(acc, 'investor_price_ratio')), investorPriceRatio: createBpsRatioPattern(client, _m(acc, 'investor_price_ratio')),
investorPriceRatioPercentiles: createRatioPattern(client, _m(acc, 'investor_price_ratio')), investorPriceRatioPercentiles: createRatioPattern(client, _m(acc, 'investor_price_ratio')),
lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')),
lossValueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'loss_value_created')),
lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')),
lossValueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'loss_value_destroyed')),
lowerPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'lower_price_band')), lowerPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'lower_price_band')),
mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')),
negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')),
@@ -1660,38 +1665,39 @@ function createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealized
netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')), netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')),
netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')), netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')),
netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')),
netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')),
netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')),
peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')),
peakRegretRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')), peakRegretRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')),
profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')),
profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')),
profitValueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'profit_value_created')),
profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')), profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')),
profitValueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'profit_value_destroyed')),
realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')),
realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')),
realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')),
realizedCapRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), realizedCapRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')),
realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')),
realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')),
realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')),
realizedLossSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_loss')), realizedLossSum: create_24hPattern(client, _m(acc, 'realized_loss_24h')),
realizedLossSumExtended: create_1m1w1yPattern(client, _m(acc, 'realized_loss')),
realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')),
realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')),
realizedPriceRatioPercentiles: createRatioPattern(client, _m(acc, 'realized_price_ratio')), realizedPriceRatioPercentiles: createRatioPattern(client, _m(acc, 'realized_price_ratio')),
realizedPriceRatioStdDev: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), realizedPriceRatioStdDev: createRatioPattern2(client, _m(acc, 'realized_price_ratio')),
realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')),
realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')),
realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')),
realizedProfitSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit')), realizedProfitSum: create_24hPattern(client, _m(acc, 'realized_profit_24h')),
realizedProfitSumExtended: create_1m1w1yPattern(client, _m(acc, 'realized_profit')),
realizedProfitToLossRatio: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')), realizedProfitToLossRatio: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')),
sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')),
sellSideRiskRatio24hEma: create_1m1wPattern2(client, _m(acc, 'sell_side_risk_ratio_24h_ema')),
sentInLoss: createMetricPattern1(client, _m(acc, 'sent_in_loss')), sentInLoss: createMetricPattern1(client, _m(acc, 'sent_in_loss')),
sentInLossSum: create_1m1w1y24hPattern(client, _m(acc, 'sent_in_loss')), sentInLossSum: create_24hPattern(client, _m(acc, 'sent_in_loss_24h')),
sentInLossSumExtended: create_1m1w1yPattern(client, _m(acc, 'sent_in_loss')),
sentInProfit: createMetricPattern1(client, _m(acc, 'sent_in_profit')), sentInProfit: createMetricPattern1(client, _m(acc, 'sent_in_profit')),
sentInProfitSum: create_1m1w1y24hPattern(client, _m(acc, 'sent_in_profit')), sentInProfitSum: create_24hPattern(client, _m(acc, 'sent_in_profit_24h')),
sentInProfitSumExtended: create_1m1w1yPattern(client, _m(acc, 'sent_in_profit')),
sopr: create_24hPattern(client, _m(acc, 'sopr_24h')), sopr: create_24hPattern(client, _m(acc, 'sopr_24h')),
sopr24hEma: create_1m1wPattern(client, _m(acc, 'sopr_24h_ema')),
soprExtended: create_1m1w1yPattern(client, _m(acc, 'sopr')), soprExtended: create_1m1w1yPattern(client, _m(acc, 'sopr')),
upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')),
valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')),
@@ -1774,6 +1780,63 @@ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client
}; };
} }
/**
* @typedef {Object} MvrvNegNetRealizedSentSoprValuePattern
* @property {MetricPattern1<StoredF32>} mvrv
* @property {MetricPattern1<Dollars>} negRealizedLoss
* @property {CumulativeHeightPattern<CentsSigned>} netRealizedPnl
* @property {MetricPattern1<Dollars>} realizedCap
* @property {MetricPattern1<Cents>} realizedCapCents
* @property {MetricPattern1<CentsSigned>} realizedCapChange1m
* @property {CumulativeHeightPattern<Cents>} realizedLoss
* @property {_24hPattern<Cents>} realizedLossSum
* @property {CentsSatsUsdPattern} realizedPrice
* @property {BpsRatioPattern} realizedPriceRatio
* @property {CumulativeHeightPattern<Cents>} realizedProfit
* @property {_24hPattern<Cents>} realizedProfitSum
* @property {MetricPattern1<Sats>} sentInLoss
* @property {_24hPattern<Sats>} sentInLossSum
* @property {MetricPattern1<Sats>} sentInProfit
* @property {_24hPattern<Sats>} sentInProfitSum
* @property {_24hPattern<StoredF64>} sopr
* @property {MetricPattern1<Cents>} valueCreated
* @property {_24hPattern<Cents>} valueCreatedSum
* @property {MetricPattern1<Cents>} valueDestroyed
* @property {_24hPattern<Cents>} valueDestroyedSum
*/
/**
* Create a MvrvNegNetRealizedSentSoprValuePattern pattern node
* @param {BrkClientBase} client
* @param {string} acc - Accumulated metric name
* @returns {MvrvNegNetRealizedSentSoprValuePattern}
*/
function createMvrvNegNetRealizedSentSoprValuePattern(client, acc) {
return {
mvrv: createMetricPattern1(client, _m(acc, 'mvrv')),
negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')),
netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')),
realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')),
realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')),
realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')),
realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')),
realizedLossSum: create_24hPattern(client, _m(acc, 'realized_loss_24h')),
realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')),
realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')),
realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')),
realizedProfitSum: create_24hPattern(client, _m(acc, 'realized_profit_24h')),
sentInLoss: createMetricPattern1(client, _m(acc, 'sent_in_loss')),
sentInLossSum: create_24hPattern(client, _m(acc, 'sent_in_loss_24h')),
sentInProfit: createMetricPattern1(client, _m(acc, 'sent_in_profit')),
sentInProfitSum: create_24hPattern(client, _m(acc, 'sent_in_profit_24h')),
sopr: create_24hPattern(client, _m(acc, 'sopr_24h')),
valueCreated: createMetricPattern1(client, _m(acc, 'value_created')),
valueCreatedSum: create_24hPattern(client, _m(acc, 'value_created_24h')),
valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')),
valueDestroyedSum: create_24hPattern(client, _m(acc, 'value_destroyed_24h')),
};
}
/** /**
* @typedef {Object} Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern * @typedef {Object} Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern
* @property {CentsSatsUsdPattern} pct05 * @property {CentsSatsUsdPattern} pct05
@@ -1828,7 +1891,7 @@ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65
} }
/** /**
* @typedef {Object} MvrvNegNetRealizedSentSoprValuePattern * @typedef {Object} MvrvNegNetRealizedSoprValuePattern
* @property {MetricPattern1<StoredF32>} mvrv * @property {MetricPattern1<StoredF32>} mvrv
* @property {MetricPattern1<Dollars>} negRealizedLoss * @property {MetricPattern1<Dollars>} negRealizedLoss
* @property {CumulativeHeightPattern<CentsSigned>} netRealizedPnl * @property {CumulativeHeightPattern<CentsSigned>} netRealizedPnl
@@ -1836,11 +1899,11 @@ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65
* @property {MetricPattern1<Cents>} realizedCapCents * @property {MetricPattern1<Cents>} realizedCapCents
* @property {MetricPattern1<CentsSigned>} realizedCapChange1m * @property {MetricPattern1<CentsSigned>} realizedCapChange1m
* @property {CumulativeHeightPattern<Cents>} realizedLoss * @property {CumulativeHeightPattern<Cents>} realizedLoss
* @property {_24hPattern<Cents>} realizedLossSum
* @property {CentsSatsUsdPattern} realizedPrice * @property {CentsSatsUsdPattern} realizedPrice
* @property {BpsRatioPattern} realizedPriceRatio * @property {BpsRatioPattern} realizedPriceRatio
* @property {CumulativeHeightPattern<Cents>} realizedProfit * @property {CumulativeHeightPattern<Cents>} realizedProfit
* @property {MetricPattern1<Sats>} sentInLoss * @property {_24hPattern<Cents>} realizedProfitSum
* @property {MetricPattern1<Sats>} sentInProfit
* @property {_24hPattern<StoredF64>} sopr * @property {_24hPattern<StoredF64>} sopr
* @property {MetricPattern1<Cents>} valueCreated * @property {MetricPattern1<Cents>} valueCreated
* @property {_24hPattern<Cents>} valueCreatedSum * @property {_24hPattern<Cents>} valueCreatedSum
@@ -1849,12 +1912,12 @@ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65
*/ */
/** /**
* Create a MvrvNegNetRealizedSentSoprValuePattern pattern node * Create a MvrvNegNetRealizedSoprValuePattern pattern node
* @param {BrkClientBase} client * @param {BrkClientBase} client
* @param {string} acc - Accumulated metric name * @param {string} acc - Accumulated metric name
* @returns {MvrvNegNetRealizedSentSoprValuePattern} * @returns {MvrvNegNetRealizedSoprValuePattern}
*/ */
function createMvrvNegNetRealizedSentSoprValuePattern(client, acc) { function createMvrvNegNetRealizedSoprValuePattern(client, acc) {
return { return {
mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')),
negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')),
@@ -1863,11 +1926,11 @@ function createMvrvNegNetRealizedSentSoprValuePattern(client, acc) {
realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')),
realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')),
realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')),
realizedLossSum: create_24hPattern(client, _m(acc, 'realized_loss_24h')),
realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')),
realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')),
realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')),
sentInLoss: createMetricPattern1(client, _m(acc, 'sent_in_loss')), realizedProfitSum: create_24hPattern(client, _m(acc, 'realized_profit_24h')),
sentInProfit: createMetricPattern1(client, _m(acc, 'sent_in_profit')),
sopr: create_24hPattern(client, _m(acc, 'sopr_24h')), sopr: create_24hPattern(client, _m(acc, 'sopr_24h')),
valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')),
valueCreatedSum: create_24hPattern(client, _m(acc, 'value_created_24h')), valueCreatedSum: create_24hPattern(client, _m(acc, 'value_created_24h')),
@@ -1970,51 +2033,6 @@ function createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(clien
}; };
} }
/**
* @typedef {Object} MvrvNegNetRealizedSoprValuePattern
* @property {MetricPattern1<StoredF32>} mvrv
* @property {MetricPattern1<Dollars>} negRealizedLoss
* @property {CumulativeHeightPattern<CentsSigned>} netRealizedPnl
* @property {MetricPattern1<Dollars>} realizedCap
* @property {MetricPattern1<Cents>} realizedCapCents
* @property {MetricPattern1<CentsSigned>} realizedCapChange1m
* @property {CumulativeHeightPattern<Cents>} realizedLoss
* @property {CentsSatsUsdPattern} realizedPrice
* @property {BpsRatioPattern} realizedPriceRatio
* @property {CumulativeHeightPattern<Cents>} realizedProfit
* @property {_24hPattern<StoredF64>} sopr
* @property {MetricPattern1<Cents>} valueCreated
* @property {_24hPattern<Cents>} valueCreatedSum
* @property {MetricPattern1<Cents>} valueDestroyed
* @property {_24hPattern<Cents>} valueDestroyedSum
*/
/**
* Create a MvrvNegNetRealizedSoprValuePattern pattern node
* @param {BrkClientBase} client
* @param {string} acc - Accumulated metric name
* @returns {MvrvNegNetRealizedSoprValuePattern}
*/
function createMvrvNegNetRealizedSoprValuePattern(client, acc) {
return {
mvrv: createMetricPattern1(client, _m(acc, 'mvrv')),
negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')),
netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')),
realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')),
realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')),
realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')),
realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')),
realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')),
realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')),
realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')),
sopr: create_24hPattern(client, _m(acc, 'sopr_24h')),
valueCreated: createMetricPattern1(client, _m(acc, 'value_created')),
valueCreatedSum: create_24hPattern(client, _m(acc, 'value_created_24h')),
valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')),
valueDestroyedSum: create_24hPattern(client, _m(acc, 'value_destroyed_24h')),
};
}
/** /**
* @typedef {Object} NetNuplSupplyUnrealizedPattern2 * @typedef {Object} NetNuplSupplyUnrealizedPattern2
* @property {BpsPercentRatioPattern} netUnrealizedPnlRelToMarketCap * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToMarketCap
@@ -2461,6 +2479,39 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) {
}; };
} }
/**
* @typedef {Object} MvrvRealizedPattern
* @property {MetricPattern1<StoredF32>} mvrv
* @property {MetricPattern1<Dollars>} realizedCap
* @property {MetricPattern1<Cents>} realizedCapCents
* @property {CumulativeHeightPattern<Cents>} realizedLoss
* @property {_24hPattern<Cents>} realizedLossSum
* @property {CentsSatsUsdPattern} realizedPrice
* @property {BpsRatioPattern} realizedPriceRatio
* @property {CumulativeHeightPattern<Cents>} realizedProfit
* @property {_24hPattern<Cents>} realizedProfitSum
*/
/**
* Create a MvrvRealizedPattern pattern node
* @param {BrkClientBase} client
* @param {string} acc - Accumulated metric name
* @returns {MvrvRealizedPattern}
*/
function createMvrvRealizedPattern(client, acc) {
return {
mvrv: createMetricPattern1(client, _m(acc, 'mvrv')),
realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')),
realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')),
realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')),
realizedLossSum: create_24hPattern(client, _m(acc, 'realized_loss_24h')),
realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')),
realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')),
realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')),
realizedProfitSum: create_24hPattern(client, _m(acc, 'realized_profit_24h')),
};
}
/** /**
* @typedef {Object} _1m1w1y24hBtcCentsSatsUsdPattern * @typedef {Object} _1m1w1y24hBtcCentsSatsUsdPattern
* @property {BtcCentsSatsUsdPattern} _1m * @property {BtcCentsSatsUsdPattern} _1m
@@ -2643,35 +2694,6 @@ function createActivityAddrOutputsRealizedSupplyUnrealizedPattern(client, acc) {
}; };
} }
/**
* @typedef {Object} MvrvRealizedPattern
* @property {MetricPattern1<StoredF32>} mvrv
* @property {MetricPattern1<Dollars>} realizedCap
* @property {MetricPattern1<Cents>} realizedCapCents
* @property {CumulativeHeightPattern<Cents>} realizedLoss
* @property {CentsSatsUsdPattern} realizedPrice
* @property {BpsRatioPattern} realizedPriceRatio
* @property {CumulativeHeightPattern<Cents>} realizedProfit
*/
/**
* Create a MvrvRealizedPattern pattern node
* @param {BrkClientBase} client
* @param {string} acc - Accumulated metric name
* @returns {MvrvRealizedPattern}
*/
function createMvrvRealizedPattern(client, acc) {
return {
mvrv: createMetricPattern1(client, _m(acc, 'mvrv')),
realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')),
realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')),
realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')),
realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')),
realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')),
realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')),
};
}
/** /**
* @typedef {Object} ActivityOutputsRealizedRelativeSupplyUnrealizedPattern * @typedef {Object} ActivityOutputsRealizedRelativeSupplyUnrealizedPattern
* @property {SentPattern} activity * @property {SentPattern} activity
@@ -3253,44 +3275,6 @@ function createCumulativeHeightSumPattern(client, acc) {
}; };
} }
/**
* @typedef {Object} _1m1wPattern2
* @property {BpsPercentRatioPattern} _1m
* @property {BpsPercentRatioPattern} _1w
*/
/**
* Create a _1m1wPattern2 pattern node
* @param {BrkClientBase} client
* @param {string} acc - Accumulated metric name
* @returns {_1m1wPattern2}
*/
function create_1m1wPattern2(client, acc) {
return {
_1m: createBpsPercentRatioPattern(client, _m(acc, '1m')),
_1w: createBpsPercentRatioPattern(client, _m(acc, '1w')),
};
}
/**
* @typedef {Object} _1m1wPattern
* @property {MetricPattern1<StoredF64>} _1m
* @property {MetricPattern1<StoredF64>} _1w
*/
/**
* Create a _1m1wPattern pattern node
* @param {BrkClientBase} client
* @param {string} acc - Accumulated metric name
* @returns {_1m1wPattern}
*/
function create_1m1wPattern(client, acc) {
return {
_1m: createMetricPattern1(client, _m(acc, '1m')),
_1w: createMetricPattern1(client, _m(acc, '1w')),
};
}
/** /**
* @typedef {Object} BaseCumulativePattern * @typedef {Object} BaseCumulativePattern
* @property {BtcCentsSatsUsdPattern} base * @property {BtcCentsSatsUsdPattern} base
@@ -4808,7 +4792,6 @@ function create_24hPattern(client, acc) {
* @property {_1m1w1y24hPattern<Cents>} adjustedValueCreatedSum * @property {_1m1w1y24hPattern<Cents>} adjustedValueCreatedSum
* @property {_1m1w1y24hPattern<Cents>} adjustedValueDestroyedSum * @property {_1m1w1y24hPattern<Cents>} adjustedValueDestroyedSum
* @property {_1m1w1y24hPattern<StoredF64>} adjustedSopr * @property {_1m1w1y24hPattern<StoredF64>} adjustedSopr
* @property {_1m1wPattern} adjustedSoprEma
*/ */
/** /**
@@ -4840,7 +4823,6 @@ function create_24hPattern(client, acc) {
* @property {_1m1w1y24hPattern<Cents>} adjustedValueCreatedSum * @property {_1m1w1y24hPattern<Cents>} adjustedValueCreatedSum
* @property {_1m1w1y24hPattern<Cents>} adjustedValueDestroyedSum * @property {_1m1w1y24hPattern<Cents>} adjustedValueDestroyedSum
* @property {_1m1w1y24hPattern<StoredF64>} adjustedSopr * @property {_1m1w1y24hPattern<StoredF64>} adjustedSopr
* @property {_1m1wPattern} adjustedSoprEma
*/ */
/** /**
@@ -7021,7 +7003,6 @@ class BrkClient extends BrkClientBase {
adjustedValueCreatedSum: create_1m1w1y24hPattern(this, 'adjusted_value_created'), adjustedValueCreatedSum: create_1m1w1y24hPattern(this, 'adjusted_value_created'),
adjustedValueDestroyedSum: create_1m1w1y24hPattern(this, 'adjusted_value_destroyed'), adjustedValueDestroyedSum: create_1m1w1y24hPattern(this, 'adjusted_value_destroyed'),
adjustedSopr: create_1m1w1y24hPattern(this, 'adjusted_sopr'), adjustedSopr: create_1m1w1y24hPattern(this, 'adjusted_sopr'),
adjustedSoprEma: create_1m1wPattern(this, 'adjusted_sopr_24h_ema'),
}, },
relative: { relative: {
supplyInProfitRelToOwnSupply: createBpsPercentRatioPattern(this, 'supply_in_profit_rel_to_own_supply'), supplyInProfitRelToOwnSupply: createBpsPercentRatioPattern(this, 'supply_in_profit_rel_to_own_supply'),
@@ -7052,7 +7033,6 @@ class BrkClient extends BrkClientBase {
adjustedValueCreatedSum: create_1m1w1y24hPattern(this, 'sth_adjusted_value_created'), adjustedValueCreatedSum: create_1m1w1y24hPattern(this, 'sth_adjusted_value_created'),
adjustedValueDestroyedSum: create_1m1w1y24hPattern(this, 'sth_adjusted_value_destroyed'), adjustedValueDestroyedSum: create_1m1w1y24hPattern(this, 'sth_adjusted_value_destroyed'),
adjustedSopr: create_1m1w1y24hPattern(this, 'sth_adjusted_sopr'), adjustedSopr: create_1m1w1y24hPattern(this, 'sth_adjusted_sopr'),
adjustedSoprEma: create_1m1wPattern(this, 'sth_adjusted_sopr_24h_ema'),
}, },
lth: { lth: {
supply: createChangeHalvedTotalPattern(this, 'lth_supply'), supply: createChangeHalvedTotalPattern(this, 'lth_supply'),

View File

@@ -2080,7 +2080,9 @@ class CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentS
self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'investor_price_ratio')) self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'investor_price_ratio'))
self.investor_price_ratio_percentiles: RatioPattern = RatioPattern(client, _m(acc, 'investor_price_ratio')) self.investor_price_ratio_percentiles: RatioPattern = RatioPattern(client, _m(acc, 'investor_price_ratio'))
self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created')) self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created'))
self.loss_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'loss_value_created'))
self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed'))
self.loss_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'loss_value_destroyed'))
self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'lower_price_band')) self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'lower_price_band'))
self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv'))
self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss'))
@@ -2088,38 +2090,39 @@ class CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentS
self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')) self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap'))
self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')) self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap'))
self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl'))
self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w'))
self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap'))
self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret'))
self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')) self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap'))
self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow'))
self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created')) self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created'))
self.profit_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'profit_value_created'))
self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed')) self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed'))
self.profit_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'profit_value_destroyed'))
self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap'))
self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents'))
self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m'))
self.realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')) self.realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap'))
self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss'))
self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w'))
self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap'))
self.realized_loss_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_loss')) self.realized_loss_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'realized_loss_24h'))
self.realized_loss_sum_extended: _1m1w1yPattern[Cents] = _1m1w1yPattern(client, _m(acc, 'realized_loss'))
self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price'))
self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio'))
self.realized_price_ratio_percentiles: RatioPattern = RatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_price_ratio_percentiles: RatioPattern = RatioPattern(client, _m(acc, 'realized_price_ratio'))
self.realized_price_ratio_std_dev: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) self.realized_price_ratio_std_dev: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio'))
self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit'))
self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w'))
self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap'))
self.realized_profit_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit')) self.realized_profit_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'realized_profit_24h'))
self.realized_profit_sum_extended: _1m1w1yPattern[Cents] = _1m1w1yPattern(client, _m(acc, 'realized_profit'))
self.realized_profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')) self.realized_profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio'))
self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio'))
self.sell_side_risk_ratio_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sell_side_risk_ratio_24h_ema'))
self.sent_in_loss: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sent_in_loss')) self.sent_in_loss: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sent_in_loss'))
self.sent_in_loss_sum: _1m1w1y24hPattern[Sats] = _1m1w1y24hPattern(client, _m(acc, 'sent_in_loss')) self.sent_in_loss_sum: _24hPattern[Sats] = _24hPattern(client, _m(acc, 'sent_in_loss_24h'))
self.sent_in_loss_sum_extended: _1m1w1yPattern[Sats] = _1m1w1yPattern(client, _m(acc, 'sent_in_loss'))
self.sent_in_profit: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sent_in_profit')) self.sent_in_profit: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sent_in_profit'))
self.sent_in_profit_sum: _1m1w1y24hPattern[Sats] = _1m1w1y24hPattern(client, _m(acc, 'sent_in_profit')) self.sent_in_profit_sum: _24hPattern[Sats] = _24hPattern(client, _m(acc, 'sent_in_profit_24h'))
self.sent_in_profit_sum_extended: _1m1w1yPattern[Sats] = _1m1w1yPattern(client, _m(acc, 'sent_in_profit'))
self.sopr: _24hPattern[StoredF64] = _24hPattern(client, _m(acc, 'sopr_24h')) self.sopr: _24hPattern[StoredF64] = _24hPattern(client, _m(acc, 'sopr_24h'))
self.sopr_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sopr_24h_ema'))
self.sopr_extended: _1m1w1yPattern[StoredF64] = _1m1w1yPattern(client, _m(acc, 'sopr')) self.sopr_extended: _1m1w1yPattern[StoredF64] = _1m1w1yPattern(client, _m(acc, 'sopr'))
self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band'))
self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created'))
@@ -2163,6 +2166,33 @@ class _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern:
self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma_4y')) self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma_4y'))
self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'zscore_4y')) self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'zscore_4y'))
class MvrvNegNetRealizedSentSoprValuePattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv'))
self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss'))
self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl'))
self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap'))
self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents'))
self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m'))
self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss'))
self.realized_loss_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'realized_loss_24h'))
self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price'))
self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio'))
self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit'))
self.realized_profit_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'realized_profit_24h'))
self.sent_in_loss: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sent_in_loss'))
self.sent_in_loss_sum: _24hPattern[Sats] = _24hPattern(client, _m(acc, 'sent_in_loss_24h'))
self.sent_in_profit: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sent_in_profit'))
self.sent_in_profit_sum: _24hPattern[Sats] = _24hPattern(client, _m(acc, 'sent_in_profit_24h'))
self.sopr: _24hPattern[StoredF64] = _24hPattern(client, _m(acc, 'sopr_24h'))
self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created'))
self.value_created_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'value_created_24h'))
self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed'))
self.value_destroyed_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'value_destroyed_24h'))
class Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern: class Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern:
"""Pattern struct for repeated tree structure.""" """Pattern struct for repeated tree structure."""
@@ -2188,7 +2218,7 @@ class Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct7
self.pct90: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct90')) self.pct90: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct90'))
self.pct95: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct95')) self.pct95: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct95'))
class MvrvNegNetRealizedSentSoprValuePattern: class MvrvNegNetRealizedSoprValuePattern:
"""Pattern struct for repeated tree structure.""" """Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str): def __init__(self, client: BrkClientBase, acc: str):
@@ -2200,11 +2230,11 @@ class MvrvNegNetRealizedSentSoprValuePattern:
self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents'))
self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m'))
self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss'))
self.realized_loss_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'realized_loss_24h'))
self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price'))
self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio'))
self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit'))
self.sent_in_loss: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sent_in_loss')) self.realized_profit_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'realized_profit_24h'))
self.sent_in_profit: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sent_in_profit'))
self.sopr: _24hPattern[StoredF64] = _24hPattern(client, _m(acc, 'sopr_24h')) self.sopr: _24hPattern[StoredF64] = _24hPattern(client, _m(acc, 'sopr_24h'))
self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created'))
self.value_created_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'value_created_24h')) self.value_created_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'value_created_24h'))
@@ -2255,27 +2285,6 @@ class GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern:
self.unrealized_loss: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_loss')) self.unrealized_loss: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_loss'))
self.unrealized_profit: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_profit')) self.unrealized_profit: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_profit'))
class MvrvNegNetRealizedSoprValuePattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv'))
self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss'))
self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl'))
self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap'))
self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents'))
self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m'))
self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss'))
self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price'))
self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio'))
self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit'))
self.sopr: _24hPattern[StoredF64] = _24hPattern(client, _m(acc, 'sopr_24h'))
self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created'))
self.value_created_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'value_created_24h'))
self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed'))
self.value_destroyed_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'value_destroyed_24h'))
class NetNuplSupplyUnrealizedPattern2: class NetNuplSupplyUnrealizedPattern2:
"""Pattern struct for repeated tree structure.""" """Pattern struct for repeated tree structure."""
@@ -2481,6 +2490,21 @@ class AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern:
self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p90')) self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p90'))
self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum')) self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum'))
class MvrvRealizedPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv'))
self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap'))
self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents'))
self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss'))
self.realized_loss_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'realized_loss_24h'))
self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price'))
self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio'))
self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit'))
self.realized_profit_sum: _24hPattern[Cents] = _24hPattern(client, _m(acc, 'realized_profit_24h'))
class _1m1w1y24hBtcCentsSatsUsdPattern: class _1m1w1y24hBtcCentsSatsUsdPattern:
"""Pattern struct for repeated tree structure.""" """Pattern struct for repeated tree structure."""
@@ -2562,19 +2586,6 @@ class ActivityAddrOutputsRealizedSupplyUnrealizedPattern:
self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply'))
self.unrealized: SupplyPattern = SupplyPattern(client, _m(acc, 'supply_in')) self.unrealized: SupplyPattern = SupplyPattern(client, _m(acc, 'supply_in'))
class MvrvRealizedPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv'))
self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap'))
self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents'))
self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss'))
self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price'))
self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio'))
self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit'))
class ActivityOutputsRealizedRelativeSupplyUnrealizedPattern: class ActivityOutputsRealizedRelativeSupplyUnrealizedPattern:
"""Pattern struct for repeated tree structure.""" """Pattern struct for repeated tree structure."""
@@ -2823,22 +2834,6 @@ class CumulativeHeightSumPattern(Generic[T]):
self.height: MetricPattern18[T] = MetricPattern18(client, acc) self.height: MetricPattern18[T] = MetricPattern18(client, acc)
self.sum: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, acc) self.sum: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, acc)
class _1m1wPattern2:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self._1m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1m'))
self._1w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1w'))
class _1m1wPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self._1m: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, '1m'))
self._1w: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, '1w'))
class BaseCumulativePattern: class BaseCumulativePattern:
"""Pattern struct for repeated tree structure.""" """Pattern struct for repeated tree structure."""
@@ -4261,7 +4256,6 @@ class MetricsTree_Distribution_UtxoCohorts_All_Adjusted:
self.adjusted_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'adjusted_value_created') self.adjusted_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'adjusted_value_created')
self.adjusted_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'adjusted_value_destroyed') self.adjusted_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'adjusted_value_destroyed')
self.adjusted_sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'adjusted_sopr') self.adjusted_sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'adjusted_sopr')
self.adjusted_sopr_ema: _1m1wPattern = _1m1wPattern(client, 'adjusted_sopr_24h_ema')
class MetricsTree_Distribution_UtxoCohorts_All_Relative: class MetricsTree_Distribution_UtxoCohorts_All_Relative:
"""Metrics tree node.""" """Metrics tree node."""
@@ -4310,7 +4304,6 @@ class MetricsTree_Distribution_UtxoCohorts_Sth:
self.adjusted_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'sth_adjusted_value_created') self.adjusted_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'sth_adjusted_value_created')
self.adjusted_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'sth_adjusted_value_destroyed') self.adjusted_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'sth_adjusted_value_destroyed')
self.adjusted_sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'sth_adjusted_sopr') self.adjusted_sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'sth_adjusted_sopr')
self.adjusted_sopr_ema: _1m1wPattern = _1m1wPattern(client, 'sth_adjusted_sopr_24h_ema')
class MetricsTree_Distribution_UtxoCohorts_Lth: class MetricsTree_Distribution_UtxoCohorts_Lth:
"""Metrics tree node.""" """Metrics tree node."""