mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
computer: renames
This commit is contained in:
6
Cargo.lock
generated
6
Cargo.lock
generated
@@ -2762,6 +2762,8 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rawdb"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67a5e6777f8192d5ccaafddad97373ffa60e08f3251afa9365e2a161c69fd9dc"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
@@ -3703,6 +3705,8 @@ checksum = "8f54a172d0620933a27a4360d3db3e2ae0dd6cceae9730751a036bbf182c4b23"
|
||||
[[package]]
|
||||
name = "vecdb"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "650b943316db7a11c54684ab0390a787aed7fdb306f2e0c1f7cbdf8b2440644a"
|
||||
dependencies = [
|
||||
"ctrlc",
|
||||
"log",
|
||||
@@ -3722,6 +3726,8 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vecdb_derive"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75b71f12e3bfb96b62f18d6293029870102764565895effc4e25922002ad1db6"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn",
|
||||
|
||||
@@ -79,8 +79,8 @@ serde_json = { version = "1.0.149", features = ["float_roundtrip"] }
|
||||
smallvec = "1.15.1"
|
||||
tokio = { version = "1.49.0", features = ["rt-multi-thread"] }
|
||||
tracing = { version = "0.1", default-features = false, features = ["std"] }
|
||||
# vecdb = { version = "0.5.6", features = ["derive", "serde_json", "pco", "schemars"] }
|
||||
vecdb = { path = "../anydb/crates/vecdb", features = ["derive", "serde_json", "pco", "schemars"] }
|
||||
vecdb = { version = "0.5.7", features = ["derive", "serde_json", "pco", "schemars"] }
|
||||
# vecdb = { path = "../anydb/crates/vecdb", features = ["derive", "serde_json", "pco", "schemars"] }
|
||||
# vecdb = { git = "https://github.com/anydb-rs/anydb", features = ["derive", "serde_json", "pco"] }
|
||||
|
||||
[workspace.metadata.release]
|
||||
|
||||
@@ -2741,56 +2741,6 @@ impl Price111dSmaPattern {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct ActivePriceRatioPattern {
|
||||
pub ratio: MetricPattern4<StoredF32>,
|
||||
pub ratio_1m_sma: MetricPattern4<StoredF32>,
|
||||
pub ratio_1w_sma: MetricPattern4<StoredF32>,
|
||||
pub ratio_1y_sd: Ratio1ySdPattern,
|
||||
pub ratio_2y_sd: Ratio1ySdPattern,
|
||||
pub ratio_4y_sd: Ratio1ySdPattern,
|
||||
pub ratio_pct1: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct1_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct2: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct2_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct5: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct5_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct95: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct95_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct98: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct98_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct99: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct99_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_sd: Ratio1ySdPattern,
|
||||
}
|
||||
|
||||
impl ActivePriceRatioPattern {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
ratio: MetricPattern4::new(client.clone(), acc.clone()),
|
||||
ratio_1m_sma: MetricPattern4::new(client.clone(), _m(&acc, "1m_sma")),
|
||||
ratio_1w_sma: MetricPattern4::new(client.clone(), _m(&acc, "1w_sma")),
|
||||
ratio_1y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "1y")),
|
||||
ratio_2y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "2y")),
|
||||
ratio_4y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "4y")),
|
||||
ratio_pct1: MetricPattern4::new(client.clone(), _m(&acc, "pct1")),
|
||||
ratio_pct1_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct1_usd")),
|
||||
ratio_pct2: MetricPattern4::new(client.clone(), _m(&acc, "pct2")),
|
||||
ratio_pct2_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct2_usd")),
|
||||
ratio_pct5: MetricPattern4::new(client.clone(), _m(&acc, "pct5")),
|
||||
ratio_pct5_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct5_usd")),
|
||||
ratio_pct95: MetricPattern4::new(client.clone(), _m(&acc, "pct95")),
|
||||
ratio_pct95_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct95_usd")),
|
||||
ratio_pct98: MetricPattern4::new(client.clone(), _m(&acc, "pct98")),
|
||||
ratio_pct98_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct98_usd")),
|
||||
ratio_pct99: MetricPattern4::new(client.clone(), _m(&acc, "pct99")),
|
||||
ratio_pct99_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct99_usd")),
|
||||
ratio_sd: Ratio1ySdPattern::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct PercentilesPattern2 {
|
||||
pub cost_basis_pct05: MetricPattern4<Dollars>,
|
||||
@@ -2841,6 +2791,56 @@ impl PercentilesPattern2 {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct ActivePriceRatioPattern {
|
||||
pub ratio: MetricPattern4<StoredF32>,
|
||||
pub ratio_1m_sma: MetricPattern4<StoredF32>,
|
||||
pub ratio_1w_sma: MetricPattern4<StoredF32>,
|
||||
pub ratio_1y_sd: Ratio1ySdPattern,
|
||||
pub ratio_2y_sd: Ratio1ySdPattern,
|
||||
pub ratio_4y_sd: Ratio1ySdPattern,
|
||||
pub ratio_pct1: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct1_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct2: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct2_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct5: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct5_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct95: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct95_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct98: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct98_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_pct99: MetricPattern4<StoredF32>,
|
||||
pub ratio_pct99_usd: MetricPattern4<Dollars>,
|
||||
pub ratio_sd: Ratio1ySdPattern,
|
||||
}
|
||||
|
||||
impl ActivePriceRatioPattern {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
ratio: MetricPattern4::new(client.clone(), acc.clone()),
|
||||
ratio_1m_sma: MetricPattern4::new(client.clone(), _m(&acc, "1m_sma")),
|
||||
ratio_1w_sma: MetricPattern4::new(client.clone(), _m(&acc, "1w_sma")),
|
||||
ratio_1y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "1y")),
|
||||
ratio_2y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "2y")),
|
||||
ratio_4y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "4y")),
|
||||
ratio_pct1: MetricPattern4::new(client.clone(), _m(&acc, "pct1")),
|
||||
ratio_pct1_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct1_usd")),
|
||||
ratio_pct2: MetricPattern4::new(client.clone(), _m(&acc, "pct2")),
|
||||
ratio_pct2_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct2_usd")),
|
||||
ratio_pct5: MetricPattern4::new(client.clone(), _m(&acc, "pct5")),
|
||||
ratio_pct5_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct5_usd")),
|
||||
ratio_pct95: MetricPattern4::new(client.clone(), _m(&acc, "pct95")),
|
||||
ratio_pct95_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct95_usd")),
|
||||
ratio_pct98: MetricPattern4::new(client.clone(), _m(&acc, "pct98")),
|
||||
ratio_pct98_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct98_usd")),
|
||||
ratio_pct99: MetricPattern4::new(client.clone(), _m(&acc, "pct99")),
|
||||
ratio_pct99_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct99_usd")),
|
||||
ratio_sd: Ratio1ySdPattern::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct RelativePattern5 {
|
||||
pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1<StoredF32>,
|
||||
@@ -3073,38 +3073,6 @@ impl<T: DeserializeOwned> ClassAveragePricePattern<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct RelativePattern2 {
|
||||
pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1<StoredF32>,
|
||||
pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1<StoredF32>,
|
||||
pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1<StoredF32>,
|
||||
pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1<StoredF32>,
|
||||
pub supply_in_loss_rel_to_own_supply: MetricPattern1<StoredF64>,
|
||||
pub supply_in_profit_rel_to_own_supply: MetricPattern1<StoredF64>,
|
||||
pub unrealized_loss_rel_to_own_market_cap: MetricPattern1<StoredF32>,
|
||||
pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1<StoredF32>,
|
||||
pub unrealized_profit_rel_to_own_market_cap: MetricPattern1<StoredF32>,
|
||||
pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1<StoredF32>,
|
||||
}
|
||||
|
||||
impl RelativePattern2 {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")),
|
||||
neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")),
|
||||
net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")),
|
||||
net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")),
|
||||
supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")),
|
||||
supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")),
|
||||
unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")),
|
||||
unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")),
|
||||
unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")),
|
||||
unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct RelativePattern {
|
||||
pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1<StoredF32>,
|
||||
@@ -3137,6 +3105,38 @@ impl RelativePattern {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct RelativePattern2 {
|
||||
pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1<StoredF32>,
|
||||
pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1<StoredF32>,
|
||||
pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1<StoredF32>,
|
||||
pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1<StoredF32>,
|
||||
pub supply_in_loss_rel_to_own_supply: MetricPattern1<StoredF64>,
|
||||
pub supply_in_profit_rel_to_own_supply: MetricPattern1<StoredF64>,
|
||||
pub unrealized_loss_rel_to_own_market_cap: MetricPattern1<StoredF32>,
|
||||
pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1<StoredF32>,
|
||||
pub unrealized_profit_rel_to_own_market_cap: MetricPattern1<StoredF32>,
|
||||
pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1<StoredF32>,
|
||||
}
|
||||
|
||||
impl RelativePattern2 {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")),
|
||||
neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")),
|
||||
net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")),
|
||||
net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")),
|
||||
supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")),
|
||||
supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")),
|
||||
unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")),
|
||||
unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")),
|
||||
unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")),
|
||||
unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct AddrCountPattern {
|
||||
pub all: MetricPattern1<StoredU64>,
|
||||
@@ -3167,36 +3167,6 @@ impl AddrCountPattern {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct FeeRatePattern<T> {
|
||||
pub average: MetricPattern1<T>,
|
||||
pub max: MetricPattern1<T>,
|
||||
pub median: MetricPattern12<T>,
|
||||
pub min: MetricPattern1<T>,
|
||||
pub pct10: MetricPattern12<T>,
|
||||
pub pct25: MetricPattern12<T>,
|
||||
pub pct75: MetricPattern12<T>,
|
||||
pub pct90: MetricPattern12<T>,
|
||||
pub txindex: MetricPattern28<T>,
|
||||
}
|
||||
|
||||
impl<T: DeserializeOwned> FeeRatePattern<T> {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
average: MetricPattern1::new(client.clone(), _m(&acc, "average")),
|
||||
max: MetricPattern1::new(client.clone(), _m(&acc, "max")),
|
||||
median: MetricPattern12::new(client.clone(), _m(&acc, "median")),
|
||||
min: MetricPattern1::new(client.clone(), _m(&acc, "min")),
|
||||
pct10: MetricPattern12::new(client.clone(), _m(&acc, "pct10")),
|
||||
pct25: MetricPattern12::new(client.clone(), _m(&acc, "pct25")),
|
||||
pct75: MetricPattern12::new(client.clone(), _m(&acc, "pct75")),
|
||||
pct90: MetricPattern12::new(client.clone(), _m(&acc, "pct90")),
|
||||
txindex: MetricPattern28::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct OhlcPattern<T> {
|
||||
pub dateindex: MetricPattern7<T>,
|
||||
@@ -3227,6 +3197,36 @@ impl<T: DeserializeOwned> OhlcPattern<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct FeeRatePattern<T> {
|
||||
pub average: MetricPattern1<T>,
|
||||
pub max: MetricPattern1<T>,
|
||||
pub median: MetricPattern12<T>,
|
||||
pub min: MetricPattern1<T>,
|
||||
pub pct10: MetricPattern12<T>,
|
||||
pub pct25: MetricPattern12<T>,
|
||||
pub pct75: MetricPattern12<T>,
|
||||
pub pct90: MetricPattern12<T>,
|
||||
pub txindex: MetricPattern28<T>,
|
||||
}
|
||||
|
||||
impl<T: DeserializeOwned> FeeRatePattern<T> {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
average: MetricPattern1::new(client.clone(), _m(&acc, "average")),
|
||||
max: MetricPattern1::new(client.clone(), _m(&acc, "max")),
|
||||
median: MetricPattern12::new(client.clone(), _m(&acc, "median")),
|
||||
min: MetricPattern1::new(client.clone(), _m(&acc, "min")),
|
||||
pct10: MetricPattern12::new(client.clone(), _m(&acc, "pct10")),
|
||||
pct25: MetricPattern12::new(client.clone(), _m(&acc, "pct25")),
|
||||
pct75: MetricPattern12::new(client.clone(), _m(&acc, "pct75")),
|
||||
pct90: MetricPattern12::new(client.clone(), _m(&acc, "pct90")),
|
||||
txindex: MetricPattern28::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct _0satsPattern {
|
||||
pub activity: ActivityPattern2,
|
||||
@@ -3256,76 +3256,24 @@ impl _0satsPattern {
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct _0satsPattern2 {
|
||||
pub struct _10yPattern {
|
||||
pub activity: ActivityPattern2,
|
||||
pub cost_basis: CostBasisPattern,
|
||||
pub outputs: OutputsPattern,
|
||||
pub realized: RealizedPattern,
|
||||
pub relative: RelativePattern4,
|
||||
pub supply: SupplyPattern2,
|
||||
pub unrealized: UnrealizedPattern,
|
||||
}
|
||||
|
||||
impl _0satsPattern2 {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
activity: ActivityPattern2::new(client.clone(), acc.clone()),
|
||||
cost_basis: CostBasisPattern::new(client.clone(), acc.clone()),
|
||||
outputs: OutputsPattern::new(client.clone(), acc.clone()),
|
||||
realized: RealizedPattern::new(client.clone(), acc.clone()),
|
||||
relative: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")),
|
||||
supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")),
|
||||
unrealized: UnrealizedPattern::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct UnrealizedPattern {
|
||||
pub neg_unrealized_loss: MetricPattern1<Dollars>,
|
||||
pub net_unrealized_pnl: MetricPattern1<Dollars>,
|
||||
pub supply_in_loss: _24hCoinbaseSumPattern,
|
||||
pub supply_in_profit: _24hCoinbaseSumPattern,
|
||||
pub total_unrealized_pnl: MetricPattern1<Dollars>,
|
||||
pub unrealized_loss: MetricPattern1<Dollars>,
|
||||
pub unrealized_profit: MetricPattern1<Dollars>,
|
||||
}
|
||||
|
||||
impl UnrealizedPattern {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
neg_unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")),
|
||||
net_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl")),
|
||||
supply_in_loss: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_loss")),
|
||||
supply_in_profit: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_profit")),
|
||||
total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_unrealized_pnl")),
|
||||
unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss")),
|
||||
unrealized_profit: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct _100btcPattern {
|
||||
pub activity: ActivityPattern2,
|
||||
pub cost_basis: CostBasisPattern,
|
||||
pub outputs: OutputsPattern,
|
||||
pub realized: RealizedPattern,
|
||||
pub realized: RealizedPattern4,
|
||||
pub relative: RelativePattern,
|
||||
pub supply: SupplyPattern2,
|
||||
pub unrealized: UnrealizedPattern,
|
||||
}
|
||||
|
||||
impl _100btcPattern {
|
||||
impl _10yPattern {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
activity: ActivityPattern2::new(client.clone(), acc.clone()),
|
||||
cost_basis: CostBasisPattern::new(client.clone(), acc.clone()),
|
||||
outputs: OutputsPattern::new(client.clone(), acc.clone()),
|
||||
realized: RealizedPattern::new(client.clone(), acc.clone()),
|
||||
realized: RealizedPattern4::new(client.clone(), acc.clone()),
|
||||
relative: RelativePattern::new(client.clone(), acc.clone()),
|
||||
supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")),
|
||||
unrealized: UnrealizedPattern::new(client.clone(), acc.clone()),
|
||||
@@ -3360,24 +3308,50 @@ impl _10yTo12yPattern {
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct _10yPattern {
|
||||
pub struct _0satsPattern2 {
|
||||
pub activity: ActivityPattern2,
|
||||
pub cost_basis: CostBasisPattern,
|
||||
pub outputs: OutputsPattern,
|
||||
pub realized: RealizedPattern4,
|
||||
pub relative: RelativePattern,
|
||||
pub realized: RealizedPattern,
|
||||
pub relative: RelativePattern4,
|
||||
pub supply: SupplyPattern2,
|
||||
pub unrealized: UnrealizedPattern,
|
||||
}
|
||||
|
||||
impl _10yPattern {
|
||||
impl _0satsPattern2 {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
activity: ActivityPattern2::new(client.clone(), acc.clone()),
|
||||
cost_basis: CostBasisPattern::new(client.clone(), acc.clone()),
|
||||
outputs: OutputsPattern::new(client.clone(), acc.clone()),
|
||||
realized: RealizedPattern4::new(client.clone(), acc.clone()),
|
||||
realized: RealizedPattern::new(client.clone(), acc.clone()),
|
||||
relative: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")),
|
||||
supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")),
|
||||
unrealized: UnrealizedPattern::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct _100btcPattern {
|
||||
pub activity: ActivityPattern2,
|
||||
pub cost_basis: CostBasisPattern,
|
||||
pub outputs: OutputsPattern,
|
||||
pub realized: RealizedPattern,
|
||||
pub relative: RelativePattern,
|
||||
pub supply: SupplyPattern2,
|
||||
pub unrealized: UnrealizedPattern,
|
||||
}
|
||||
|
||||
impl _100btcPattern {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
activity: ActivityPattern2::new(client.clone(), acc.clone()),
|
||||
cost_basis: CostBasisPattern::new(client.clone(), acc.clone()),
|
||||
outputs: OutputsPattern::new(client.clone(), acc.clone()),
|
||||
realized: RealizedPattern::new(client.clone(), acc.clone()),
|
||||
relative: RelativePattern::new(client.clone(), acc.clone()),
|
||||
supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")),
|
||||
unrealized: UnrealizedPattern::new(client.clone(), acc.clone()),
|
||||
@@ -3385,6 +3359,32 @@ impl _10yPattern {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct UnrealizedPattern {
|
||||
pub neg_unrealized_loss: MetricPattern1<Dollars>,
|
||||
pub net_unrealized_pnl: MetricPattern1<Dollars>,
|
||||
pub supply_in_loss: _24hCoinbaseSumPattern,
|
||||
pub supply_in_profit: _24hCoinbaseSumPattern,
|
||||
pub total_unrealized_pnl: MetricPattern1<Dollars>,
|
||||
pub unrealized_loss: MetricPattern1<Dollars>,
|
||||
pub unrealized_profit: MetricPattern1<Dollars>,
|
||||
}
|
||||
|
||||
impl UnrealizedPattern {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
neg_unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")),
|
||||
net_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl")),
|
||||
supply_in_loss: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_loss")),
|
||||
supply_in_profit: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "supply_in_profit")),
|
||||
total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_unrealized_pnl")),
|
||||
unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss")),
|
||||
unrealized_profit: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct PeriodCagrPattern {
|
||||
pub _10y: MetricPattern4<StoredF32>,
|
||||
@@ -3414,7 +3414,7 @@ impl PeriodCagrPattern {
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct BitcoinPattern<T> {
|
||||
pub average: MetricPattern2<T>,
|
||||
pub cumulative: MetricPattern2<T>,
|
||||
pub cumulative: MetricPattern1<T>,
|
||||
pub height: MetricPattern12<T>,
|
||||
pub max: MetricPattern2<T>,
|
||||
pub min: MetricPattern2<T>,
|
||||
@@ -3427,7 +3427,7 @@ impl<T: DeserializeOwned> BitcoinPattern<T> {
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
average: MetricPattern2::new(client.clone(), _m(&acc, "average")),
|
||||
cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")),
|
||||
cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")),
|
||||
height: MetricPattern12::new(client.clone(), acc.clone()),
|
||||
max: MetricPattern2::new(client.clone(), _m(&acc, "max")),
|
||||
min: MetricPattern2::new(client.clone(), _m(&acc, "min")),
|
||||
@@ -3671,22 +3671,6 @@ impl SatsPattern {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct SupplyPattern2 {
|
||||
pub halved: _24hCoinbaseSumPattern,
|
||||
pub total: _24hCoinbaseSumPattern,
|
||||
}
|
||||
|
||||
impl SupplyPattern2 {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
halved: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "half")),
|
||||
total: _24hCoinbaseSumPattern::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct CostBasisPattern {
|
||||
pub max: MetricPattern1<Dollars>,
|
||||
@@ -3719,6 +3703,22 @@ impl _1dReturns1mSdPattern {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct SupplyPattern2 {
|
||||
pub halved: _24hCoinbaseSumPattern,
|
||||
pub total: _24hCoinbaseSumPattern,
|
||||
}
|
||||
|
||||
impl SupplyPattern2 {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
halved: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "half")),
|
||||
total: _24hCoinbaseSumPattern::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct RelativePattern4 {
|
||||
pub supply_in_loss_rel_to_own_supply: MetricPattern1<StoredF64>,
|
||||
@@ -3737,7 +3737,7 @@ impl RelativePattern4 {
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct BlockCountPattern<T> {
|
||||
pub cumulative: MetricPattern1<T>,
|
||||
pub cumulative: MetricPattern2<T>,
|
||||
pub sum: MetricPattern1<T>,
|
||||
}
|
||||
|
||||
@@ -3745,26 +3745,12 @@ impl<T: DeserializeOwned> BlockCountPattern<T> {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")),
|
||||
cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")),
|
||||
sum: MetricPattern1::new(client.clone(), acc.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct OutputsPattern {
|
||||
pub utxo_count: MetricPattern1<StoredU64>,
|
||||
}
|
||||
|
||||
impl OutputsPattern {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
utxo_count: MetricPattern1::new(client.clone(), _m(&acc, "utxo_count")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct RealizedPriceExtraPattern {
|
||||
pub ratio: MetricPattern4<StoredF32>,
|
||||
@@ -3779,6 +3765,20 @@ impl RealizedPriceExtraPattern {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct OutputsPattern {
|
||||
pub utxo_count: MetricPattern1<StoredU64>,
|
||||
}
|
||||
|
||||
impl OutputsPattern {
|
||||
/// Create a new pattern node with accumulated metric name.
|
||||
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
|
||||
Self {
|
||||
utxo_count: MetricPattern1::new(client.clone(), _m(&acc, "utxo_count")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Pattern struct for repeated tree structure.
|
||||
pub struct EmptyPattern<T> {
|
||||
pub identity: MetricPattern25<T>,
|
||||
|
||||
@@ -4,7 +4,7 @@ use brk_types::{Height, StoredU64, Version};
|
||||
use vecdb::{Database, IterableCloneableVec, VecIndex};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, internal::{ComputedDerivedBlockFull, BlockFullLazyHeight}};
|
||||
use crate::{indexes, internal::{ComputedDerivedBlockFull, LazyBlockFullHeight}};
|
||||
|
||||
impl Vecs {
|
||||
pub fn forced_import(
|
||||
@@ -14,7 +14,7 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
Ok(Self {
|
||||
vbytes: BlockFullLazyHeight::forced_import_with_init(
|
||||
vbytes: LazyBlockFullHeight::forced_import_with_init(
|
||||
db,
|
||||
"block_vbytes",
|
||||
version,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::{StoredU64, Weight};
|
||||
|
||||
use crate::internal::{ComputedDerivedBlockFull, BlockFullLazyHeight};
|
||||
use crate::internal::{ComputedDerivedBlockFull, LazyBlockFullHeight};
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub vbytes: BlockFullLazyHeight<StoredU64, Weight>,
|
||||
pub vbytes: LazyBlockFullHeight<StoredU64, Weight>,
|
||||
pub size: ComputedDerivedBlockFull<StoredU64>,
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ use crate::{
|
||||
distribution::state::RealizedState,
|
||||
indexes,
|
||||
internal::{
|
||||
BinaryBlockSum, BinaryBlockSumCum, ComputedBlockLast, ComputedBlockSum,
|
||||
ComputedBlockSumCum, ComputedDateLast, ComputedRatioVecsDate, DollarsMinus,
|
||||
ComputedBlockLast, ComputedBlockSum, ComputedBlockSumCum, ComputedDateLast,
|
||||
ComputedRatioVecsDate, DollarsMinus, LazyBinaryBlockSum, LazyBinaryBlockSumCum,
|
||||
LazyBlockSum, LazyBlockSumCum, LazyDateLast, PercentageDollarsF32, StoredF32Identity,
|
||||
},
|
||||
price,
|
||||
@@ -43,9 +43,9 @@ pub struct RealizedMetrics {
|
||||
pub realized_value: ComputedBlockSum<Dollars>,
|
||||
|
||||
// === Realized vs Realized Cap Ratios (lazy) ===
|
||||
pub realized_profit_rel_to_realized_cap: BinaryBlockSumCum<StoredF32, Dollars, Dollars>,
|
||||
pub realized_loss_rel_to_realized_cap: BinaryBlockSumCum<StoredF32, Dollars, Dollars>,
|
||||
pub net_realized_pnl_rel_to_realized_cap: BinaryBlockSumCum<StoredF32, Dollars, Dollars>,
|
||||
pub realized_profit_rel_to_realized_cap: LazyBinaryBlockSumCum<StoredF32, Dollars, Dollars>,
|
||||
pub realized_loss_rel_to_realized_cap: LazyBinaryBlockSumCum<StoredF32, Dollars, Dollars>,
|
||||
pub net_realized_pnl_rel_to_realized_cap: LazyBinaryBlockSumCum<StoredF32, Dollars, Dollars>,
|
||||
|
||||
// === Total Realized PnL ===
|
||||
pub total_realized_pnl: LazyBlockSum<Dollars>,
|
||||
@@ -56,8 +56,8 @@ pub struct RealizedMetrics {
|
||||
pub value_destroyed: ComputedBlockSum<Dollars>,
|
||||
|
||||
// === Adjusted Value (lazy: cohort - up_to_1h) ===
|
||||
pub adjusted_value_created: Option<BinaryBlockSum<Dollars, Dollars, Dollars>>,
|
||||
pub adjusted_value_destroyed: Option<BinaryBlockSum<Dollars, Dollars, Dollars>>,
|
||||
pub adjusted_value_created: Option<LazyBinaryBlockSum<Dollars, Dollars, Dollars>>,
|
||||
pub adjusted_value_destroyed: Option<LazyBinaryBlockSum<Dollars, Dollars, Dollars>>,
|
||||
|
||||
// === SOPR (Spent Output Profit Ratio) ===
|
||||
pub sopr: EagerVec<PcoVec<DateIndex, StoredF64>>,
|
||||
@@ -140,7 +140,7 @@ impl RealizedMetrics {
|
||||
|
||||
// Construct lazy ratio vecs
|
||||
let realized_profit_rel_to_realized_cap =
|
||||
BinaryBlockSumCum::from_computed_last::<PercentageDollarsF32>(
|
||||
LazyBinaryBlockSumCum::from_computed_last::<PercentageDollarsF32>(
|
||||
&cfg.name("realized_profit_rel_to_realized_cap"),
|
||||
cfg.version + v1,
|
||||
realized_profit.height.boxed_clone(),
|
||||
@@ -150,7 +150,7 @@ impl RealizedMetrics {
|
||||
);
|
||||
|
||||
let realized_loss_rel_to_realized_cap =
|
||||
BinaryBlockSumCum::from_computed_last::<PercentageDollarsF32>(
|
||||
LazyBinaryBlockSumCum::from_computed_last::<PercentageDollarsF32>(
|
||||
&cfg.name("realized_loss_rel_to_realized_cap"),
|
||||
cfg.version + v1,
|
||||
realized_loss.height.boxed_clone(),
|
||||
@@ -160,7 +160,7 @@ impl RealizedMetrics {
|
||||
);
|
||||
|
||||
let net_realized_pnl_rel_to_realized_cap =
|
||||
BinaryBlockSumCum::from_computed_last::<PercentageDollarsF32>(
|
||||
LazyBinaryBlockSumCum::from_computed_last::<PercentageDollarsF32>(
|
||||
&cfg.name("net_realized_pnl_rel_to_realized_cap"),
|
||||
cfg.version + v1,
|
||||
net_realized_pnl.height.boxed_clone(),
|
||||
@@ -194,7 +194,7 @@ impl RealizedMetrics {
|
||||
let adjusted_value_created =
|
||||
(compute_adjusted && cfg.up_to_1h_realized.is_some()).then(|| {
|
||||
let up_to_1h = cfg.up_to_1h_realized.unwrap();
|
||||
BinaryBlockSum::from_computed::<DollarsMinus>(
|
||||
LazyBinaryBlockSum::from_computed::<DollarsMinus>(
|
||||
&cfg.name("adjusted_value_created"),
|
||||
cfg.version,
|
||||
&value_created,
|
||||
@@ -204,7 +204,7 @@ impl RealizedMetrics {
|
||||
let adjusted_value_destroyed =
|
||||
(compute_adjusted && cfg.up_to_1h_realized.is_some()).then(|| {
|
||||
let up_to_1h = cfg.up_to_1h_realized.unwrap();
|
||||
BinaryBlockSum::from_computed::<DollarsMinus>(
|
||||
LazyBinaryBlockSum::from_computed::<DollarsMinus>(
|
||||
&cfg.name("adjusted_value_destroyed"),
|
||||
cfg.version,
|
||||
&value_destroyed,
|
||||
|
||||
@@ -9,7 +9,7 @@ use vecdb::{AnyStoredVec, AnyVec, Exit, GenericStoredVec};
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
HalfClosePriceTimesSats, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyBinaryLastBlockValue,
|
||||
HalfClosePriceTimesSats, HalveDollars, HalveSats, HalveSatsToBitcoin, LazyBinaryValueBlockLast,
|
||||
ValueBlockLast,
|
||||
},
|
||||
price,
|
||||
@@ -21,7 +21,7 @@ use super::ImportConfig;
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct SupplyMetrics {
|
||||
pub total: ValueBlockLast,
|
||||
pub halved: LazyBinaryLastBlockValue,
|
||||
pub halved: LazyBinaryValueBlockLast,
|
||||
}
|
||||
|
||||
impl SupplyMetrics {
|
||||
@@ -37,7 +37,7 @@ impl SupplyMetrics {
|
||||
compute_dollars,
|
||||
)?;
|
||||
|
||||
let supply_half = LazyBinaryLastBlockValue::from_block_source::<
|
||||
let supply_half = LazyBinaryValueBlockLast::from_block_source::<
|
||||
HalveSats,
|
||||
HalveSatsToBitcoin,
|
||||
HalfClosePriceTimesSats,
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::{
|
||||
distribution::state::UnrealizedState,
|
||||
internal::{
|
||||
ComputedHeightDateLast, DollarsMinus, DollarsPlus, LazyBinaryBlockLast, LazyBlockLast,
|
||||
ValueBlockDateLast,
|
||||
ValueHeightDateLast,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@ use super::ImportConfig;
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct UnrealizedMetrics {
|
||||
// === Supply in Profit/Loss ===
|
||||
pub supply_in_profit: ValueBlockDateLast,
|
||||
pub supply_in_loss: ValueBlockDateLast,
|
||||
pub supply_in_profit: ValueHeightDateLast,
|
||||
pub supply_in_loss: ValueHeightDateLast,
|
||||
|
||||
// === Unrealized Profit/Loss ===
|
||||
pub unrealized_profit: ComputedHeightDateLast<Dollars>,
|
||||
@@ -40,7 +40,7 @@ impl UnrealizedMetrics {
|
||||
let compute_dollars = cfg.compute_dollars();
|
||||
|
||||
// === Supply in Profit/Loss ===
|
||||
let supply_in_profit = ValueBlockDateLast::forced_import(
|
||||
let supply_in_profit = ValueHeightDateLast::forced_import(
|
||||
cfg.db,
|
||||
&cfg.name("supply_in_profit"),
|
||||
cfg.version,
|
||||
@@ -48,7 +48,7 @@ impl UnrealizedMetrics {
|
||||
cfg.indexes,
|
||||
cfg.price,
|
||||
)?;
|
||||
let supply_in_loss = ValueBlockDateLast::forced_import(
|
||||
let supply_in_loss = ValueHeightDateLast::forced_import(
|
||||
cfg.db,
|
||||
&cfg.name("supply_in_loss"),
|
||||
cfg.version,
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
//! Block-level computed types (height + dateindex + periods + difficultyepoch).
|
||||
//!
|
||||
//! For simpler chain-level types (height + difficultyepoch only), see `chain/`.
|
||||
|
||||
mod full;
|
||||
mod height_date_bytes;
|
||||
mod height_date_first;
|
||||
mod height_date_last;
|
||||
mod height_date_max;
|
||||
mod height_date_min;
|
||||
mod last;
|
||||
mod lazy_height_sum_cum;
|
||||
mod sum;
|
||||
mod sum_cum;
|
||||
|
||||
pub use full::*;
|
||||
pub use height_date_bytes::*;
|
||||
pub use height_date_first::*;
|
||||
pub use height_date_last::*;
|
||||
pub use height_date_max::*;
|
||||
pub use height_date_min::*;
|
||||
pub use last::*;
|
||||
pub use lazy_height_sum_cum::*;
|
||||
pub use sum::*;
|
||||
pub use sum_cum::*;
|
||||
@@ -1,11 +0,0 @@
|
||||
mod average;
|
||||
mod first;
|
||||
mod last;
|
||||
mod max;
|
||||
mod min;
|
||||
|
||||
pub use average::*;
|
||||
pub use first::*;
|
||||
pub use last::*;
|
||||
pub use max::*;
|
||||
pub use min::*;
|
||||
@@ -1,7 +0,0 @@
|
||||
mod block;
|
||||
mod date;
|
||||
mod tx;
|
||||
|
||||
pub use block::*;
|
||||
pub use date::*;
|
||||
pub use tx::*;
|
||||
@@ -1,13 +0,0 @@
|
||||
mod distribution;
|
||||
mod first;
|
||||
mod full;
|
||||
mod last;
|
||||
mod sum;
|
||||
mod sum_cum;
|
||||
|
||||
pub use distribution::*;
|
||||
pub use first::*;
|
||||
pub use full::*;
|
||||
pub use last::*;
|
||||
pub use sum::*;
|
||||
pub use sum_cum::*;
|
||||
@@ -1,7 +0,0 @@
|
||||
mod block;
|
||||
mod date;
|
||||
mod tx;
|
||||
|
||||
pub use block::*;
|
||||
pub use date::*;
|
||||
pub use tx::*;
|
||||
@@ -1,5 +0,0 @@
|
||||
mod distribution;
|
||||
mod full;
|
||||
|
||||
pub use distribution::*;
|
||||
pub use full::*;
|
||||
@@ -1,17 +0,0 @@
|
||||
mod binary_height_date_last;
|
||||
mod binary_last;
|
||||
mod binary_sum;
|
||||
mod binary_sum_cum;
|
||||
mod full;
|
||||
mod last;
|
||||
mod sum;
|
||||
mod sum_cum;
|
||||
|
||||
pub use binary_height_date_last::*;
|
||||
pub use binary_last::*;
|
||||
pub use binary_sum::*;
|
||||
pub use binary_sum_cum::*;
|
||||
pub use full::*;
|
||||
pub use last::*;
|
||||
pub use sum::*;
|
||||
pub use sum_cum::*;
|
||||
@@ -1,15 +0,0 @@
|
||||
mod binary_last;
|
||||
mod binary_sum;
|
||||
mod binary_sum_cum;
|
||||
mod full;
|
||||
mod last;
|
||||
mod sum;
|
||||
mod sum_cum;
|
||||
|
||||
pub use binary_last::*;
|
||||
pub use binary_sum::*;
|
||||
pub use binary_sum_cum::*;
|
||||
pub use full::*;
|
||||
pub use last::*;
|
||||
pub use sum::*;
|
||||
pub use sum_cum::*;
|
||||
@@ -1,5 +0,0 @@
|
||||
mod distribution;
|
||||
mod full;
|
||||
|
||||
pub use distribution::*;
|
||||
pub use full::*;
|
||||
@@ -1,10 +0,0 @@
|
||||
mod block;
|
||||
mod date;
|
||||
mod derived_block;
|
||||
mod derived_tx;
|
||||
mod transform;
|
||||
|
||||
pub use block::*;
|
||||
pub use date::*;
|
||||
pub use derived_tx::*;
|
||||
pub use transform::*;
|
||||
@@ -1,21 +1,9 @@
|
||||
mod aggregation;
|
||||
mod compute;
|
||||
mod computed;
|
||||
mod derived;
|
||||
mod group;
|
||||
mod lazy;
|
||||
mod specialized;
|
||||
mod multi;
|
||||
mod single;
|
||||
mod traits;
|
||||
mod transform;
|
||||
mod vec;
|
||||
|
||||
pub(crate) use aggregation::*;
|
||||
pub(crate) use compute::*;
|
||||
pub(crate) use computed::*;
|
||||
pub(crate) use derived::*;
|
||||
pub(crate) use group::*;
|
||||
pub(crate) use lazy::*;
|
||||
pub(crate) use specialized::*;
|
||||
pub(crate) use multi::*;
|
||||
pub(crate) use single::*;
|
||||
pub(crate) use traits::*;
|
||||
pub(crate) use transform::*;
|
||||
pub(crate) use vec::*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! ComputedVecsDate using only average-value aggregation.
|
||||
//! ComputedDateAverage - dateindex storage + lazy periods for average-value aggregation.
|
||||
|
||||
use brk_error::Result;
|
||||
use brk_traversable::Traversable;
|
||||
@@ -13,7 +13,7 @@ use crate::internal::{ComputedVecValue, LazyPeriodsAverage};
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct ComputedVecsDateAverage<T>
|
||||
pub struct ComputedDateAverage<T>
|
||||
where
|
||||
T: ComputedVecValue + PartialOrd + JsonSchema,
|
||||
{
|
||||
@@ -26,7 +26,7 @@ where
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
impl<T> ComputedVecsDateAverage<T>
|
||||
impl<T> ComputedDateAverage<T>
|
||||
where
|
||||
T: ComputedVecValue + JsonSchema + 'static,
|
||||
{
|
||||
@@ -8,12 +8,10 @@ use schemars::JsonSchema;
|
||||
use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedVecValue, LazyPeriodsLast,
|
||||
LazyPeriodsSumCum, NumericValue,
|
||||
ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedVecValue, LazyBinaryTransformLast,
|
||||
LazyPeriodsLast, LazyPeriodsSumCum, NumericValue,
|
||||
};
|
||||
|
||||
use super::super::transform::LazyBinaryTransformLast;
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
@@ -8,12 +8,11 @@ use schemars::JsonSchema;
|
||||
use vecdb::{BinaryTransform, IterableCloneableVec};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast,
|
||||
ComputedDerivedBlockSumCum, LazyPeriodsFull, LazyPeriodsSumCum, NumericValue, SumCum,
|
||||
ComputedBlockLast, ComputedBlockSumCum, ComputedDerivedBlockLast,
|
||||
ComputedDerivedBlockSumCum, ComputedVecValue, LazyBinaryTransformSumCum, LazyPeriodsFull,
|
||||
LazyPeriodsSumCum, NumericValue, SumCum,
|
||||
};
|
||||
|
||||
use super::super::transform::LazyBinaryTransformSumCum;
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
@@ -5,9 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex,
|
||||
use schemars::JsonSchema;
|
||||
use vecdb::{IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{ComputedVecValue, LazyPeriodsFull, Full};
|
||||
|
||||
use super::super::transform::{LazyTransformFull, LazyTransformStats};
|
||||
use crate::internal::{ComputedVecValue, Full, LazyPeriodsFull, LazyTransformFull, LazyTransformStats};
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
@@ -7,9 +7,7 @@ use brk_types::{
|
||||
use schemars::JsonSchema;
|
||||
use vecdb::{IterableBoxedVec, IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{ComputedBlockLast, ComputedDateLast, ComputedVecValue, LazyPeriodsLast, NumericValue};
|
||||
|
||||
use super::super::transform::LazyTransformLast;
|
||||
use crate::internal::{ComputedBlockLast, ComputedDateLast, ComputedVecValue, LazyPeriodsLast, LazyTransformLast, NumericValue};
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
@@ -5,9 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex,
|
||||
use schemars::JsonSchema;
|
||||
use vecdb::{IterableBoxedVec, IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{ComputedVecValue, LazyPeriodsSum};
|
||||
|
||||
use super::super::transform::LazyTransformSum;
|
||||
use crate::internal::{ComputedVecValue, LazyPeriodsSum, LazyTransformSum};
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
@@ -5,9 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex,
|
||||
use schemars::JsonSchema;
|
||||
use vecdb::{IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{ComputedVecValue, LazyPeriodsSumCum, SumCum};
|
||||
|
||||
use super::super::transform::LazyTransformSumCum;
|
||||
use crate::internal::{ComputedVecValue, LazyPeriodsSumCum, LazyTransformSumCum, SumCum};
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
25
crates/brk_computer/src/internal/multi/date/mod.rs
Normal file
25
crates/brk_computer/src/internal/multi/date/mod.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
mod average;
|
||||
mod binary_last;
|
||||
mod binary_sum;
|
||||
mod binary_sum_cum;
|
||||
mod first;
|
||||
mod last;
|
||||
mod lazy_full;
|
||||
mod lazy_last;
|
||||
mod lazy_sum;
|
||||
mod lazy_sum_cum;
|
||||
mod max;
|
||||
mod min;
|
||||
|
||||
pub use average::*;
|
||||
pub use binary_last::*;
|
||||
pub use binary_sum::*;
|
||||
pub use binary_sum_cum::*;
|
||||
pub use first::*;
|
||||
pub use last::*;
|
||||
pub use lazy_full::*;
|
||||
pub use lazy_last::*;
|
||||
pub use lazy_sum::*;
|
||||
pub use lazy_sum_cum::*;
|
||||
pub use max::*;
|
||||
pub use min::*;
|
||||
@@ -3,6 +3,7 @@ mod distribution;
|
||||
mod first;
|
||||
mod full;
|
||||
mod last;
|
||||
mod lazy;
|
||||
mod max;
|
||||
mod min;
|
||||
mod sum;
|
||||
@@ -13,6 +14,7 @@ pub use distribution::*;
|
||||
pub use first::*;
|
||||
pub use full::*;
|
||||
pub use last::*;
|
||||
pub use lazy::*;
|
||||
pub use max::*;
|
||||
pub use min::*;
|
||||
pub use sum::*;
|
||||
@@ -7,13 +7,11 @@ use schemars::JsonSchema;
|
||||
use vecdb::{BinaryTransform, IterableCloneableVec};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast,
|
||||
ComputedDerivedBlockSumCum, LazyPeriodsFull, LazyPeriodsSumCum, LazyBinaryDateSumCum, LazyFull,
|
||||
LazySumCum, NumericValue, SumCum,
|
||||
ComputedBlockLast, ComputedBlockSumCum, ComputedDerivedBlockLast, ComputedDerivedBlockSumCum,
|
||||
ComputedVecValue, LazyBinaryDateSumCum, LazyBinaryTransformSumCum, LazyFull, LazyPeriodsFull,
|
||||
LazyPeriodsSumCum, LazySumCum, NumericValue, SumCum,
|
||||
};
|
||||
|
||||
use super::super::transform::LazyBinaryTransformSumCum;
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
@@ -7,11 +7,10 @@ use schemars::JsonSchema;
|
||||
use vecdb::{IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedVecValue, ComputedDerivedBlockFull, LazyPeriodsFull, Full, LazyDateFull, NumericValue,
|
||||
ComputedDerivedBlockFull, ComputedVecValue, Full, LazyDateFull, LazyPeriodsFull,
|
||||
LazyTransformStats, NumericValue,
|
||||
};
|
||||
|
||||
use super::super::transform::LazyTransformStats;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyDerivedBlockFull<T, S1T = T>
|
||||
@@ -7,12 +7,10 @@ use schemars::JsonSchema;
|
||||
use vecdb::{IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, ComputedDerivedBlockLast,
|
||||
LazyDateLast, NumericValue,
|
||||
ComputedBlockLast, ComputedDerivedBlockLast, ComputedHeightDateLast, ComputedVecValue,
|
||||
LazyDateLast, LazyTransformLast, NumericValue,
|
||||
};
|
||||
|
||||
use super::super::transform::LazyTransformLast;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyDerivedBlockLast<T, S1T = T>
|
||||
@@ -7,11 +7,10 @@ use schemars::JsonSchema;
|
||||
use vecdb::{IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedVecValue, ComputedDerivedBlockSum, LazyPeriodsSum, LazyDateSum, LazySum, NumericValue, SumVec,
|
||||
ComputedDerivedBlockSum, ComputedVecValue, LazyDateSum, LazyPeriodsSum, LazySum,
|
||||
LazyTransformSum, NumericValue, SumVec,
|
||||
};
|
||||
|
||||
use super::super::transform::LazyTransformSum;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyDerivedBlockSum<T, S1T = T>
|
||||
@@ -7,12 +7,10 @@ use schemars::JsonSchema;
|
||||
use vecdb::{IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedVecValue, ComputedDerivedBlockSumCum, LazyPeriodsSumCum, LazyDateSumCum, LazySumCum,
|
||||
NumericValue, SumCum,
|
||||
ComputedDerivedBlockSumCum, ComputedVecValue, LazyDateSumCum, LazyPeriodsSumCum, LazySumCum,
|
||||
LazyTransformSumCum, NumericValue, SumCum,
|
||||
};
|
||||
|
||||
use super::super::transform::LazyTransformSumCum;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyDerivedBlockSumCum<T, S1T = T>
|
||||
@@ -1,21 +1,27 @@
|
||||
mod binary_full;
|
||||
mod binary_last;
|
||||
mod binary_sum;
|
||||
mod binary_sum_cum;
|
||||
mod distribution;
|
||||
mod first;
|
||||
mod full;
|
||||
mod last;
|
||||
mod lazy_height_full;
|
||||
mod lazy_full;
|
||||
mod lazy_last;
|
||||
mod lazy_sum;
|
||||
mod lazy_sum_cum;
|
||||
mod sum;
|
||||
mod sum_cum;
|
||||
|
||||
pub use binary_full::*;
|
||||
pub use binary_last::*;
|
||||
pub use binary_sum::*;
|
||||
pub use binary_sum_cum::*;
|
||||
pub use distribution::*;
|
||||
pub use first::*;
|
||||
pub use full::*;
|
||||
pub use last::*;
|
||||
pub use lazy_height_full::*;
|
||||
pub use lazy_full::*;
|
||||
pub use lazy_last::*;
|
||||
pub use lazy_sum::*;
|
||||
pub use lazy_sum_cum::*;
|
||||
pub use sum::*;
|
||||
pub use sum_cum::*;
|
||||
@@ -8,9 +8,7 @@ use brk_types::{
|
||||
use schemars::JsonSchema;
|
||||
use vecdb::{IterableCloneableVec, UnaryTransform};
|
||||
|
||||
use crate::internal::{ComputedVecValue, DerivedTxFull};
|
||||
|
||||
use super::super::transform::{LazyTransformFull, LazyTransformStats};
|
||||
use crate::internal::{ComputedVecValue, DerivedTxFull, LazyTransformFull, LazyTransformStats};
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
#[traversable(merge)]
|
||||
9
crates/brk_computer/src/internal/multi/derived_tx/mod.rs
Normal file
9
crates/brk_computer/src/internal/multi/derived_tx/mod.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
mod distribution;
|
||||
mod full;
|
||||
mod lazy_distribution;
|
||||
mod lazy_full;
|
||||
|
||||
pub use distribution::*;
|
||||
pub use full::*;
|
||||
pub use lazy_distribution::*;
|
||||
pub use lazy_full::*;
|
||||
@@ -6,13 +6,13 @@ use derive_more::{Deref, DerefMut};
|
||||
use schemars::JsonSchema;
|
||||
use vecdb::{BinaryTransform, IterableBoxedVec, LazyVecFrom2};
|
||||
|
||||
use crate::internal::{ComputedBlockFull, ComputedVecValue, DerivedTxFull, NumericValue};
|
||||
|
||||
use super::super::derived_block::LazyBinaryDerivedBlockSumCum;
|
||||
use crate::internal::{
|
||||
ComputedBlockFull, ComputedVecValue, DerivedTxFull, LazyBinaryDerivedBlockSumCum, NumericValue,
|
||||
};
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct BinaryBlockFull<T, S1T = T, S2T = T>
|
||||
pub struct LazyBinaryBlockFull<T, S1T = T, S2T = T>
|
||||
where
|
||||
T: ComputedVecValue + PartialOrd + JsonSchema,
|
||||
S1T: ComputedVecValue,
|
||||
@@ -27,7 +27,7 @@ where
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
impl<T, S1T, S2T> BinaryBlockFull<T, S1T, S2T>
|
||||
impl<T, S1T, S2T> LazyBinaryBlockFull<T, S1T, S2T>
|
||||
where
|
||||
T: ComputedVecValue + JsonSchema + 'static,
|
||||
S1T: NumericValue + JsonSchema,
|
||||
@@ -1,4 +1,4 @@
|
||||
//! BinaryHeightDateLast - height storage + binary transform lazy date periods.
|
||||
//! LazyBinaryHeightDateLast - height storage + binary transform lazy date periods.
|
||||
//!
|
||||
//! Use this when height is stored as EagerVec and date periods are lazy binary transforms.
|
||||
|
||||
@@ -16,7 +16,7 @@ const VERSION: Version = Version::ZERO;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct BinaryHeightDateLast<T, S1T, S2T>
|
||||
pub struct LazyBinaryHeightDateLast<T, S1T, S2T>
|
||||
where
|
||||
T: ComputedVecValue + PartialOrd + JsonSchema,
|
||||
S1T: ComputedVecValue,
|
||||
@@ -29,7 +29,7 @@ where
|
||||
pub rest: LazyBinaryDateLast<T, S1T, S2T>,
|
||||
}
|
||||
|
||||
impl<T, S1T, S2T> BinaryHeightDateLast<T, S1T, S2T>
|
||||
impl<T, S1T, S2T> LazyBinaryHeightDateLast<T, S1T, S2T>
|
||||
where
|
||||
T: ComputedVecValue + JsonSchema + 'static,
|
||||
S1T: ComputedVecValue + JsonSchema,
|
||||
@@ -8,11 +8,10 @@ use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockLast, ComputedBlockSumCum, ComputedHeightDateLast, ComputedVecValue,
|
||||
LazyPeriodsLast, LazyBinaryDateLast, LazyBinaryTransformLast, NumericValue,
|
||||
LazyBinaryDateLast, LazyBinaryDerivedBlockLast, LazyBinaryTransformLast, LazyPeriodsLast,
|
||||
NumericValue,
|
||||
};
|
||||
|
||||
use super::super::derived_block::LazyBinaryDerivedBlockLast;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyBinaryBlockLast<T, S1T = T, S2T = T>
|
||||
@@ -252,7 +251,7 @@ where
|
||||
|
||||
/// Create from separate height, difficultyepoch, and date sources.
|
||||
///
|
||||
/// Use when sources are split across different types (e.g., ValueBlockDateLast + ComputedBlockLast).
|
||||
/// Use when sources are split across different types (e.g., ValueHeightDateLast + ComputedBlockLast).
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn from_height_difficultyepoch_dates<F: BinaryTransform<S1T, S2T, T>>(
|
||||
name: &str,
|
||||
@@ -6,15 +6,16 @@ use derive_more::{Deref, DerefMut};
|
||||
use schemars::JsonSchema;
|
||||
use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2};
|
||||
|
||||
use crate::internal::{ComputedBlockSum, ComputedVecValue, ComputedDerivedBlockSum, NumericValue};
|
||||
|
||||
use super::super::derived_block::LazyBinaryDerivedBlockSum;
|
||||
use crate::internal::{
|
||||
ComputedBlockSum, ComputedDerivedBlockSum, ComputedVecValue, LazyBinaryDerivedBlockSum,
|
||||
NumericValue,
|
||||
};
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct BinaryBlockSum<T, S1T, S2T>
|
||||
pub struct LazyBinaryBlockSum<T, S1T, S2T>
|
||||
where
|
||||
T: ComputedVecValue + PartialOrd + JsonSchema,
|
||||
S1T: ComputedVecValue,
|
||||
@@ -27,7 +28,7 @@ where
|
||||
pub rest: LazyBinaryDerivedBlockSum<T, S1T, S2T>,
|
||||
}
|
||||
|
||||
impl<T, S1T, S2T> BinaryBlockSum<T, S1T, S2T>
|
||||
impl<T, S1T, S2T> LazyBinaryBlockSum<T, S1T, S2T>
|
||||
where
|
||||
T: ComputedVecValue + JsonSchema + 'static,
|
||||
S1T: NumericValue + JsonSchema,
|
||||
@@ -7,15 +7,13 @@ use schemars::JsonSchema;
|
||||
use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast,
|
||||
ComputedDerivedBlockSumCum, NumericValue,
|
||||
ComputedBlockLast, ComputedBlockSumCum, ComputedDerivedBlockLast, ComputedDerivedBlockSumCum,
|
||||
ComputedVecValue, LazyBinaryDerivedBlockSumCum, NumericValue,
|
||||
};
|
||||
|
||||
use super::super::derived_block::LazyBinaryDerivedBlockSumCum;
|
||||
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct BinaryBlockSumCum<T, S1T = T, S2T = T>
|
||||
pub struct LazyBinaryBlockSumCum<T, S1T = T, S2T = T>
|
||||
where
|
||||
T: ComputedVecValue + PartialOrd + JsonSchema,
|
||||
S1T: ComputedVecValue,
|
||||
@@ -32,7 +30,7 @@ where
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
impl<T, S1T, S2T> BinaryBlockSumCum<T, S1T, S2T>
|
||||
impl<T, S1T, S2T> LazyBinaryBlockSumCum<T, S1T, S2T>
|
||||
where
|
||||
T: ComputedVecValue + JsonSchema + 'static,
|
||||
S1T: ComputedVecValue + JsonSchema,
|
||||
@@ -1,4 +1,4 @@
|
||||
//! HeightDateBytes - height + dateindex BytesVec storage.
|
||||
//! ComputedHeightDateBytes - height + dateindex BytesVec storage.
|
||||
//!
|
||||
//! Use this for simple cases where both height and dateindex are stored BytesVecs
|
||||
//! without any lazy derivations. For OHLC-type data.
|
||||
@@ -12,7 +12,7 @@ use vecdb::{BytesVec, BytesVecValue, Database, Formattable, ImportableVec};
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct HeightDateBytes<T>
|
||||
pub struct ComputedHeightDateBytes<T>
|
||||
where
|
||||
T: BytesVecValue + Formattable + Serialize + JsonSchema,
|
||||
{
|
||||
@@ -22,7 +22,7 @@ where
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
impl<T> HeightDateBytes<T>
|
||||
impl<T> ComputedHeightDateBytes<T>
|
||||
where
|
||||
T: BytesVecValue + Formattable + Serialize + JsonSchema + 'static,
|
||||
{
|
||||
@@ -7,10 +7,9 @@ use schemars::JsonSchema;
|
||||
use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockFull, ComputedVecValue, ComputedDerivedBlockFull, NumericValue,
|
||||
ComputedBlockFull, ComputedDerivedBlockFull, ComputedVecValue, LazyDerivedBlockFull,
|
||||
NumericValue,
|
||||
};
|
||||
|
||||
use super::super::derived_block::LazyDerivedBlockFull;
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyBlockFull<T, S1T = T>
|
||||
@@ -1,4 +1,4 @@
|
||||
//! BlockFullLazyHeight - block full with lazy height transform.
|
||||
//! LazyBlockFullHeight - block full with lazy height transform.
|
||||
|
||||
use brk_error::Result;
|
||||
use brk_traversable::Traversable;
|
||||
@@ -17,7 +17,7 @@ const VERSION: Version = Version::ZERO;
|
||||
/// Block full aggregation with lazy height transform + computed derived indexes.
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct BlockFullLazyHeight<T, S = T>
|
||||
pub struct LazyBlockFullHeight<T, S = T>
|
||||
where
|
||||
T: ComputedVecValue + PartialOrd + JsonSchema,
|
||||
S: ComputedVecValue,
|
||||
@@ -29,7 +29,7 @@ where
|
||||
pub rest: ComputedDerivedBlockFull<T>,
|
||||
}
|
||||
|
||||
impl<T, S> BlockFullLazyHeight<T, S>
|
||||
impl<T, S> LazyBlockFullHeight<T, S>
|
||||
where
|
||||
T: NumericValue + JsonSchema,
|
||||
S: ComputedVecValue + JsonSchema,
|
||||
@@ -1,4 +1,4 @@
|
||||
//! BlockSumCumLazyHeight - block sum+cumulative with lazy height transform.
|
||||
//! LazyBlockSumCumHeight - block sum+cumulative with lazy height transform.
|
||||
//!
|
||||
//! Use this when you need:
|
||||
//! - Lazy height (binary transform from two sources)
|
||||
@@ -23,7 +23,7 @@ use crate::internal::{ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue
|
||||
/// Coarser periods are lazy lookups.
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct BlockSumCumLazyHeight<T, S1T = T, S2T = T>
|
||||
pub struct LazyBlockSumCumHeight<T, S1T = T, S2T = T>
|
||||
where
|
||||
T: ComputedVecValue + PartialOrd + JsonSchema,
|
||||
S1T: ComputedVecValue,
|
||||
@@ -38,7 +38,7 @@ where
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
impl<T, S1T, S2T> BlockSumCumLazyHeight<T, S1T, S2T>
|
||||
impl<T, S1T, S2T> LazyBlockSumCumHeight<T, S1T, S2T>
|
||||
where
|
||||
T: NumericValue + JsonSchema,
|
||||
S1T: ComputedVecValue + JsonSchema,
|
||||
@@ -7,11 +7,9 @@ use schemars::JsonSchema;
|
||||
use vecdb::{IterableBoxedVec, IterableCloneableVec, LazyVecFrom1, UnaryTransform};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, ComputedDerivedBlockLast,
|
||||
NumericValue,
|
||||
ComputedBlockLast, ComputedDerivedBlockLast, ComputedHeightDateLast, ComputedVecValue,
|
||||
LazyDerivedBlockLast, NumericValue,
|
||||
};
|
||||
|
||||
use super::super::derived_block::LazyDerivedBlockLast;
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyBlockLast<T, S1T = T>
|
||||
@@ -6,9 +6,9 @@ use derive_more::{Deref, DerefMut};
|
||||
use schemars::JsonSchema;
|
||||
use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform};
|
||||
|
||||
use crate::internal::{ComputedBlockSum, ComputedVecValue, ComputedDerivedBlockSum, NumericValue};
|
||||
|
||||
use super::super::derived_block::LazyDerivedBlockSum;
|
||||
use crate::internal::{
|
||||
ComputedBlockSum, ComputedDerivedBlockSum, ComputedVecValue, LazyDerivedBlockSum, NumericValue,
|
||||
};
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyBlockSum<T, S1T = T>
|
||||
@@ -7,10 +7,9 @@ use schemars::JsonSchema;
|
||||
use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue,
|
||||
ComputedBlockSumCum, ComputedDerivedBlockSumCum, ComputedVecValue, LazyDerivedBlockSumCum,
|
||||
NumericValue,
|
||||
};
|
||||
|
||||
use super::super::derived_block::LazyDerivedBlockSumCum;
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct LazyBlockSumCum<T, S1T = T>
|
||||
43
crates/brk_computer/src/internal/multi/height/mod.rs
Normal file
43
crates/brk_computer/src/internal/multi/height/mod.rs
Normal file
@@ -0,0 +1,43 @@
|
||||
mod binary_full;
|
||||
mod binary_height_date_last;
|
||||
mod binary_last;
|
||||
mod binary_sum;
|
||||
mod binary_sum_cum;
|
||||
mod full;
|
||||
mod height_date_bytes;
|
||||
mod height_date_first;
|
||||
mod height_date_last;
|
||||
mod height_date_max;
|
||||
mod height_date_min;
|
||||
mod last;
|
||||
mod lazy_distribution;
|
||||
mod lazy_full;
|
||||
mod lazy_height_full;
|
||||
mod lazy_height_sum_cum;
|
||||
mod lazy_last;
|
||||
mod lazy_sum;
|
||||
mod lazy_sum_cum;
|
||||
mod sum;
|
||||
mod sum_cum;
|
||||
|
||||
pub use binary_full::*;
|
||||
pub use binary_height_date_last::*;
|
||||
pub use binary_last::*;
|
||||
pub use binary_sum::*;
|
||||
pub use binary_sum_cum::*;
|
||||
pub use full::*;
|
||||
pub use height_date_bytes::*;
|
||||
pub use height_date_first::*;
|
||||
pub use height_date_last::*;
|
||||
pub use height_date_max::*;
|
||||
pub use height_date_min::*;
|
||||
pub use last::*;
|
||||
pub use lazy_distribution::*;
|
||||
pub use lazy_full::*;
|
||||
pub use lazy_height_full::*;
|
||||
pub use lazy_height_sum_cum::*;
|
||||
pub use lazy_last::*;
|
||||
pub use lazy_sum::*;
|
||||
pub use lazy_sum_cum::*;
|
||||
pub use sum::*;
|
||||
pub use sum_cum::*;
|
||||
17
crates/brk_computer/src/internal/multi/mod.rs
Normal file
17
crates/brk_computer/src/internal/multi/mod.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
//! Multi-index composite types.
|
||||
|
||||
mod date;
|
||||
mod derived_date;
|
||||
mod derived_height;
|
||||
mod derived_tx;
|
||||
mod height;
|
||||
mod specialized;
|
||||
mod value;
|
||||
|
||||
pub use date::*;
|
||||
pub use derived_date::*;
|
||||
pub use derived_height::*;
|
||||
pub use derived_tx::*;
|
||||
pub use height::*;
|
||||
pub use specialized::*;
|
||||
pub use value::*;
|
||||
@@ -1,15 +1,11 @@
|
||||
mod constant;
|
||||
mod lazy_period;
|
||||
mod ohlc;
|
||||
mod percentiles;
|
||||
mod ratio;
|
||||
mod stddev;
|
||||
mod value;
|
||||
|
||||
pub use constant::*;
|
||||
pub use lazy_period::*;
|
||||
pub use ohlc::*;
|
||||
pub use percentiles::*;
|
||||
pub use ratio::*;
|
||||
pub use stddev::*;
|
||||
pub use value::*;
|
||||
@@ -22,7 +22,7 @@ where
|
||||
|
||||
/// Lazy OHLC component extractors for height + dateindex.
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct HeightDateLazyOHLC<T, SourceT>
|
||||
pub struct LazyHeightDateOHLC<T, SourceT>
|
||||
where
|
||||
T: BytesVecValue + Formattable + Serialize + JsonSchema + 'static,
|
||||
SourceT: BytesVecValue + Formattable + Serialize + JsonSchema + 'static,
|
||||
@@ -1,5 +1,3 @@
|
||||
//! OHLC - Open/High/Low/Close specialized types.
|
||||
|
||||
mod computed;
|
||||
mod lazy;
|
||||
mod period;
|
||||
@@ -10,7 +10,7 @@ use vecdb::{
|
||||
|
||||
use crate::{ComputeIndexes, indexes, price};
|
||||
|
||||
use super::super::{ClosePriceTimesRatio, ComputedDateLast, LazyBinaryDateLast};
|
||||
use crate::internal::{ClosePriceTimesRatio, ComputedDateLast, LazyBinaryDateLast};
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct ComputedStandardDeviationVecsDate {
|
||||
@@ -11,14 +11,14 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
|
||||
|
||||
use crate::{ComputeIndexes, indexes, price};
|
||||
|
||||
use super::super::block::{LazyDerivedBlockValue, LazyValueDifficultyEpochFromHeight};
|
||||
use crate::internal::{LazyDerivedBlockValue, LazyValueDifficultyEpochFromHeight};
|
||||
use super::ValueDateLast;
|
||||
|
||||
/// Value type where both height and dateindex are stored independently.
|
||||
/// Dateindex values cannot be derived from height (e.g., unrealized P&L).
|
||||
#[derive(Clone, Deref, DerefMut, Traversable)]
|
||||
#[traversable(merge)]
|
||||
pub struct ValueBlockDateLast {
|
||||
pub struct ValueHeightDateLast {
|
||||
#[traversable(rename = "sats")]
|
||||
pub height: EagerVec<PcoVec<Height, Sats>>,
|
||||
#[traversable(flatten)]
|
||||
@@ -33,7 +33,7 @@ pub struct ValueBlockDateLast {
|
||||
|
||||
const VERSION: Version = Version::ZERO;
|
||||
|
||||
impl ValueBlockDateLast {
|
||||
impl ValueHeightDateLast {
|
||||
pub fn forced_import(
|
||||
db: &Database,
|
||||
name: &str,
|
||||
@@ -1,9 +1,9 @@
|
||||
mod block_date_last;
|
||||
mod derived_last;
|
||||
mod height_date_last;
|
||||
mod last;
|
||||
mod lazy_last;
|
||||
|
||||
pub use block_date_last::*;
|
||||
pub use height_date_last::*;
|
||||
pub use derived_last::*;
|
||||
pub use last::*;
|
||||
pub use lazy_last::*;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user