nautilus_blockchain/exchanges/arbitrum/
uniswap_v3.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2025 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/// Uniswap V3 DEX on Arbitrum.
26pub static UNISWAP_V3: LazyLock<DexExtended> = LazyLock::new(|| {
27    let mut dex = Dex::new(
28        chains::ARBITRUM.clone(),
29        DexType::UniswapV3,
30        "0x1F98431c8aD98523631AE4a59f267346ea31F984",
31        165,
32        AmmType::CLAMM,
33        "PoolCreated(address,address,uint24,int24,address)",
34        "Swap(address,address,int256,int256,uint160,uint128,int24)",
35        "Mint(address,address,int24,int24,uint128,uint256,uint256)",
36        "Burn(address,int24,int24,uint128,uint256,uint256)",
37        "Collect(address,address,int24,int24,uint128,uint128)",
38    );
39    dex.set_initialize_event("Initialize(uint160,int24)");
40    let mut dex_extended = DexExtended::new(dex);
41
42    dex_extended.set_pool_created_event_parsing(uniswap_v3::pool_created::parse_pool_created_event);
43    dex_extended.set_initialize_event_parsing(uniswap_v3::initialize::parse_initialize_event);
44    dex_extended.set_swap_event_parsing(uniswap_v3::swap::parse_swap_event);
45    dex_extended.set_mint_event_parsing(uniswap_v3::mint::parse_mint_event);
46    dex_extended.set_burn_event_parsing(uniswap_v3::burn::parse_burn_event);
47    dex_extended.set_collect_event_parsing(uniswap_v3::collect::parse_collect_event);
48    dex_extended.set_convert_trade_data(uniswap_v3::trade_data::convert_to_trade_data);
49
50    dex_extended
51});