Skip to content

Commit 25ae5ac

Browse files
committed
fix: use liquidity guard only in debt swap
1 parent aca6602 commit 25ae5ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/transactions/Swap/errors/shared/InsufficientLiquidityBlockingGuard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import { isProtocolSwapState } from '../../types/state.types';
1515
import { InsufficientLiquidityBlockingError } from './InsufficientLiquidityBlockingError';
1616

1717
export const hasInsufficientLiquidity = (state: SwapState) => {
18-
if (!isProtocolSwapState(state) || state.swapType === SwapType.RepayWithCollateral) return false;
18+
// Only relevant for Debt Swaps where target asset availability and borrow cap matter.
19+
// Collateral-related flows are handled via SupplyCapBlockingGuard and should not use borrow caps here.
20+
if (!isProtocolSwapState(state) || state.swapType !== SwapType.DebtSwap) return false;
1921
const reserve = state.isInvertedSwap
2022
? state.sourceReserve?.reserve
2123
: state.destinationReserve?.reserve;

0 commit comments

Comments
 (0)