penumbra_dex::component

Trait StateReadExt

Source
pub trait StateReadExt: StateRead {
    // Provided methods
    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 { ... }
    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 get_active_trading_pairs_in_block(&self) -> BTreeSet<TradingPair> { ... }
}
Available on crate feature component only.
Expand description

Provides public read access to DEX data.

Provided Methods§

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.

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 get_active_trading_pairs_in_block(&self) -> BTreeSet<TradingPair>

Return a set of TradingPairs for which liquidity positions were opened during this block.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§