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§
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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,
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).