nautilus_blockchain/exchanges/arbitrum/
mod.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2025 Posei Systems Pty Ltd. All rights reserved.
3//  https://poseitrader.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::collections::HashMap;
17
18use crate::exchanges::extended::DexExtended;
19
20mod camelot_v3;
21mod curve_finance;
22mod fluid;
23mod pancakeswap_v3;
24mod sushiswap_v2;
25mod sushiswap_v3;
26mod uniswap_v3;
27mod uniswap_v4;
28
29pub use camelot_v3::CAMELOT_V3;
30pub use curve_finance::CURVE_FINANCE;
31pub use fluid::FLUID_DEX;
32pub use pancakeswap_v3::PANCAKESWAP_V3;
33pub use sushiswap_v2::SUSHISWAP_V2;
34pub use sushiswap_v3::SUSHISWAP_V3;
35pub use uniswap_v3::UNISWAP_V3;
36pub use uniswap_v4::UNISWAP_V4;
37
38/// Returns a vector of references to all Arbitrum Dexes.
39#[must_use]
40pub fn all() -> Vec<&'static DexExtended> {
41    vec![
42        &*CAMELOT_V3,
43        &*CURVE_FINANCE,
44        &*FLUID_DEX,
45        &*PANCAKESWAP_V3,
46        &*SUSHISWAP_V2,
47        &*SUSHISWAP_V3,
48        &*UNISWAP_V3,
49        &*UNISWAP_V4,
50    ]
51}
52
53/// Returns a map of Arbitrum DEX name to Dex reference for easy lookup.
54#[must_use]
55pub fn dex_map() -> HashMap<&'static str, &'static DexExtended> {
56    let mut map = HashMap::new();
57    map.insert("camelot_v3", &*CAMELOT_V3);
58    map.insert("curve_finance", &*CURVE_FINANCE);
59    map.insert("fluid_dex", &*FLUID_DEX);
60    map.insert("pancakeswap_v3", &*PANCAKESWAP_V3);
61    map.insert("sushiswap_v2", &*SUSHISWAP_V2);
62    map.insert("sushiswap_v3", &*SUSHISWAP_V3);
63    map.insert("uniswap_v3", &*UNISWAP_V3);
64    map.insert("uniswap_v4", &*UNISWAP_V4);
65    map
66}