feat: Generalize group_swaps method
- This can now be used for any groupable protocols - not just USV4.
This commit is contained in:
@@ -1,2 +1,16 @@
|
||||
use std::{collections::HashSet, sync::LazyLock};
|
||||
|
||||
pub const DEFAULT_EXECUTORS_JSON: &str =
|
||||
include_str!("../../../src/encoding/config/executor_addresses.json");
|
||||
|
||||
/// These protocols support the optimization of grouping swaps.
|
||||
///
|
||||
/// This requires special encoding to send call data of multiple swaps to a single executor,
|
||||
/// as if it were a single swap. The protocol likely uses flash accounting to save gas on token
|
||||
/// transfers.
|
||||
pub static GROUPABLE_PROTOCOLS: LazyLock<HashSet<&'static str>> = LazyLock::new(|| {
|
||||
let mut set = HashSet::new();
|
||||
set.insert("uniswap_v4");
|
||||
set.insert("balancer_v3");
|
||||
set
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user