pub trait CompetitionReader: Send + Sync {
Show 16 methods
// Required methods
fn list_competitions<'life0, 'life1, 'async_trait>(
&'life0 self,
state_filter: Option<&'life1 str>,
from_ts_ms: Option<i64>,
to_ts_ms: Option<i64>,
now_ts_ms: i64,
limit: i64,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_competition_by_id<'life0, 'async_trait>(
&'life0 self,
competition_id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_active_competition<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_latest_completed_competition<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_competitions_to_finalize<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_finalized_stats<'life0, 'async_trait>(
&'life0 self,
competition_id: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionFinalStatsRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_competition_fills_before<'life0, 'async_trait>(
&'life0 self,
cutoff_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionFillRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_historical_theo_marks<'life0, 'life1, 'async_trait>(
&'life0 self,
symbols: &'life1 [String],
cutoff_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<TheoMarkRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_display_usernames_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet_strings: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<WalletUsernameRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_display_username<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_profile_image_url<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn compute_ledger_profile_stats<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<WalletLedgerStats>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_account_first_seen_ts_ms<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_realized_pnl_by_symbol<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
window_start: Option<i64>,
window_end: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SymbolPnlRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_profile_trade_history<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
window_start: Option<i64>,
window_end: Option<i64>,
from_ts_ms: Option<i64>,
to_ts_ms: Option<i64>,
symbol: Option<&'life2 str>,
limit: i64,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProfileFillRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_platform_wallet_metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PlatformWalletMetrics>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Read-only competition queries.
Required Methods§
Sourcefn list_competitions<'life0, 'life1, 'async_trait>(
&'life0 self,
state_filter: Option<&'life1 str>,
from_ts_ms: Option<i64>,
to_ts_ms: Option<i64>,
now_ts_ms: i64,
limit: i64,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_competitions<'life0, 'life1, 'async_trait>(
&'life0 self,
state_filter: Option<&'life1 str>,
from_ts_ms: Option<i64>,
to_ts_ms: Option<i64>,
now_ts_ms: i64,
limit: i64,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List competitions with optional state/time filters and pagination.
Sourcefn get_competition_by_id<'life0, 'async_trait>(
&'life0 self,
competition_id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_competition_by_id<'life0, 'async_trait>(
&'life0 self,
competition_id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a single competition by ID.
Sourcefn get_active_competition<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_active_competition<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the currently active competition (start <= now < end).
Sourcefn get_latest_completed_competition<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_latest_completed_competition<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the most recently completed competition (end <= now).
Sourcefn get_competitions_to_finalize<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_competitions_to_finalize<'life0, 'async_trait>(
&'life0 self,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get competitions that have ended but not yet been finalized.
Sourcefn get_finalized_stats<'life0, 'async_trait>(
&'life0 self,
competition_id: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionFinalStatsRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_finalized_stats<'life0, 'async_trait>(
&'life0 self,
competition_id: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionFinalStatsRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get finalized leaderboard stats for a competition.
Sourcefn get_competition_fills_before<'life0, 'async_trait>(
&'life0 self,
cutoff_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionFillRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_competition_fills_before<'life0, 'async_trait>(
&'life0 self,
cutoff_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompetitionFillRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all competition fill events up to a cutoff timestamp, excluding market maker wallets, ordered by timestamp ascending.
Sourcefn get_historical_theo_marks<'life0, 'life1, 'async_trait>(
&'life0 self,
symbols: &'life1 [String],
cutoff_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<TheoMarkRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_historical_theo_marks<'life0, 'life1, 'async_trait>(
&'life0 self,
symbols: &'life1 [String],
cutoff_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<TheoMarkRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get historical theoretical marks for symbols at or before a timestamp.
Sourcefn get_display_usernames_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet_strings: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<WalletUsernameRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_display_usernames_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet_strings: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<WalletUsernameRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get display usernames for a batch of wallets.
Sourcefn get_display_username<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_display_username<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the approved username for a single wallet.
Sourcefn get_profile_image_url<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_profile_image_url<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get profile image URL for a wallet.
Sourcefn compute_ledger_profile_stats<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<WalletLedgerStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compute_ledger_profile_stats<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
now_ts_ms: i64,
) -> Pin<Box<dyn Future<Output = Result<WalletLedgerStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compute ledger stats (deposits, withdrawals, realized PnL, 24h PnL) for a wallet.
Sourcefn get_account_first_seen_ts_ms<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_account_first_seen_ts_ms<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the first seen timestamp for a wallet from ledger events.
Sourcefn get_realized_pnl_by_symbol<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
window_start: Option<i64>,
window_end: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SymbolPnlRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_realized_pnl_by_symbol<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
window_start: Option<i64>,
window_end: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SymbolPnlRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get per-symbol realized PnL for a wallet within an optional time window.
Sourcefn get_profile_trade_history<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
window_start: Option<i64>,
window_end: Option<i64>,
from_ts_ms: Option<i64>,
to_ts_ms: Option<i64>,
symbol: Option<&'life2 str>,
limit: i64,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProfileFillRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_profile_trade_history<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
window_start: Option<i64>,
window_end: Option<i64>,
from_ts_ms: Option<i64>,
to_ts_ms: Option<i64>,
symbol: Option<&'life2 str>,
limit: i64,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProfileFillRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get profile trade history with optional competition window and filters.
Sourcefn get_platform_wallet_metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PlatformWalletMetrics>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_platform_wallet_metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PlatformWalletMetrics>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get platform-wide realized PnL and volume per wallet (for medal computation).