pub trait PositionManager: Send + Sync {
// Required methods
fn update_position<'life0, 'async_trait>(
&'life0 self,
update: PositionUpdate,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_position<'life0, 'life1, 'async_trait>(
&'life0 self,
position_id: &'life1 PositionId,
) -> Pin<Box<dyn Future<Output = Option<FuturesPosition>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_positions_by_symbol<'life0, 'life1, 'async_trait>(
&'life0 self,
venue: Venue,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_all_positions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_total_unrealized_pnl<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Decimal> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_total_realized_pnl<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Decimal> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear_all_positions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for position management
Required Methods§
Sourcefn update_position<'life0, 'async_trait>(
&'life0 self,
update: PositionUpdate,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_position<'life0, 'async_trait>(
&'life0 self,
update: PositionUpdate,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update or create a position from exchange update
Sourcefn get_position<'life0, 'life1, 'async_trait>(
&'life0 self,
position_id: &'life1 PositionId,
) -> Pin<Box<dyn Future<Output = Option<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_position<'life0, 'life1, 'async_trait>(
&'life0 self,
position_id: &'life1 PositionId,
) -> Pin<Box<dyn Future<Output = Option<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get position by ID
Sourcefn get_positions_by_symbol<'life0, 'life1, 'async_trait>(
&'life0 self,
venue: Venue,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_positions_by_symbol<'life0, 'life1, 'async_trait>(
&'life0 self,
venue: Venue,
symbol: &'life1 str,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all positions for a symbol on a venue
Sourcefn get_all_positions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_positions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<FuturesPosition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all open positions
Sourcefn get_total_unrealized_pnl<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Decimal> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_unrealized_pnl<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Decimal> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get total unrealized PnL across all positions