Trait LqtRead

Source
pub trait LqtRead: StateRead {
    // Provided methods
    fn get_volume_for_pair<'life0, 'async_trait>(
        &'life0 self,
        asset: Id,
    ) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_volume_for_position<'life0, 'life1, 'async_trait>(
        &'life0 self,
        position_id: &'life1 Id,
    ) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn positions_by_volume_stream(
        &self,
        epoch_index: u64,
        asset_id: Id,
    ) -> Result<Pin<Box<dyn Stream<Item = Result<(Id, Id, Amount)>> + Send + 'static>>> { ... }
}
Available on crate feature component only.
Expand description

Provides public read access to LQT data.

Provided Methods§

Source

fn get_volume_for_pair<'life0, 'async_trait>( &'life0 self, asset: Id, ) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Returns the cumulative volume of staking token for a trading pair. This is the sum of the outflows of the staking token from all positions in the pair.

Default to zero if no volume is found.

Source

fn get_volume_for_position<'life0, 'life1, 'async_trait>( &'life0 self, position_id: &'life1 Id, ) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the cumulative volume of staking token for a given position id. This is the sum of the outflows of the staking token from the position.

Default to zero if no volume is found.

Source

fn positions_by_volume_stream( &self, epoch_index: u64, asset_id: Id, ) -> Result<Pin<Box<dyn Stream<Item = Result<(Id, Id, Amount)>> + Send + 'static>>>

Returns a stream of position ids sorted by descending volume. The volume is the sum of the outflows of the staking token from the position.

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§

Source§

impl<T: StateRead + ?Sized> LqtRead for T