Trait penumbra_dex::component::PositionRead

source ·
pub trait PositionRead: StateRead {
    // Provided methods
    fn all_positions(
        &self
    ) -> Pin<Box<dyn Stream<Item = Result<Position>> + Send + 'static>> { ... }
    fn positions_by_price(
        &self,
        pair: &DirectedTradingPair
    ) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send + 'static>> { ... }
    fn position_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 Id
    ) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn check_position_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 Id
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn best_position<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pair: &'life1 DirectedTradingPair
    ) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn pending_position_closures(&self) -> Vector<Id> { ... }
    fn candidate_set(
        &self,
        from: Id,
        fixed_candidates: Arc<Vec<Id>>
    ) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send>> { ... }
    fn ordered_routable_assets(
        &self,
        start: &Id
    ) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send + 'static>> { ... }
    fn recently_accessed_assets(&self) -> OrdSet<Id> { ... }
}
Available on crate feature component only.

Provided Methods§

source

fn all_positions( &self ) -> Pin<Box<dyn Stream<Item = Result<Position>> + Send + 'static>>

Return a stream of all [position::Metadata] available.

source

fn positions_by_price( &self, pair: &DirectedTradingPair ) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send + 'static>>

Returns a stream of position::Id ordered by effective price.

source

fn position_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 Id ) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn check_position_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 Id ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn best_position<'life0, 'life1, 'async_trait>( &'life0 self, pair: &'life1 DirectedTradingPair ) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn pending_position_closures(&self) -> Vector<Id>

Fetch the list of pending position closures.

source

fn candidate_set( &self, from: Id, fixed_candidates: Arc<Vec<Id>> ) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send>>

Returns the list of candidate assets to route through for a trade from from. Combines a list of fixed candidates with a list of liquidity-based candidates. This ensures that the fixed candidates are always considered, minimizing the risk of attacks on routing.

source

fn ordered_routable_assets( &self, start: &Id ) -> Pin<Box<dyn Stream<Item = Result<Id>> + Send + 'static>>

Returns a stream of asset::Id routable from a given asset, ordered by liquidity.

source

fn recently_accessed_assets(&self) -> OrdSet<Id>

Fetch the list of assets interacted with during this block.

Object Safety§

This trait is not object safe.

Implementors§