cffms-rs

Sync pairs and simulate swaps with constant function market makers on Ethereum.

Filename: examples/sync-pairs.rs ```rust

[tokio::main]

async fn main() -> Result<(), Box> { //Add rpc endpoint here: let rpcendpoint = ""; let provider = Arc::new(Provider::::tryfrom(rpc_endpoint).unwrap());

let mut dexes = vec![];

//Add UniswapV2
dexes.push(Dex::new(
    //Specify the factory address
    H160::from_str("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f").unwrap(),
    //Specify the dex variant
    DexVariant::UniswapV2,
    //Specify the factory contract's creation block number
    2638438,
));

//Add Sushiswap
dexes.push(Dex::new(
    H160::from_str("0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac").unwrap(),
    DexVariant::UniswapV2,
    10794229,
));

//Add UniswapV3
dexes.push(Dex::new(
    H160::from_str("0x1F98431c8aD98523631AE4a59f267346ea31F984").unwrap(),
    DexVariant::UniswapV3,
    12369621,
));

//Sync pairs
sync::sync_pairs(dexes, provider).await?;

Ok(())

} ```

Supported Dexes

| Dex | Status | |----------|------| | UniswapV2 variants | ✅|| | UniswapV3 | ✅||

Running Examples

To run any of the examples, supply your node endpoint to the endpoint variable in each example file. For example in sync-pairs.rs:

rust //Add rpc endpoint here: let rpc_endpoint = "";

Once you have supplied a node endpoint, you can simply run cargo run --example <example_name>.

Filters

filter_blacklisted_tokens

filter_blacklisted_pools

filter_blacklisted_addresses

filter_pools_below_usd_threshold

filter_pools_below_weth_threshold

Upcoming Filters

filter_fee_tokens