Skip to main content
POST
/
lending-stocks
/
api
/
liquidations
/
{marketId}
/
liquidate
/
{loanId}
curl -X POST "https://api.trusset.org/lending-stocks/api/liquidations/{marketId}/liquidate/7" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"autoSell": true}'
{
  "success": true,
  "data": {
    "loanId": 7,
    "liquidationId": "4",
    "auctionId": null,
    "txHash": "0xabc...def",
    "collateralSeized": "50.000000000000000000",
    "debtRepaid": "4272.500000",
    "orchestratorResult": {
      "success": true,
      "status": "FULLY_SOLD",
      "tradesExecuted": 2
    },
    "orchestratorError": null
  }
}
Triggers liquidation of an unhealthy loan. The oracle is updated automatically if stale. Depending on market configuration, this creates either an instant liquidation (collateral sent to the router) or a Dutch auction. When autoSell is true (default), the orchestrator attempts to sell the seized collateral through the configured order book and settle proceeds back to the lending pool.
This is a write operation. Requires LIQUIDATOR_ROLE granted to the relayer on the market contract.

Path Parameters

marketId
string
required
Market ID.
loanId
integer
required
On-chain loan ID.

Body Parameters

autoSell
boolean
default:"true"
Whether to automatically route seized collateral through the order book.
curl -X POST "https://api.trusset.org/lending-stocks/api/liquidations/{marketId}/liquidate/7" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"autoSell": true}'
{
  "success": true,
  "data": {
    "loanId": 7,
    "liquidationId": "4",
    "auctionId": null,
    "txHash": "0xabc...def",
    "collateralSeized": "50.000000000000000000",
    "debtRepaid": "4272.500000",
    "orchestratorResult": {
      "success": true,
      "status": "FULLY_SOLD",
      "tradesExecuted": 2
    },
    "orchestratorError": null
  }
}