evm-dex-pool 1.2.2

Reusable EVM DEX pool implementations (UniswapV2, UniswapV3, ERC4626) with traits and math
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use alloy::primitives::Address;
use alloy::providers::Provider;
use anyhow::Result;
use std::future::Future;
use std::sync::Arc;

/// Trait for resolving token address to (address, decimals).
/// Implementors should cache results and fetch from RPC if not cached.
pub trait TokenInfo: Send + Sync {
    fn get_or_fetch_token<P: Provider + Send + Sync>(
        &self,
        provider: &Arc<P>,
        address: Address,
        multicall_address: Address,
    ) -> impl Future<Output = Result<(Address, u8)>> + Send;
}