Skip to main content

AnalyticsWriter

Trait AnalyticsWriter 

Source
pub trait AnalyticsWriter: AnalyticsReader {
    // Required methods
    fn upsert_historical_pnl_batch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        interval_ms: i64,
        timestamp_ms: i64,
        snapshots: &'life1 [(WalletAddress, Decimal, Option<Vec<u8>>)],
        max_periods: i64,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn upsert_historical_theo_batch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        interval_ms: i64,
        timestamp_ms: i64,
        snapshots: &'life1 [(String, Decimal)],
        max_periods: i64,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn upsert_vol_surface_snapshot<'life0, 'life1, 'async_trait>(
        &'life0 self,
        interval_ms: i64,
        timestamp_ms: i64,
        underlying: &'life1 str,
        surface_json: Value,
        max_periods: i64,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn upsert_bbo_snapshots<'life0, 'life1, 'async_trait>(
        &'life0 self,
        snapshot_ts: i64,
        snapshots: &'life1 [NewBboSnapshotInput],
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_bbo_snapshots_older_than<'life0, 'async_trait>(
        &'life0 self,
        cutoff_ts: i64,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn mark_settlement_payouts_seen<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        wallet: &'life1 WalletAddress,
        payout_ids: &'life2 [i64],
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Write operations for analytics tables (snapshots, BBO, etc.).

Required Methods§

Source

fn upsert_historical_pnl_batch<'life0, 'life1, 'async_trait>( &'life0 self, interval_ms: i64, timestamp_ms: i64, snapshots: &'life1 [(WalletAddress, Decimal, Option<Vec<u8>>)], max_periods: i64, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upsert PnL snapshots for a batch of wallets, pruning beyond max_periods.

Source

fn upsert_historical_theo_batch<'life0, 'life1, 'async_trait>( &'life0 self, interval_ms: i64, timestamp_ms: i64, snapshots: &'life1 [(String, Decimal)], max_periods: i64, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upsert theo price snapshots for a batch of symbols, pruning beyond max_periods.

Source

fn upsert_vol_surface_snapshot<'life0, 'life1, 'async_trait>( &'life0 self, interval_ms: i64, timestamp_ms: i64, underlying: &'life1 str, surface_json: Value, max_periods: i64, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upsert a vol surface JSON snapshot, pruning beyond max_periods.

Source

fn upsert_bbo_snapshots<'life0, 'life1, 'async_trait>( &'life0 self, snapshot_ts: i64, snapshots: &'life1 [NewBboSnapshotInput], ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upsert BBO snapshots for multiple symbols at a given timestamp.

Source

fn delete_bbo_snapshots_older_than<'life0, 'async_trait>( &'life0 self, cutoff_ts: i64, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete BBO snapshots older than cutoff_ts. Returns count deleted.

Source

fn mark_settlement_payouts_seen<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, wallet: &'life1 WalletAddress, payout_ids: &'life2 [i64], ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Mark settlement payout IDs as “seen” for a wallet (idempotent).

Implementors§