The Jupiter Developer Platform is live. Previous portal users keep their rate limits for free until 30 June 2026 — set up billing on the new platform before then. See the Migration Guide for details.
Use this file to discover all available pages before exploring further.
Liquidate a position that has exceeded the protocol’s liquidation threshold. You pay the borrow token (or absorb) and receive collateral. The SDK returns instructions that use address lookup tables; the transaction is built as a versioned (v0) transaction.
Import web3.js for connection and versioned transactions, the borrow SDK, and BN for the debt amount.
import { Connection, Keypair, TransactionMessage, VersionedTransaction,} from "@solana/web3.js";import BN from "bn.js";import { getLiquidateIx } from "@jup-ag/lend/borrow";import fs from "fs";import path from "path";
getLiquidateIx returns instructions and address lookup table accounts. Optional params: colPerUnitDebt, absorb, to (recipient of collateral).
2
Load keypair and set parameters
Load the signer and create the connection. Set the vault and the amount of debt to liquidate.
Only positions that are liquidatable (e.g. LTV above threshold) can be liquidated. The liquidator typically receives collateral; ensure you have the borrow token to pay the debt if required by the vault.
3
Build liquidate instructions
Get the liquidate instructions and address lookup table accounts.
const { ixs, addressLookupTableAccounts } = await getLiquidateIx({ vaultId: VAULT_ID, debtAmount: DEBT_AMOUNT, connection, signer,});if (!ixs?.length) { throw new Error("No liquidate instructions returned by Jupiter Lend SDK.");}
You can pass optional to (PublicKey) for the collateral recipient, absorb (boolean), and colPerUnitDebt (BN) for pricing. Omit them to use defaults (e.g. signer as recipient).
4
Build versioned transaction and send
Build the v0 message with instructions and lookup tables, sign, send, and confirm.
Liquidation improves protocol health by closing underwater positions. The liquidator is incentivized with a discount on collateral or similar mechanism per vault design.
When can a position be liquidated?
When the position’s loan-to-value (LTV) or health factor crosses the vault’s liquidation threshold. The exact rules and incentives are vault-specific.
Liquidator flow
As liquidator you typically supply the borrow token (or use absorb) and receive collateral. Check the vault’s liquidation docs for exact parameters and rewards.