diff --git a/src/lib/swapper/swappers/LifiSwapper/endpoints.ts b/src/lib/swapper/swappers/LifiSwapper/endpoints.ts index 000f664a58f..5ad8f8831be 100644 --- a/src/lib/swapper/swappers/LifiSwapper/endpoints.ts +++ b/src/lib/swapper/swappers/LifiSwapper/endpoints.ts @@ -13,6 +13,7 @@ import type { Swapper2Api, TradeQuote2, } from 'lib/swapper/api' +import { makeSwapErrorRight, SwapErrorType } from 'lib/swapper/api' import { getLifi } from 'lib/swapper/swappers/LifiSwapper/utils/getLifi' import { getTradeQuote } from './getTradeQuote/getTradeQuote' @@ -29,6 +30,14 @@ export const lifiApi: Swapper2Api = { assets: Partial>, sellAssetPriceUsdPrecision: string, ): Promise> => { + if (input.sellAmountBeforeFeesCryptoBaseUnit === '0') { + return Err( + makeSwapErrorRight({ + message: 'sell amount too low', + code: SwapErrorType.TRADE_QUOTE_AMOUNT_TOO_SMALL, + }), + ) + } if (lifiChainMapPromise === undefined) lifiChainMapPromise = getLifiChainMap() const maybeLifiChainMap = await lifiChainMapPromise