01The endpoint#
Hyperliquid's info API is a single POST endpoint: https://api.hyperliquid.xyz/info. The request body's type selects the query. Two queries return fills:
| type | Body | Returns |
|---|---|---|
userFills | { "type": "userFills", "user": "0x…" } | The account's most recent fills (up to 2,000). |
userFillsByTime | { "type": "userFillsByTime", "user": "0x…", "startTime": ms, "endTime": ms } | Fills in a time range; use it for a cover's active period. endTime is optional. |
02Check a wallet's liquidations#
# All liquidation fills of a wallet in the last 7 days
START=$(( ($(date +%s) - 7*86400) * 1000 ))
curl -s https://api.hyperliquid.xyz/info \
-H 'Content-Type: application/json' \
-d "{\"type\":\"userFillsByTime\",\"user\":\"0xYOUR_WALLET\",\"startTime\":$START}" \
| jq '[.[] | select(.liquidation != null)
| {time, coin, dir, px, sz, startPosition, hash, tid, liquidation}]'
# Find the fill a proof points at (fillHash + tid from the ProofPosted event)
curl -s https://api.hyperliquid.xyz/info \
-H 'Content-Type: application/json' \
-d '{"type":"userFills","user":"0xYOUR_WALLET"}' \
| jq '.[] | select(.hash == "0xPROOF_HASH" and .tid == PROOF_TID)'
03Reading a liquidation fill#
A liquidation fill looks like any other fill with one extra object. The shape (values elided):
{
"coin": "ETH",
"px": "…", // fill price
"sz": "…", // coins filled
"side": "A", // A = sell, B = buy
"time": 1700000000000, // ms epoch
"startPosition": "…", // signed size before this fill
"dir": "Liquidated Isolated Long",
"closedPnl": "…",
"hash": "0x…",
"oid": 0,
"crossed": true,
"fee": "…",
"tid": 0, // trade id
"feeToken": "USDC",
"liquidation": {
"liquidatedUser": "0x…", // the account that was liquidated
"markPx": "…", // mark price that triggered it
"method": "market" // "market" or "backstop"
}
}
- liquidation.liquidatedUser
- The account that was liquidated. Must equal the cover's holder. Present on the liquidated user's own fills and on the liquidator's side of backstop fills.
- liquidation.markPx
- The mark price at which the liquidation triggered.
- liquidation.method
market: the position was closed against the order book.backstop: it was transferred to the HLP liquidator account.- dir
Liquidated Isolated Long,Liquidated Isolated Short,Liquidated Cross LongorLiquidated Cross Short. Gives margin type and side.- startPosition
- Signed size before the fill. Its absolute value is
sizeAtLiqin the proof.
04Backstop liquidations#
For backstop liquidations, the HLP liquidator account 0x2e3d94f0562703b25c83308a05046ddaf9a8dd14 takes over the position. Its fills also carry liquidation.liquidatedUser, so the same event can be cross-checked from either side:
curl -s https://api.hyperliquid.xyz/info \
-H 'Content-Type: application/json' \
-d '{"type":"userFills","user":"0x2e3d94f0562703b25c83308a05046ddaf9a8dd14"}' \
| jq '[.[] | select(.liquidation.liquidatedUser == "0xYOUR_WALLET")]'
05Verification checklist#
- Read the proof:
ClaimsOracle.proofs(coverId)or theProofPostedevent givesfillHash,tid,liqTime,sizeAtLiq. - The fill with that
hashandtidexists in the holder's fills and has aliquidationobject. liquidation.liquidatedUserequals the cover's holder (getCover(coverId).holder).coinand the side indirmatch the cover.time(÷ 1000) equalsliqTimeand lies between the cover'sstart(purchase + 15 min) andend.|startPosition|matchessizeAtLiq.
If any check fails, report it within the 60 min window. See Disputes.