use std::{str::FromStr, sync::Arc, time::Duration};
use ethers::{
providers::{Ipc, Provider},
types::H160,
};
use pair_sync::{
dex::{Dex, DexVariant},
sync,
};
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let ipc_endpoint = "";
let provider: Arc<Provider<Ipc>> = Arc::new(
Provider::connect_ipc(ipc_endpoint)
.await?
.interval(Duration::from_millis(2000)),
);
let mut dexes = vec![];
dexes.push(Dex::new(
H160::from_str("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f").unwrap(),
DexVariant::UniswapV2,
2638438,
));
dexes.push(Dex::new(
H160::from_str("0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac").unwrap(),
DexVariant::UniswapV2,
10794229,
));
dexes.push(Dex::new(
H160::from_str("0x1F98431c8aD98523631AE4a59f267346ea31F984").unwrap(),
DexVariant::UniswapV3,
12369621,
));
sync::sync_pairs(dexes, provider, false).await?;
Ok(())
}