Skip to main content

Get Liquidations

Query historical liquidation events from DeepBook Margin. This endpoint returns detailed information about liquidated positions including amounts, rewards, and remaining assets. Use it for liquidation monitoring, analytics, and building liquidation bots.

Endpoints

There are two endpoints for querying liquidations:

By Owner

GET /deepbook-margin/liquidations/{owner}

Returns liquidation events for all margin managers owned by a specific address.

General Query

GET /deepbook-margin/liquidations

Returns liquidation events with optional filters.

Use Cases

  • Liquidation History — Show users their liquidation history
  • Liquidation Bot Analytics — Track liquidation opportunities and rewards earned
  • Risk Analysis — Analyze liquidation patterns and risk factors
  • Market Monitoring — Monitor overall liquidation activity in the protocol
  • MEV Research — Study liquidation execution patterns

Parameters

Path Parameters (By Owner endpoint)

ParameterTypeRequiredDescription
ownerstringYesOwner wallet address (liquidated positions)

Query Parameters

ParameterTypeRequiredDefaultDescription
pagenumberNo0Page number (starts from 0)
perPagenumberNo10Items per page (max 50)
marginManagerIdstringNoFilter by margin manager ID
marginPoolIdstringNoFilter by margin pool ID
balanceManagerIdstringNoFilter by balance manager ID
fromCheckpointnumberNoStart checkpoint (inclusive)
toCheckpointnumberNoEnd checkpoint (inclusive)
api-keystringYesYour Surflux API key

Response

Returns a paginated response with liquidation event objects.

Pagination Fields

FieldTypeDescription
itemsarrayArray of liquidation objects
isLastPagebooleanWhether this is the last page
currentPagenumberCurrent page number
perPagenumberItems per page

Liquidation Fields

FieldTypeDescription
event_digeststringUnique event identifier
digeststringTransaction digest
senderstringLiquidator address
checkpointnumberCheckpoint when liquidation occurred
timestampstringISO timestamp
checkpoint_timestamp_msnumberTimestamp in milliseconds
margin_manager_idstringLiquidated margin manager
margin_pool_idstringMargin pool the debt was in
liquidation_amountnumberAmount of debt liquidated
pool_rewardnumberReward retained by the pool
pool_defaultnumberBad debt absorbed by the pool
risk_rationumberRisk ratio at time of liquidation
remaining_base_assetnumberRemaining base asset after liquidation
remaining_quote_assetnumberRemaining quote asset after liquidation
remaining_base_debtnumberRemaining base debt after liquidation
remaining_quote_debtnumberRemaining quote debt after liquidation
base_pyth_pricenumberPyth oracle price for base asset
base_pyth_decimalsnumberDecimals for base Pyth price
quote_pyth_pricenumberPyth oracle price for quote asset
quote_pyth_decimalsnumberDecimals for quote Pyth price
onchain_timestampnumberOn-chain timestamp in milliseconds
margin_managerobject | nullAssociated margin manager details