From ab0c7c0899586209cba252860cd31d93809e5676 Mon Sep 17 00:00:00 2001 From: woody <125113430+woodenfurniture@users.noreply.github.com> Date: Fri, 25 Oct 2024 20:02:02 +1100 Subject: [PATCH] fix: deny stargateV2Bus in lifi swapper (#8003) --- .../swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/swapper/src/swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts b/packages/swapper/src/swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts index e0c9c08b4ac..daaf69c48db 100644 --- a/packages/swapper/src/swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts +++ b/packages/swapper/src/swappers/LifiSwapper/getTradeQuote/getTradeQuote.ts @@ -101,7 +101,13 @@ export async function getTradeQuote( // used for analytics and affiliate fee - do not change this without considering impact integrator: LIFI_INTEGRATOR_ID, slippage: Number(slippageTolerancePercentageDecimal), - bridges: { deny: ['stargate', 'stargateV2', 'amarok', 'arbitrum'] }, + // Routes via Stargate or Amarok can always be executed in one step, as LiFi can make those + // bridges swap into any requested token on the destination chain. Other bridges my require + // two steps. As such, additional balance checks on the destination chain are required which + // are currently incompatible with our fee calculations, leading to incorrect fee display, + // reverts, partial swaps, wrong received tokens (due to out-of-gas mid-trade), etc. For now, + // these bridges are disabled. + bridges: { deny: ['stargate', 'stargateV2', 'stargateV2Bus', 'amarok', 'arbitrum'] }, allowSwitchChain: true, fee: affiliateBpsDecimalPercentage.isZero() ? undefined