diff --git a/api/_dexes/cross-swap-service.ts b/api/_dexes/cross-swap-service.ts index e56ade788..e9aa2585d 100644 --- a/api/_dexes/cross-swap-service.ts +++ b/api/_dexes/cross-swap-service.ts @@ -720,7 +720,8 @@ function _prepCrossSwapQuotesRetrievalB2A( destinationSwap.chainId, destinationSwap.tokenIn.symbol, destinationSwap.tokenOut.symbol, - strategies + strategies, + "destination" ); // Resolve deposit entry point @@ -1022,7 +1023,8 @@ function _prepCrossSwapQuotesRetrievalA2B( originSwapChainId, crossSwap.inputToken.symbol, bridgeableInputToken.symbol, - strategies + strategies, + "origin" ); // Return a list of results for each origin strategy @@ -1644,13 +1646,15 @@ function _prepCrossSwapQuotesRetrievalA2A(params: { originSwapChainId, crossSwap.inputToken.symbol, bridgeableInputToken.symbol, - strategies + strategies, + "origin" ); const destinationStrategies = getQuoteFetchStrategies( destinationSwapChainId, bridgeableOutputToken.symbol, crossSwap.outputToken.symbol, - strategies + strategies, + "destination" ); const baseStrategies = diff --git a/api/_dexes/utils.ts b/api/_dexes/utils.ts index c7d5cd05b..5f5f2f3c8 100644 --- a/api/_dexes/utils.ts +++ b/api/_dexes/utils.ts @@ -99,6 +99,12 @@ export type QuoteFetchStrategies = Partial<{ chains: { [chainId: number]: QuoteFetchStrategy[]; }; + originChains: { + [chainId: number]: QuoteFetchStrategy[]; + }; + destinationChains: { + [chainId: number]: QuoteFetchStrategy[]; + }; swapPairs: { [chainId: number]: { [tokenInSymbol: string]: { @@ -800,11 +806,18 @@ export function getQuoteFetchStrategies( chainId: number, tokenInSymbol: string, tokenOutSymbol: string, - strategies: QuoteFetchStrategies + strategies: QuoteFetchStrategies, + swapSide: "origin" | "destination" ): QuoteFetchStrategy[] { + const strategiesForChain = + (swapSide === "origin" + ? strategies.originChains?.[chainId] + : strategies.destinationChains?.[chainId]) || + strategies.chains?.[chainId]; + return ( strategies.swapPairs?.[chainId]?.[tokenInSymbol]?.[tokenOutSymbol] ?? - strategies.chains?.[chainId] ?? + strategiesForChain ?? strategies.default ?? defaultQuoteFetchStrategies.default! ); diff --git a/api/swap/_configs.ts b/api/swap/_configs.ts index 9a3c04ac0..d93612596 100644 --- a/api/swap/_configs.ts +++ b/api/swap/_configs.ts @@ -18,6 +18,10 @@ export const quoteFetchStrategies: QuoteFetchStrategies = { // getUniversalRouter02Strategy(), getLifiStrategy("SpokePoolPeriphery"), ], + originChains: { + // Disable origin swaps on Blast for now + [CHAIN_IDs.BLAST]: [], + }, chains: { [CHAIN_IDs.LENS]: [ getSwapRouter02Strategy("SpokePoolPeriphery", "sdk-swap-quoter"),