mantle_integration_test/
mantle_integration_test.rs

1//! Mantle Integration Test Example
2//!
3//! This example demonstrates how to use PoolSync with Mantle chain.
4//! It follows the same pattern as your provided example but targets Mantle.
5
6use anyhow::Result;
7use pool_sync_mantle::{Chain, PoolInfo, PoolSync, PoolType};
8
9#[tokio::main]
10async fn main() -> Result<()> {
11    // Configure and build the PoolSync instance for Mantle
12    let pool_sync = PoolSync::builder()
13        .add_pool(PoolType::UniswapV3)      // Uniswap V3 on Mantle
14        .chain(Chain::Mantle)               // Target Mantle chain
15        .build()?;
16
17    // Synchronize pools
18    let (pools, last_synced_block) = pool_sync.sync_pools().await?;
19
20    // Display results (same format as your example)
21    println!("=== Mantle Chain Pool Sync Results ===");
22    for pool in &pools {
23        println!(
24            "Pool Address {:?}, Token 0: {:?}, Token 1: {:?}",
25            pool.address(),
26            pool.token0_name(),
27            pool.token1_name()
28        );
29    }
30
31    println!("Synced {} pools on Mantle chain (Uniswap V3)!", pools.len());
32    println!("Last synced block: {}", last_synced_block);
33
34    Ok(())
35}
36
37