Trait AutomatedMarketMakerFactory

Source
pub trait AutomatedMarketMakerFactory {
    // Required methods
    fn address(&self) -> Felt;
    fn fetch_all_pools<'life0, 'async_trait, P>(
        &'life0 mut self,
        provider: Arc<P>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<AMM>, AMMError>> + Send + 'async_trait>>
       where P: Provider + Sync + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn amm_created_event_signature(&self) -> Vec<Vec<Felt>>;
    fn populate_amm_data<'life0, 'life1, 'async_trait, P>(
        &'life0 self,
        amms: &'life1 mut [AMM],
        block_number: Option<u64>,
        provider: Arc<P>,
    ) -> Pin<Box<dyn Future<Output = Result<(), AMMError>> + Send + 'async_trait>>
       where P: Provider + Send + Sync + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn address(&self) -> Felt

Returns the address of the AMM.

Source

fn fetch_all_pools<'life0, 'async_trait, P>( &'life0 mut self, provider: Arc<P>, ) -> Pin<Box<dyn Future<Output = Result<Vec<AMM>, AMMError>> + Send + 'async_trait>>
where P: Provider + Sync + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Source

fn amm_created_event_signature(&self) -> Vec<Vec<Felt>>

Source

fn populate_amm_data<'life0, 'life1, 'async_trait, P>( &'life0 self, amms: &'life1 mut [AMM], block_number: Option<u64>, provider: Arc<P>, ) -> Pin<Box<dyn Future<Output = Result<(), AMMError>> + Send + 'async_trait>>
where P: Provider + Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Populates all AMMs data via batched static calls.

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§