waterpump-evm-pool-sdk 0.1.0

EVM pool SDK — viewers, infusers, harvesters, swappers for Uniswap V3/V4, PancakeSwap, Slipstream, Shadow, Algebra
Documentation
/// Macro to implement PoolBase trait for pool infusers and viewers
///
/// Assumes the struct has:
/// - `pool_key` field with `token_a` and `token_b` fields
///   - For V3: `V3PoolKey` with `token_a`, `token_b`, and `fee` fields
///   - For Ramses V3: `V3PoolKey` with `token_a`, `token_b`, and `fee` fields
///   - For Slipstream: `SlipstreamPoolKey` with `token_a`, `token_b`, and
///     `tick_spacing` fields
///   - For V4: `V4PoolKey` with `token_a`, `token_b`, `fee`, and `tick_spacing`
///     fields
#[macro_export]
macro_rules! impl_pool_base {
    ($struct_name:ident) => {
        impl $crate::traits::pool_base::PoolBase for $struct_name {
            fn currency0(&self) -> uniswap_sdk_core::prelude::Currency {
                self.pool_key.token_a.clone()
            }

            fn currency1(&self) -> uniswap_sdk_core::prelude::Currency {
                self.pool_key.token_b.clone()
            }
        }
    };
}