nautilus_blockchain/exchanges/ethereum/
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
20pub mod balancer_v2;
21pub mod balancer_v3;
22pub mod curve_finance;
23pub mod fluid;
24pub mod maverick_v2;
25pub mod pancakeswap_v3;
26pub mod uniswap_v2;
27pub mod uniswap_v3;
28pub mod uniswap_v4;
29
30pub use balancer_v2::BALANCER_V2;
31pub use balancer_v3::BALANCER_V3;
32pub use curve_finance::CURVE_FINANCE;
33pub use fluid::FLUID_DEX;
34pub use maverick_v2::MAVERICK_V2;
35pub use pancakeswap_v3::PANCAKESWAP_V3;
36pub use uniswap_v2::UNISWAP_V2;
37pub use uniswap_v3::UNISWAP_V3;
38pub use uniswap_v4::UNISWAP_V4;
39
40/// Returns a slice of all Ethereum Dexes
41#[must_use]
42pub fn all() -> Vec<&'static DexExtended> {
43    vec![
44        &UNISWAP_V2,
45        &UNISWAP_V3,
46        &UNISWAP_V4,
47        &CURVE_FINANCE,
48        &FLUID_DEX,
49        &MAVERICK_V2,
50        &BALANCER_V2,
51        &BALANCER_V3,
52        &PANCAKESWAP_V3,
53    ]
54}
55
56/// Returns a map of Ethereum DEX name to Dex reference for easy lookup
57#[must_use]
58pub fn dex_map() -> HashMap<&'static str, &'static DexExtended> {
59    let mut map = HashMap::new();
60    map.insert("uniswap_v2", &*UNISWAP_V2);
61    map.insert("uniswap_v3", &*UNISWAP_V3);
62    map.insert("uniswap_v4", &*UNISWAP_V4);
63    map.insert("curve_finance", &*CURVE_FINANCE);
64    map.insert("fluid_dex", &FLUID_DEX);
65    map.insert("maverick_v2", &*MAVERICK_V2);
66    map.insert("balancer_v2", &*BALANCER_V2);
67    map.insert("balancer_v3", &*BALANCER_V3);
68    map.insert("pancakeswap_v3", &*PANCAKESWAP_V3);
69    map
70}