mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 08:39:59 -07:00
global: MASSIVE snapshot
This commit is contained in:
@@ -37,7 +37,6 @@ impl Vecs {
|
||||
inputs,
|
||||
&self.size,
|
||||
starting_indexes,
|
||||
price,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use vecdb::{Database, IterableCloneableVec, LazyVecFrom2};
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{ComputedVecsFromHeight, Source, VecBuilderOptions},
|
||||
internal::ComputedBlockFull,
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -16,15 +16,6 @@ impl Vecs {
|
||||
indexer: &Indexer,
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
let full_stats = || {
|
||||
VecBuilderOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
.add_percentiles()
|
||||
.add_sum()
|
||||
.add_cumulative()
|
||||
};
|
||||
|
||||
let txindex_to_is_coinbase = LazyVecFrom2::init(
|
||||
"is_coinbase",
|
||||
version,
|
||||
@@ -39,13 +30,11 @@ impl Vecs {
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
indexes_to_tx_count: ComputedVecsFromHeight::forced_import(
|
||||
indexes_to_tx_count: ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"tx_count",
|
||||
Source::Compute,
|
||||
version,
|
||||
indexes,
|
||||
full_stats(),
|
||||
)?,
|
||||
txindex_to_is_coinbase,
|
||||
})
|
||||
|
||||
@@ -2,10 +2,10 @@ use brk_traversable::Traversable;
|
||||
use brk_types::{Height, StoredBool, StoredU64, TxIndex};
|
||||
use vecdb::LazyVecFrom2;
|
||||
|
||||
use crate::internal::ComputedVecsFromHeight;
|
||||
use crate::internal::ComputedBlockFull;
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub indexes_to_tx_count: ComputedVecsFromHeight<StoredU64>,
|
||||
pub indexes_to_tx_count: ComputedBlockFull<StoredU64>,
|
||||
pub txindex_to_is_coinbase: LazyVecFrom2<TxIndex, StoredBool, TxIndex, Height, Height, TxIndex>,
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ use vecdb::{Exit, unlikely};
|
||||
|
||||
use super::Vecs;
|
||||
use super::super::size;
|
||||
use crate::{indexes, inputs, price, ComputeIndexes};
|
||||
use crate::{indexes, inputs, ComputeIndexes};
|
||||
|
||||
impl Vecs {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
@@ -16,7 +16,6 @@ impl Vecs {
|
||||
txins: &inputs::Vecs,
|
||||
size_vecs: &size::Vecs,
|
||||
starting_indexes: &ComputeIndexes,
|
||||
price: Option<&price::Vecs>,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
self.txindex_to_input_value.compute_sum_from_indexes(
|
||||
@@ -58,21 +57,20 @@ impl Vecs {
|
||||
exit,
|
||||
)?;
|
||||
|
||||
self.indexes_to_fee.compute_rest(
|
||||
self.indexes_to_fee.derive_from(
|
||||
indexer,
|
||||
indexes,
|
||||
starting_indexes,
|
||||
&self.txindex_to_fee,
|
||||
exit,
|
||||
Some(&self.txindex_to_fee),
|
||||
price,
|
||||
)?;
|
||||
|
||||
self.indexes_to_fee_rate.compute_rest(
|
||||
self.indexes_to_fee_rate.derive_from(
|
||||
indexer,
|
||||
indexes,
|
||||
starting_indexes,
|
||||
&self.txindex_to_fee_rate,
|
||||
exit,
|
||||
Some(&self.txindex_to_fee_rate),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use brk_error::Result;
|
||||
use brk_indexer::Indexer;
|
||||
use brk_types::Version;
|
||||
use vecdb::{Database, EagerVec, ImportableVec, IterableCloneableVec};
|
||||
use vecdb::{Database, EagerVec, ImportableVec};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{ComputedValueVecsFromTxindex, ComputedVecsFromTxindex, Source, VecBuilderOptions},
|
||||
internal::{ComputedTxDistribution, ValueDerivedTxFull},
|
||||
price,
|
||||
};
|
||||
|
||||
@@ -18,13 +18,6 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
price: Option<&price::Vecs>,
|
||||
) -> Result<Self> {
|
||||
let stats = || {
|
||||
VecBuilderOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
.add_percentiles()
|
||||
};
|
||||
|
||||
let txindex_to_input_value = EagerVec::forced_import(db, "input_value", version)?;
|
||||
let txindex_to_output_value = EagerVec::forced_import(db, "output_value", version)?;
|
||||
let txindex_to_fee = EagerVec::forced_import(db, "fee", version)?;
|
||||
@@ -35,28 +28,20 @@ impl Vecs {
|
||||
txindex_to_output_value,
|
||||
txindex_to_fee: txindex_to_fee.clone(),
|
||||
txindex_to_fee_rate: txindex_to_fee_rate.clone(),
|
||||
indexes_to_fee: ComputedValueVecsFromTxindex::forced_import(
|
||||
indexes_to_fee: ValueDerivedTxFull::forced_import(
|
||||
db,
|
||||
"fee",
|
||||
indexer,
|
||||
indexes,
|
||||
Source::Vec(txindex_to_fee.boxed_clone()),
|
||||
version,
|
||||
indexes,
|
||||
indexer,
|
||||
price,
|
||||
VecBuilderOptions::default()
|
||||
.add_sum()
|
||||
.add_cumulative()
|
||||
.add_percentiles()
|
||||
.add_minmax()
|
||||
.add_average(),
|
||||
&txindex_to_fee,
|
||||
)?,
|
||||
indexes_to_fee_rate: ComputedVecsFromTxindex::forced_import(
|
||||
indexes_to_fee_rate: ComputedTxDistribution::forced_import(
|
||||
db,
|
||||
"fee_rate",
|
||||
Source::Vec(txindex_to_fee_rate.boxed_clone()),
|
||||
version,
|
||||
indexes,
|
||||
stats(),
|
||||
)?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use brk_traversable::Traversable;
|
||||
use brk_types::{FeeRate, Sats, TxIndex};
|
||||
use vecdb::{EagerVec, PcoVec};
|
||||
|
||||
use crate::internal::{ComputedValueVecsFromTxindex, ComputedVecsFromTxindex};
|
||||
use crate::internal::{ComputedTxDistribution, ValueDerivedTxFull};
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
@@ -10,6 +10,6 @@ pub struct Vecs {
|
||||
pub txindex_to_output_value: EagerVec<PcoVec<TxIndex, Sats>>,
|
||||
pub txindex_to_fee: EagerVec<PcoVec<TxIndex, Sats>>,
|
||||
pub txindex_to_fee_rate: EagerVec<PcoVec<TxIndex, FeeRate>>,
|
||||
pub indexes_to_fee: ComputedValueVecsFromTxindex,
|
||||
pub indexes_to_fee_rate: ComputedVecsFromTxindex<FeeRate>,
|
||||
pub indexes_to_fee: ValueDerivedTxFull,
|
||||
pub indexes_to_fee_rate: ComputedTxDistribution<FeeRate>,
|
||||
}
|
||||
|
||||
@@ -13,20 +13,20 @@ impl Vecs {
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
self.indexes_to_tx_weight.compute_rest(
|
||||
self.indexes_to_tx_weight.derive_from(
|
||||
indexer,
|
||||
indexes,
|
||||
starting_indexes,
|
||||
&self.txindex_to_weight,
|
||||
exit,
|
||||
Some(&self.txindex_to_weight),
|
||||
)?;
|
||||
|
||||
self.indexes_to_tx_vsize.compute_rest(
|
||||
self.indexes_to_tx_vsize.derive_from(
|
||||
indexer,
|
||||
indexes,
|
||||
starting_indexes,
|
||||
&self.txindex_to_vsize,
|
||||
exit,
|
||||
Some(&self.txindex_to_vsize),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -4,10 +4,7 @@ use brk_types::{TxIndex, VSize, Version, Weight};
|
||||
use vecdb::{Database, IterableCloneableVec, LazyVecFrom2, VecIndex};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{ComputedVecsFromTxindex, Source, VecBuilderOptions},
|
||||
};
|
||||
use crate::{indexes, internal::ComputedTxDistribution};
|
||||
|
||||
impl Vecs {
|
||||
pub fn forced_import(
|
||||
@@ -16,13 +13,6 @@ impl Vecs {
|
||||
indexer: &Indexer,
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
let stats = || {
|
||||
VecBuilderOptions::default()
|
||||
.add_average()
|
||||
.add_minmax()
|
||||
.add_percentiles()
|
||||
};
|
||||
|
||||
let txindex_to_weight = LazyVecFrom2::init(
|
||||
"weight",
|
||||
version,
|
||||
@@ -52,23 +42,15 @@ impl Vecs {
|
||||
},
|
||||
);
|
||||
|
||||
let indexes_to_tx_vsize =
|
||||
ComputedTxDistribution::forced_import(db, "tx_vsize", version, indexes)?;
|
||||
|
||||
let indexes_to_tx_weight =
|
||||
ComputedTxDistribution::forced_import(db, "tx_weight", version, indexes)?;
|
||||
|
||||
Ok(Self {
|
||||
indexes_to_tx_vsize: ComputedVecsFromTxindex::forced_import(
|
||||
db,
|
||||
"tx_vsize",
|
||||
Source::Vec(txindex_to_vsize.boxed_clone()),
|
||||
version,
|
||||
indexes,
|
||||
stats(),
|
||||
)?,
|
||||
indexes_to_tx_weight: ComputedVecsFromTxindex::forced_import(
|
||||
db,
|
||||
"tx_weight",
|
||||
Source::Vec(txindex_to_weight.boxed_clone()),
|
||||
version,
|
||||
indexes,
|
||||
stats(),
|
||||
)?,
|
||||
indexes_to_tx_vsize,
|
||||
indexes_to_tx_weight,
|
||||
txindex_to_vsize,
|
||||
txindex_to_weight,
|
||||
})
|
||||
|
||||
@@ -2,12 +2,12 @@ use brk_traversable::Traversable;
|
||||
use brk_types::{StoredU32, TxIndex, VSize, Weight};
|
||||
use vecdb::LazyVecFrom2;
|
||||
|
||||
use crate::internal::ComputedVecsFromTxindex;
|
||||
use crate::internal::ComputedTxDistribution;
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub indexes_to_tx_vsize: ComputedVecsFromTxindex<VSize>,
|
||||
pub indexes_to_tx_weight: ComputedVecsFromTxindex<Weight>,
|
||||
pub indexes_to_tx_vsize: ComputedTxDistribution<VSize>,
|
||||
pub indexes_to_tx_weight: ComputedTxDistribution<Weight>,
|
||||
// Both derive directly from eager sources (base_size, total_size) to avoid Lazy <- Lazy
|
||||
pub txindex_to_vsize: LazyVecFrom2<TxIndex, VSize, TxIndex, StoredU32, TxIndex, StoredU32>,
|
||||
pub txindex_to_weight: LazyVecFrom2<TxIndex, Weight, TxIndex, StoredU32, TxIndex, StoredU32>,
|
||||
|
||||
@@ -4,7 +4,7 @@ use brk_types::{StoredU64, TxVersion};
|
||||
use vecdb::{Exit, TypedVecIterator};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, internal::ComputedVecsFromHeight, ComputeIndexes};
|
||||
use crate::{indexes, internal::ComputedBlockSumCum, ComputeIndexes};
|
||||
|
||||
impl Vecs {
|
||||
pub fn compute(
|
||||
@@ -15,7 +15,7 @@ impl Vecs {
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let compute_indexes_to_tx_vany =
|
||||
|indexes_to_tx_vany: &mut ComputedVecsFromHeight<StoredU64>, txversion: TxVersion| {
|
||||
|indexes_to_tx_vany: &mut ComputedBlockSumCum<StoredU64>, txversion: TxVersion| {
|
||||
let mut txindex_to_txversion_iter = indexer.vecs.tx.txindex_to_txversion.iter()?;
|
||||
indexes_to_tx_vany.compute_all(indexes, starting_indexes, exit, |vec| {
|
||||
vec.compute_filtered_count_from_indexes(
|
||||
|
||||
@@ -3,39 +3,28 @@ use brk_types::Version;
|
||||
use vecdb::Database;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{ComputedVecsFromHeight, Source, VecBuilderOptions},
|
||||
};
|
||||
use crate::{indexes, internal::ComputedBlockSumCum};
|
||||
|
||||
impl Vecs {
|
||||
pub fn forced_import(db: &Database, version: Version, indexes: &indexes::Vecs) -> Result<Self> {
|
||||
let sum_cum = || VecBuilderOptions::default().add_sum().add_cumulative();
|
||||
|
||||
Ok(Self {
|
||||
indexes_to_tx_v1: ComputedVecsFromHeight::forced_import(
|
||||
indexes_to_tx_v1: ComputedBlockSumCum::forced_import(
|
||||
db,
|
||||
"tx_v1",
|
||||
Source::Compute,
|
||||
version,
|
||||
indexes,
|
||||
sum_cum(),
|
||||
)?,
|
||||
indexes_to_tx_v2: ComputedVecsFromHeight::forced_import(
|
||||
indexes_to_tx_v2: ComputedBlockSumCum::forced_import(
|
||||
db,
|
||||
"tx_v2",
|
||||
Source::Compute,
|
||||
version,
|
||||
indexes,
|
||||
sum_cum(),
|
||||
)?,
|
||||
indexes_to_tx_v3: ComputedVecsFromHeight::forced_import(
|
||||
indexes_to_tx_v3: ComputedBlockSumCum::forced_import(
|
||||
db,
|
||||
"tx_v3",
|
||||
Source::Compute,
|
||||
version,
|
||||
indexes,
|
||||
sum_cum(),
|
||||
)?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::StoredU64;
|
||||
|
||||
use crate::internal::ComputedVecsFromHeight;
|
||||
use crate::internal::ComputedBlockSumCum;
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub indexes_to_tx_v1: ComputedVecsFromHeight<StoredU64>,
|
||||
pub indexes_to_tx_v2: ComputedVecsFromHeight<StoredU64>,
|
||||
pub indexes_to_tx_v3: ComputedVecsFromHeight<StoredU64>,
|
||||
pub indexes_to_tx_v1: ComputedBlockSumCum<StoredU64>,
|
||||
pub indexes_to_tx_v2: ComputedBlockSumCum<StoredU64>,
|
||||
pub indexes_to_tx_v3: ComputedBlockSumCum<StoredU64>,
|
||||
}
|
||||
|
||||
@@ -34,46 +34,42 @@ impl Vecs {
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_annualized_volume
|
||||
.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_sum(
|
||||
starting_indexes.dateindex,
|
||||
self.indexes_to_sent_sum.sats.dateindex.unwrap_sum(),
|
||||
365,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
self.indexes_to_annualized_volume.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_sum(
|
||||
starting_indexes.dateindex,
|
||||
&self.indexes_to_sent_sum.sats.dateindex.0,
|
||||
365,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_annualized_volume_btc
|
||||
.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_sum(
|
||||
starting_indexes.dateindex,
|
||||
self.indexes_to_sent_sum.bitcoin.dateindex.unwrap_sum(),
|
||||
365,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
self.indexes_to_annualized_volume_btc.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_sum(
|
||||
starting_indexes.dateindex,
|
||||
&*self.indexes_to_sent_sum.bitcoin.dateindex,
|
||||
365,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
if let Some(indexes_to_sent_sum) = self.indexes_to_sent_sum.dollars.as_ref() {
|
||||
self.indexes_to_annualized_volume_usd
|
||||
.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_sum(
|
||||
starting_indexes.dateindex,
|
||||
indexes_to_sent_sum.dateindex.unwrap_sum(),
|
||||
365,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
self.indexes_to_annualized_volume_usd.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_sum(
|
||||
starting_indexes.dateindex,
|
||||
&indexes_to_sent_sum.dateindex.0,
|
||||
365,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
}
|
||||
|
||||
self.indexes_to_tx_per_sec
|
||||
.compute_all(starting_indexes, exit, |v| {
|
||||
self.indexes_to_tx_per_sec.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_transform2(
|
||||
starting_indexes.dateindex,
|
||||
count_vecs.indexes_to_tx_count.dateindex.unwrap_sum(),
|
||||
&count_vecs.indexes_to_tx_count.dateindex.sum_cum.sum.0,
|
||||
&indexes.time.dateindex_to_date,
|
||||
|(i, tx_count, date, ..)| {
|
||||
let completion = date.completion();
|
||||
@@ -89,11 +85,10 @@ impl Vecs {
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_inputs_per_sec
|
||||
.compute_all(starting_indexes, exit, |v| {
|
||||
self.indexes_to_inputs_per_sec.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_transform2(
|
||||
starting_indexes.dateindex,
|
||||
inputs_count.indexes_to_count.dateindex.unwrap_sum(),
|
||||
&inputs_count.indexes_to_count.dateindex.sum_cum.sum.0,
|
||||
&indexes.time.dateindex_to_date,
|
||||
|(i, input_count, date, ..)| {
|
||||
let completion = date.completion();
|
||||
@@ -109,11 +104,10 @@ impl Vecs {
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_outputs_per_sec
|
||||
.compute_all(starting_indexes, exit, |v| {
|
||||
self.indexes_to_outputs_per_sec.compute_all(starting_indexes, exit, |v| {
|
||||
v.compute_transform2(
|
||||
starting_indexes.dateindex,
|
||||
outputs_count.indexes_to_count.dateindex.unwrap_sum(),
|
||||
&outputs_count.indexes_to_count.dateindex.sum_cum.sum.0,
|
||||
&indexes.time.dateindex_to_date,
|
||||
|(i, output_count, date, ..)| {
|
||||
let completion = date.completion();
|
||||
|
||||
@@ -5,7 +5,7 @@ use vecdb::Database;
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{ComputedValueVecsFromHeight, ComputedVecsFromDateIndex, Source, VecBuilderOptions},
|
||||
internal::{ComputedDateLast, ValueBlockSum},
|
||||
};
|
||||
|
||||
impl Vecs {
|
||||
@@ -16,65 +16,50 @@ impl Vecs {
|
||||
compute_dollars: bool,
|
||||
) -> Result<Self> {
|
||||
let v2 = Version::TWO;
|
||||
let last = || VecBuilderOptions::default().add_last();
|
||||
|
||||
Ok(Self {
|
||||
indexes_to_sent_sum: ComputedValueVecsFromHeight::forced_import(
|
||||
indexes_to_sent_sum: ValueBlockSum::forced_import(
|
||||
db,
|
||||
"sent_sum",
|
||||
Source::Compute,
|
||||
version,
|
||||
VecBuilderOptions::default().add_sum(),
|
||||
compute_dollars,
|
||||
indexes,
|
||||
compute_dollars,
|
||||
)?,
|
||||
indexes_to_annualized_volume: ComputedVecsFromDateIndex::forced_import(
|
||||
indexes_to_annualized_volume: ComputedDateLast::forced_import(
|
||||
db,
|
||||
"annualized_volume",
|
||||
Source::Compute,
|
||||
version,
|
||||
indexes,
|
||||
last(),
|
||||
)?,
|
||||
indexes_to_annualized_volume_btc: ComputedVecsFromDateIndex::forced_import(
|
||||
indexes_to_annualized_volume_btc: ComputedDateLast::forced_import(
|
||||
db,
|
||||
"annualized_volume_btc",
|
||||
Source::Compute,
|
||||
version,
|
||||
indexes,
|
||||
last(),
|
||||
)?,
|
||||
indexes_to_annualized_volume_usd: ComputedVecsFromDateIndex::forced_import(
|
||||
indexes_to_annualized_volume_usd: ComputedDateLast::forced_import(
|
||||
db,
|
||||
"annualized_volume_usd",
|
||||
Source::Compute,
|
||||
version,
|
||||
indexes,
|
||||
last(),
|
||||
)?,
|
||||
indexes_to_tx_per_sec: ComputedVecsFromDateIndex::forced_import(
|
||||
indexes_to_tx_per_sec: ComputedDateLast::forced_import(
|
||||
db,
|
||||
"tx_per_sec",
|
||||
Source::Compute,
|
||||
version + v2,
|
||||
indexes,
|
||||
last(),
|
||||
)?,
|
||||
indexes_to_outputs_per_sec: ComputedVecsFromDateIndex::forced_import(
|
||||
indexes_to_outputs_per_sec: ComputedDateLast::forced_import(
|
||||
db,
|
||||
"outputs_per_sec",
|
||||
Source::Compute,
|
||||
version + v2,
|
||||
indexes,
|
||||
last(),
|
||||
)?,
|
||||
indexes_to_inputs_per_sec: ComputedVecsFromDateIndex::forced_import(
|
||||
indexes_to_inputs_per_sec: ComputedDateLast::forced_import(
|
||||
db,
|
||||
"inputs_per_sec",
|
||||
Source::Compute,
|
||||
version + v2,
|
||||
indexes,
|
||||
last(),
|
||||
)?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::{Bitcoin, Dollars, Sats, StoredF32};
|
||||
|
||||
use crate::internal::{ComputedValueVecsFromHeight, ComputedVecsFromDateIndex};
|
||||
use crate::internal::{ComputedDateLast, ValueBlockSum};
|
||||
|
||||
/// Volume metrics
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub indexes_to_sent_sum: ComputedValueVecsFromHeight,
|
||||
pub indexes_to_annualized_volume: ComputedVecsFromDateIndex<Sats>,
|
||||
pub indexes_to_annualized_volume_btc: ComputedVecsFromDateIndex<Bitcoin>,
|
||||
pub indexes_to_annualized_volume_usd: ComputedVecsFromDateIndex<Dollars>,
|
||||
pub indexes_to_tx_per_sec: ComputedVecsFromDateIndex<StoredF32>,
|
||||
pub indexes_to_outputs_per_sec: ComputedVecsFromDateIndex<StoredF32>,
|
||||
pub indexes_to_inputs_per_sec: ComputedVecsFromDateIndex<StoredF32>,
|
||||
pub indexes_to_sent_sum: ValueBlockSum,
|
||||
pub indexes_to_annualized_volume: ComputedDateLast<Sats>,
|
||||
pub indexes_to_annualized_volume_btc: ComputedDateLast<Bitcoin>,
|
||||
pub indexes_to_annualized_volume_usd: ComputedDateLast<Dollars>,
|
||||
pub indexes_to_tx_per_sec: ComputedDateLast<StoredF32>,
|
||||
pub indexes_to_outputs_per_sec: ComputedDateLast<StoredF32>,
|
||||
pub indexes_to_inputs_per_sec: ComputedDateLast<StoredF32>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user