Oct. 21st, 2026

Swap into the debt token before submitting the liquidation. Your execution window is the time until another liquidator repays the debt or the position recovers; the protocol does not reserve a liquidation for your bot.

For an integrator, Blackhole Swap can source a repayment asset from Avalanche C-Chain liquidity when the liquidator’s inventory is in another token. Treat the quote as a snapshot, then make the swap and liquidation atomic where possible. Keep a fresh balance of the target debt token as a fallback when a separate swap transaction would leave too much time for the opportunity to disappear.

What does the liquidation window actually mean?

The window is an off-chain estimate of how long a position may remain liquidatable, not a protocol deadline. In an Aave V3 style market, a position is eligible while its health factor is below 1; any liquidator can submit a valid call, so another transaction can consume the opportunity before yours.

Use the lending market’s current state, not a cached alert, to decide whether to trade. Read the borrower’s health factor, outstanding debt by reserve, collateral available to seize, and oracle prices again when building the liquidation transaction. On Aave V3, the default close factor is 50% when health factor is above 0.95, and can rise to 100% at or below 0.95, subject to the deployed market’s rules.

How should the integrator source the repayment token?

Source the debt token from liquidator inventory or a flash loan before the liquidation call. Collateral seized from the borrower is not available to repay the debt until the liquidation executes, so it cannot fund a preceding standalone swap.

For a swap from token A into debt token D, quote a route on Blackhole Swap and check the actual pool and token addresses on Avalanche. Blackhole has different pool types and configurable fees; read the selected pool’s fee and liquidity from current on-chain state instead of hard-coding a platform-wide fee. Aave V3 liquidation logic and Avalanche’s C-Chain fee documentation are useful primary references for validating the lending parameters and the separate AVAX gas requirement.

Carry the execution parameters explicitly through your transaction builder:

  • amountIn: the exact input in token A’s smallest units, capped by available balance or flash-loan proceeds.
  • quotedOut: the router quote after pool fees and estimated price impact.
  • amountOutMin: quoted output reduced by your slippage tolerance, for example 30–100 basis points on a liquid, stable route.
  • recipient: the executor that will call the lending pool, if using atomic execution.
  • deadline: a short transaction validity bound, such as 15–30 seconds as an illustrative setting.

The tolerance is a loss bound, not a prediction of execution quality. I would reject the route if expected price impact already uses most of the tolerance; widening it to force a fill can turn a marginal liquidation into a loss.

How do you execute without losing the opportunity?

Build one transaction that swaps into the debt asset and then calls the lending pool when your contracts, router interface, and token approvals allow it. Atomic execution means a failed liquidation reverts the swap too, avoiding stranded inventory after another liquidator wins the race.

  1. Refresh the candidate. Re-read health factor, debt, collateral, and oracle-sensitive values immediately before execution. Drop the candidate if it is no longer liquidatable or the debt reserve has changed.
  2. Set a repay amount the market will accept. Compute the close-factor cap per the deployed market and reserve, accounting for accrued debt and token decimals. For a position just below 1.0 health factor, do not assume you can repay the full reserve debt.
  3. Quote and simulate the swap. Estimate output using the exact pool route and amount, then simulate the complete swap-plus-liquidation call against a recent block. Include approvals, minimum output, collateral availability, and the protocol’s liquidation bonus in the simulation.
  4. Check net proceeds against all costs. Compare the expected value of seized collateral with debt repaid, swap fee, price impact, AVAX gas, and any flash-loan fee. For example, if repaying 1,000 USDC is expected to return collateral worth 1,040 USDC, a 2% swap and execution cost leaves only about 20 USDC before gas and adverse price movement.
  5. Submit with a freshness bound. Send the atomic transaction with a tight deadline and a minimum output consistent with your risk limit. If it reverts because the position was already liquidated or the quote moved, refresh state and reprice; do not blindly resend the stale calldata.

If the integration cannot make the swap and liquidation atomic, swap first only when you can tolerate holding the acquired debt token after a lost race. Otherwise maintain repayment-token inventory or use a flash loan inside the same executor. The trade-off is capital efficiency against operational complexity and an extra failure surface.

What should you check when a liquidation fails?

Most failed attempts come from stale position state, a repay amount above the current close-factor cap, insufficient output after slippage, or missing token approval. A candidate can also become unprofitable even while still liquidatable: pool depth, collateral price, gas, and the liquidation bonus jointly determine the margin.

Does a liquidation have a fixed deadline?

No universal timer starts when health factor falls below 1. The position remains eligible only while its current state satisfies the market’s liquidation conditions, and another liquidator can act first. Treat your deadline as a bot policy for quote age and transaction validity; refresh the position and quote immediately before sending.

How much slippage should the swap allow?

Set the bound from route depth, volatility, and the liquidation’s remaining profit margin. A tolerance around 30–100 bps can be a starting point for a liquid route, but a thin pool may require splitting or abandoning the trade. The minimum output should preserve positive expected PnL after the liquidation bonus, gas, and any loan fee.

  • Refresh eligibility and per-reserve repay limits.
  • Source debt tokens from inventory or an atomic flash loan.
  • Quote Blackhole Swap from live pool state and set a defensible minimum output.
  • Simulate and submit the swap plus liquidation atomically when possible.

Profile

defi_field_journal

October 2026

S M T W T F S
    123
45678910
11121314 15 16 17
181920 21 222324
25262728 293031

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 29th, 2026 09:05 pm
Powered by Dreamwidth Studios