Trait penumbra_dex::component::StateReadExt

source ·
pub trait StateReadExt: StateRead {
    // Provided methods
    fn output_data<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
        trading_pair: TradingPair
    ) -> Pin<Box<dyn Future<Output = Result<Option<BatchSwapOutputData>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn swap_execution<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
        trading_pair: DirectedTradingPair
    ) -> Pin<Box<dyn Future<Output = Result<Option<SwapExecution>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn arb_execution<'life0, 'async_trait>(
        &'life0 self,
        height: u64
    ) -> Pin<Box<dyn Future<Output = Result<Option<SwapExecution>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn swap_flow(&self, pair: &TradingPair) -> SwapFlow { ... }
    fn swap_flows(&self) -> BTreeMap<TradingPair, SwapFlow> { ... }
    fn pending_batch_swap_outputs(
        &self
    ) -> OrdMap<TradingPair, BatchSwapOutputData> { ... }
    fn get_dex_params<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<DexParameters>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn routing_params<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<RoutingParams>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Available on crate feature component only.
Expand description

Extension trait providing read access to dex data.

Provided Methods§

source

fn output_data<'life0, 'async_trait>( &'life0 self, height: u64, trading_pair: TradingPair ) -> Pin<Box<dyn Future<Output = Result<Option<BatchSwapOutputData>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

source

fn swap_execution<'life0, 'async_trait>( &'life0 self, height: u64, trading_pair: DirectedTradingPair ) -> Pin<Box<dyn Future<Output = Result<Option<SwapExecution>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

source

fn arb_execution<'life0, 'async_trait>( &'life0 self, height: u64 ) -> Pin<Box<dyn Future<Output = Result<Option<SwapExecution>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

source

fn swap_flow(&self, pair: &TradingPair) -> SwapFlow

Get the swap flow for the given trading pair accumulated in this block so far.

source

fn swap_flows(&self) -> BTreeMap<TradingPair, SwapFlow>

source

fn pending_batch_swap_outputs(&self) -> OrdMap<TradingPair, BatchSwapOutputData>

source

fn get_dex_params<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<DexParameters>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Gets the DEX parameters from the state.

source

fn routing_params<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<RoutingParams>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Uses the DEX parameters to construct a RoutingParams for use in execution or simulation.

Object Safety§

This trait is not object safe.

Implementors§