This commit is contained in:
2026-04-29 17:18:35 +02:00
parent f8a2309173
commit 0b36caf77d
17 changed files with 1593 additions and 11 deletions

View File

@@ -0,0 +1,36 @@
// file: kb_lib/src/db/entities/pair_metric.rs
//! Pair-metric entity.
/// Persisted pair-metric row.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, sqlx::FromRow)]
pub struct KbPairMetricEntity {
/// Numeric primary key.
pub id: i64,
/// Related pair id.
pub pair_id: i64,
/// Optional first observed slot.
pub first_slot: std::option::Option<i64>,
/// Optional last observed slot.
pub last_slot: std::option::Option<i64>,
/// Optional first observed signature.
pub first_signature: std::option::Option<std::string::String>,
/// Optional last observed signature.
pub last_signature: std::option::Option<std::string::String>,
/// Total trade count.
pub trade_count: i64,
/// Total buy count.
pub buy_count: i64,
/// Total sell count.
pub sell_count: i64,
/// Optional cumulative raw base volume.
pub cumulative_base_amount_raw: std::option::Option<std::string::String>,
/// Optional cumulative raw quote volume.
pub cumulative_quote_amount_raw: std::option::Option<std::string::String>,
/// Optional last derived quote-per-base price.
pub last_price_quote_per_base: std::option::Option<f64>,
/// Creation timestamp encoded as RFC3339 UTC text.
pub created_at: std::string::String,
/// Update timestamp encoded as RFC3339 UTC text.
pub updated_at: std::string::String,
}