Skip to main content

nautilus_blockchain/exchanges/base/
aerodrome_slipstream.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16use std::sync::LazyLock;
17
18use nautilus_model::defi::{
19    chain::chains,
20    dex::{AmmType, Dex, DexType},
21};
22
23use crate::exchanges::{extended::DexExtended, parsing::uniswap_v3};
24
25/// Aerodrome Slipstream DEX on Base.
26///
27/// Slipstream is a Uniswap V3 fork; pool events reuse the V3 parsers. The factory
28/// PoolCreated layout differs (tickSpacing in place of fee) and is left empty until
29/// a Slipstream parser is written, since advertising a topic without a parser would
30/// abort pool discovery.
31pub static AERODROME_SLIPSTREAM: LazyLock<DexExtended> = LazyLock::new(|| {
32    let mut dex = Dex::new(
33        chains::BASE.clone(),
34        DexType::AerodromeSlipstream,
35        "0x420DD381b31aEf6683db6B902084cB0FFECe40Da",
36        3200559,
37        AmmType::CLAMM,
38        "",
39        "Swap(address,address,int256,int256,uint160,uint128,int24)",
40        "Mint(address,address,int24,int24,uint128,uint256,uint256)",
41        "Burn(address,int24,int24,uint128,uint256,uint256)",
42        "Collect(address,address,int24,int24,uint128,uint128)",
43    );
44    dex.set_initialize_event("Initialize(uint160,int24)");
45    dex.set_flash_event("Flash(address,address,uint256,uint256,uint256,uint256)");
46
47    let mut dex_extended = DexExtended::new(dex);
48
49    dex_extended.set_initialize_event_hypersync_parsing(
50        uniswap_v3::initialize::parse_initialize_event_hypersync,
51    );
52    dex_extended.set_swap_event_hypersync_parsing(uniswap_v3::swap::parse_swap_event_hypersync);
53    dex_extended.set_mint_event_hypersync_parsing(uniswap_v3::mint::parse_mint_event_hypersync);
54    dex_extended.set_burn_event_hypersync_parsing(uniswap_v3::burn::parse_burn_event_hypersync);
55    dex_extended
56        .set_collect_event_hypersync_parsing(uniswap_v3::collect::parse_collect_event_hypersync);
57    dex_extended.set_flash_event_hypersync_parsing(uniswap_v3::flash::parse_flash_event_hypersync);
58
59    dex_extended
60        .set_initialize_event_rpc_parsing(uniswap_v3::initialize::parse_initialize_event_rpc);
61    dex_extended.set_swap_event_rpc_parsing(uniswap_v3::swap::parse_swap_event_rpc);
62    dex_extended.set_mint_event_rpc_parsing(uniswap_v3::mint::parse_mint_event_rpc);
63    dex_extended.set_burn_event_rpc_parsing(uniswap_v3::burn::parse_burn_event_rpc);
64    dex_extended.set_collect_event_rpc_parsing(uniswap_v3::collect::parse_collect_event_rpc);
65    dex_extended.set_flash_event_rpc_parsing(uniswap_v3::flash::parse_flash_event_rpc);
66
67    dex_extended
68});