Skip to main content

PriceSource

Trait PriceSource 

Source
pub trait PriceSource: Send + Sync {
    // Required methods
    fn get_price_usd<'life0, 'life1, 'async_trait>(
        &'life0 self,
        token: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Decimal>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_liquidity_usd<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        token_a: &'life1 str,
        token_b: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Decimal>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Abstract pricing source for simulations

Required Methods§

Source

fn get_price_usd<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Decimal>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get exact price in USD

Source

fn get_liquidity_usd<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, token_a: &'life1 str, token_b: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Decimal>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get liquidity in USD for a pair

Implementors§