Trait PortfolioCacheApi
Source pub trait PortfolioCacheApi: Send + Sync {
// Required methods
fn compute_wallet_margin_snapshot<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<WalletMarginSnapshot>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_portfolio<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Portfolio>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_portfolio_fail_closed_pm<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Portfolio>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn compute_pm_risk_grid_data<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<PmRiskGridData>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn open_position_count<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn has_live_position_symbol<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
symbol: &'life2 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_all_portfolios<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HashMap<WalletAddress, PortfolioSummary>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe<'life0, 'async_trait>(
&'life0 self,
wallet: WalletAddress,
) -> Pin<Box<dyn Future<Output = (u64, UnboundedReceiver<PortfolioUpdate>)> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
subscriber_id: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_engine_message<'life0, 'async_trait>(
&'life0 self,
message: EngineMessage,
sequence: i64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn handle_hypercore_position_update<'life0, 'async_trait>(
&'life0 self,
update: HypercorePositionUpdate,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn publish_margin_update<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}