diff --git a/src/asset-swapper/types.ts b/src/asset-swapper/types.ts index 4a4706fd8..fd589fae1 100644 --- a/src/asset-swapper/types.ts +++ b/src/asset-swapper/types.ts @@ -501,6 +501,7 @@ export enum ERC20BridgeSource { UbeSwap = 'UbeSwap', MobiusMoney = 'MobiusMoney', // Fantom + SoulSwap = 'SoulSwap', SpiritSwap = 'SpiritSwap', SpookySwap = 'SpookySwap', Beethovenx = 'Beethovenx', diff --git a/src/asset-swapper/utils/market_operation_utils/bridge_source_utils.ts b/src/asset-swapper/utils/market_operation_utils/bridge_source_utils.ts index 10b439758..325f3067e 100644 --- a/src/asset-swapper/utils/market_operation_utils/bridge_source_utils.ts +++ b/src/asset-swapper/utils/market_operation_utils/bridge_source_utils.ts @@ -30,6 +30,7 @@ import { SADDLE_ARBITRUM_INFOS, SHELL_POOLS_BY_CHAIN_ID, SHIBASWAP_ROUTER_BY_CHAIN_ID, + SOULSWAP_ROUTER_BY_CHAIN_ID, SPIRITSWAP_ROUTER_BY_CHAIN_ID, SPOOKYSWAP_ROUTER_BY_CHAIN_ID, SUSHISWAP_ROUTER_BY_CHAIN_ID, @@ -481,6 +482,7 @@ export function uniswapV2LikeRouterAddress( | ERC20BridgeSource.Pangolin | ERC20BridgeSource.UbeSwap | ERC20BridgeSource.MorpheusSwap + | ERC20BridgeSource.SoulSwap | ERC20BridgeSource.SpookySwap | ERC20BridgeSource.SpiritSwap | ERC20BridgeSource.BiSwap @@ -520,6 +522,8 @@ export function uniswapV2LikeRouterAddress( return UBESWAP_ROUTER_BY_CHAIN_ID[chainId]; case ERC20BridgeSource.MorpheusSwap: return MORPHEUSSWAP_ROUTER_BY_CHAIN_ID[chainId]; + case ERC20BridgeSource.SoulSwap: + return SOULSWAP_ROUTER_BY_CHAIN_ID[chainId]; case ERC20BridgeSource.SpookySwap: return SPOOKYSWAP_ROUTER_BY_CHAIN_ID[chainId]; case ERC20BridgeSource.SpiritSwap: diff --git a/src/asset-swapper/utils/market_operation_utils/constants.ts b/src/asset-swapper/utils/market_operation_utils/constants.ts index e078b7d4d..260d78e51 100644 --- a/src/asset-swapper/utils/market_operation_utils/constants.ts +++ b/src/asset-swapper/utils/market_operation_utils/constants.ts @@ -159,6 +159,7 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID: Record = { ERC20BridgeSource.Pangolin, ERC20BridgeSource.TraderJoe, ERC20BridgeSource.SushiSwap, + ERC20BridgeSource.SoulSwap, ERC20BridgeSource.Curve, ERC20BridgeSource.CurveV2, ERC20BridgeSource.KyberDmm, @@ -175,6 +176,7 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID: Record = { ERC20BridgeSource.Curve, ERC20BridgeSource.CurveV2, ERC20BridgeSource.MorpheusSwap, + ERC20BridgeSource.SoulSwap, ERC20BridgeSource.SpiritSwap, ERC20BridgeSource.SpookySwap, ERC20BridgeSource.SushiSwap, @@ -312,6 +314,7 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID: Record = { ERC20BridgeSource.Pangolin, ERC20BridgeSource.TraderJoe, ERC20BridgeSource.SushiSwap, + ERC20BridgeSource.SoulSwap, ERC20BridgeSource.Curve, ERC20BridgeSource.CurveV2, ERC20BridgeSource.KyberDmm, @@ -328,6 +331,7 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID: Record = { ERC20BridgeSource.Curve, ERC20BridgeSource.CurveV2, ERC20BridgeSource.MorpheusSwap, + ERC20BridgeSource.SoulSwap, ERC20BridgeSource.SpiritSwap, ERC20BridgeSource.SpookySwap, ERC20BridgeSource.SushiSwap, @@ -390,8 +394,8 @@ export const FEE_QUOTE_SOURCES_BY_CHAIN_ID = valueByChainId [ChainId.Goerli]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap], [ChainId.PolygonMumbai]: [ERC20BridgeSource.UniswapV3], [ChainId.Polygon]: [ERC20BridgeSource.QuickSwap, ERC20BridgeSource.SushiSwap, ERC20BridgeSource.UniswapV3], - [ChainId.Avalanche]: [ERC20BridgeSource.Pangolin, ERC20BridgeSource.TraderJoe, ERC20BridgeSource.SushiSwap], - [ChainId.Fantom]: [ERC20BridgeSource.SpiritSwap, ERC20BridgeSource.SpookySwap, ERC20BridgeSource.SushiSwap], + [ChainId.Avalanche]: [ERC20BridgeSource.Pangolin, ERC20BridgeSource.TraderJoe, ERC20BridgeSource.SoulSwap, ERC20BridgeSource.SushiSwap], + [ChainId.Fantom]: [ERC20BridgeSource.SoulSwap, ERC20BridgeSource.SpiritSwap, ERC20BridgeSource.SpookySwap, ERC20BridgeSource.SushiSwap], [ChainId.Celo]: [ERC20BridgeSource.UbeSwap, ERC20BridgeSource.SushiSwap], [ChainId.Optimism]: [ERC20BridgeSource.UniswapV3], [ChainId.Arbitrum]: [ERC20BridgeSource.UniswapV3, ERC20BridgeSource.SushiSwap], @@ -1789,6 +1793,14 @@ export const MORPHEUSSWAP_ROUTER_BY_CHAIN_ID = valueByChainId( NULL_ADDRESS, ); +export const SOULSWAP_ROUTER_BY_CHAIN_ID = valueByChainId( + { + [ChainId.Avalanche]: '0xa4594460a9d3d41e8b85542d34e23adabc3c86ef', + [ChainId.Fantom]: '0x6b3d631b87fe27af29efec61d2ab8ce4d621ccbf', + }, + NULL_ADDRESS, +); + export const SPIRITSWAP_ROUTER_BY_CHAIN_ID = valueByChainId( { [ChainId.Fantom]: '0x16327e3fbdaca3bcf7e38f5af2599d2ddc33ae52', @@ -2170,6 +2182,7 @@ export const DEFAULT_GAS_SCHEDULE: GasSchedule = { // Fantom // [ERC20BridgeSource.MorpheusSwap]: uniswapV2CloneGasSchedule, + [ERC20BridgeSource.SoulSwap]: uniswapV2CloneGasSchedule, [ERC20BridgeSource.SpiritSwap]: uniswapV2CloneGasSchedule, [ERC20BridgeSource.SpookySwap]: uniswapV2CloneGasSchedule, [ERC20BridgeSource.Yoshi]: uniswapV2CloneGasSchedule, diff --git a/src/asset-swapper/utils/market_operation_utils/orders.ts b/src/asset-swapper/utils/market_operation_utils/orders.ts index 3db261acb..5d85191b9 100644 --- a/src/asset-swapper/utils/market_operation_utils/orders.ts +++ b/src/asset-swapper/utils/market_operation_utils/orders.ts @@ -164,6 +164,8 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'UbeSwap'); case ERC20BridgeSource.Beethovenx: return encodeBridgeSourceId(BridgeProtocol.BalancerV2Batch, 'Beethovenx'); + case ERC20BridgeSource.SoulSwap: + return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'SoulSwap'); case ERC20BridgeSource.SpiritSwap: return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'SpiritSwap'); case ERC20BridgeSource.SpookySwap: @@ -274,6 +276,7 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder case ERC20BridgeSource.Pangolin: case ERC20BridgeSource.TraderJoe: case ERC20BridgeSource.UbeSwap: + case ERC20BridgeSource.SoulSwap: case ERC20BridgeSource.SpiritSwap: case ERC20BridgeSource.SpookySwap: case ERC20BridgeSource.MorpheusSwap: @@ -473,6 +476,7 @@ const BRIDGE_ENCODERS: { [ERC20BridgeSource.ShibaSwap]: routerAddressPathEncoder, [ERC20BridgeSource.Pangolin]: routerAddressPathEncoder, [ERC20BridgeSource.TraderJoe]: routerAddressPathEncoder, + [ERC20BridgeSource.SoulSwap]: routerAddressPathEncoder, [ERC20BridgeSource.SpiritSwap]: routerAddressPathEncoder, [ERC20BridgeSource.SpookySwap]: routerAddressPathEncoder, [ERC20BridgeSource.MorpheusSwap]: routerAddressPathEncoder, diff --git a/src/asset-swapper/utils/market_operation_utils/sampler_operations.ts b/src/asset-swapper/utils/market_operation_utils/sampler_operations.ts index fa7f7f1b7..5f1e5d3e4 100644 --- a/src/asset-swapper/utils/market_operation_utils/sampler_operations.ts +++ b/src/asset-swapper/utils/market_operation_utils/sampler_operations.ts @@ -1551,6 +1551,7 @@ export class SamplerOperations { case ERC20BridgeSource.Pangolin: case ERC20BridgeSource.TraderJoe: case ERC20BridgeSource.UbeSwap: + case ERC20BridgeSource.SoulSwap: case ERC20BridgeSource.SpiritSwap: case ERC20BridgeSource.SpookySwap: case ERC20BridgeSource.Yoshi: @@ -1892,6 +1893,7 @@ export class SamplerOperations { case ERC20BridgeSource.Pangolin: case ERC20BridgeSource.TraderJoe: case ERC20BridgeSource.UbeSwap: + case ERC20BridgeSource.SoulSwap: case ERC20BridgeSource.SpiritSwap: case ERC20BridgeSource.SpookySwap: case ERC20BridgeSource.Yoshi: