Skip to Content

Liquidator Bots

Liquidator bots monitor accounts near liquidation and perform liquidations to keep the protocol healthy. Liquidators inherit risk and must maintain sufficient collateral to take on positions.

Step 1: Understand liquidation mechanics

Liquidations transfer liability from the liquidated account to the liquidator. For protocol details, see:

Step 2: Choose a reference implementation

The canonical bot lives in keeper-bots-v2:

  • src/bots/liquidator.ts
  • src/bots/liquidatorDerisk.ts (derisk helper)

Step 3: Prepare the environment

Follow the keeper bots setup and initialize a user account:

Liquidator bots require collateral. Make sure the wallet is funded and has USDC deposited.

Step 4: Run and tune

Once configured, run the bot via the keeper-bots-v2 config file and monitor for:

  • RPC latency / timeouts
  • competing liquidators
  • position risk and exposure

Step 5: Iterate and harden

Common improvements include:

  • filtering markets or subaccounts
  • using derisk strategies
  • adding guardrails for exposure and max size
Last updated on