mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 07:09:59 -07:00
global: snapshot
This commit is contained in:
@@ -5,8 +5,8 @@ use vecdb::{Exit, ReadableVec};
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
blocks::{self, ONE_TERA_HASH, TARGET_BLOCKS_PER_DAY_F64},
|
||||
internal::RatioDiffF32Bps32,
|
||||
ComputeIndexes,
|
||||
traits::ComputeDrawdown,
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -151,8 +151,7 @@ impl Vecs {
|
||||
)?;
|
||||
|
||||
self.hash_price_rebound
|
||||
.height
|
||||
.compute_percentage_difference(
|
||||
.compute_binary::<StoredF32, StoredF32, RatioDiffF32Bps32>(
|
||||
starting_indexes.height,
|
||||
&self.hash_price_phs.height,
|
||||
&self.hash_price_phs_min.height,
|
||||
@@ -160,8 +159,7 @@ impl Vecs {
|
||||
)?;
|
||||
|
||||
self.hash_value_rebound
|
||||
.height
|
||||
.compute_percentage_difference(
|
||||
.compute_binary::<StoredF32, StoredF32, RatioDiffF32Bps32>(
|
||||
starting_indexes.height,
|
||||
&self.hash_value_phs.height,
|
||||
&self.hash_value_phs_min.height,
|
||||
|
||||
@@ -5,7 +5,10 @@ use vecdb::Database;
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{Bps16ToFloat, Bps16ToPercent, ComputedFromHeight, PercentFromHeight},
|
||||
internal::{
|
||||
ComputedFromHeight,
|
||||
PercentFromHeight,
|
||||
},
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -49,7 +52,7 @@ impl Vecs {
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
hash_rate_drawdown: PercentFromHeight::forced_import::<Bps16ToFloat, Bps16ToPercent>(
|
||||
hash_rate_drawdown: PercentFromHeight::forced_import_bps16(
|
||||
db,
|
||||
"hash_rate_drawdown",
|
||||
version,
|
||||
@@ -79,7 +82,7 @@ impl Vecs {
|
||||
version + v4,
|
||||
indexes,
|
||||
)?,
|
||||
hash_price_rebound: ComputedFromHeight::forced_import(
|
||||
hash_price_rebound: PercentFromHeight::forced_import_bps32(
|
||||
db,
|
||||
"hash_price_rebound",
|
||||
version + v4,
|
||||
@@ -109,7 +112,7 @@ impl Vecs {
|
||||
version + v4,
|
||||
indexes,
|
||||
)?,
|
||||
hash_value_rebound: ComputedFromHeight::forced_import(
|
||||
hash_value_rebound: PercentFromHeight::forced_import_bps32(
|
||||
db,
|
||||
"hash_value_rebound",
|
||||
version + v4,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::{BasisPointsSigned16, StoredF32, StoredF64};
|
||||
use brk_types::{BasisPointsSigned16, BasisPointsSigned32, StoredF32, StoredF64};
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::{ComputedFromHeight, PercentFromHeight};
|
||||
@@ -18,10 +18,10 @@ pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub hash_price_ths_min: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_price_phs: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_price_phs_min: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_price_rebound: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_price_rebound: PercentFromHeight<BasisPointsSigned32, M>,
|
||||
pub hash_value_ths: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_value_ths_min: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_value_phs: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_value_phs_min: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_value_rebound: ComputedFromHeight<StoredF32, M>,
|
||||
pub hash_value_rebound: PercentFromHeight<BasisPointsSigned32, M>,
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
Bp16ToFloat, Bp16ToPercent, FiatFromHeight, PercentFromHeight, PercentRollingWindows,
|
||||
FiatFromHeight, PercentFromHeight, PercentRollingWindows,
|
||||
ValueFromHeightFull, ValueFromHeightCumulativeSum,
|
||||
},
|
||||
};
|
||||
@@ -27,25 +27,25 @@ impl Vecs {
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
fee_dominance: PercentFromHeight::forced_import::<Bp16ToFloat, Bp16ToPercent>(
|
||||
fee_dominance: PercentFromHeight::forced_import_bp16(
|
||||
db,
|
||||
"fee_dominance",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
fee_dominance_rolling: PercentRollingWindows::forced_import::<Bp16ToFloat, Bp16ToPercent>(
|
||||
fee_dominance_rolling: PercentRollingWindows::forced_import_bp16(
|
||||
db,
|
||||
"fee_dominance",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
subsidy_dominance: PercentFromHeight::forced_import::<Bp16ToFloat, Bp16ToPercent>(
|
||||
subsidy_dominance: PercentFromHeight::forced_import_bp16(
|
||||
db,
|
||||
"subsidy_dominance",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
subsidy_dominance_rolling: PercentRollingWindows::forced_import::<Bp16ToFloat, Bp16ToPercent>(
|
||||
subsidy_dominance_rolling: PercentRollingWindows::forced_import_bp16(
|
||||
db,
|
||||
"subsidy_dominance",
|
||||
version,
|
||||
|
||||
@@ -3,7 +3,7 @@ use brk_types::{BasisPoints16, Cents};
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::{
|
||||
FiatFromHeight, PercentFromHeight, PercentRollingWindows, RollingWindows,
|
||||
FiatFromHeight, PercentFromHeight, PercentRollingWindows,
|
||||
ValueFromHeightFull, ValueFromHeightCumulativeSum,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user