userFills
Endpoint
WebSocket /ws
Selector: subscription.type: "userFills"
Purpose
Returns an initial snapshot of retained customer fills, then messages containing newly observed fill IDs. It does not expose fills belonging to unrelated customers.
Authorization
Owner or approved reader for subscription.user. The SDK signs requests. Current permissions are checked before delivery; expiry or revocation stops access.
Request fields
| Field | Type | Required | Meaning |
|---|---|---|---|
method | String | Yes | "subscribe". |
auth | Object | Yes | Request proof with timestamp, nonce and signature; see authorization. |
subscription | Object | Yes | Subscription definition. |
subscription.type | String | Yes | "userFills". |
subscription.user | Address | Yes | Customer account authorized by the request signer. |
subscription.aggregateByTime | Boolean | No | Omit or use false. true is unsupported. |
Request example
Test fixture. Generate a fresh proof before use. Fixture inputs.
{
"method": "subscribe",
"subscription": {
"type": "userFills",
"user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf",
"aggregateByTime": false
},
"auth": {
"timestamp": 1796250000000,
"nonce": "0x0404040404040404040404040404040404040404040404040404040404040404",
"signature": "0x76a6ef4c8c20a13f71da130fe164337800308d6ccc7eaa44b9ebfbdc9b17df3c76993f0234b1c81bdba5aa3d665a6690f56ab785660dcb037adf05ac72f383b81b"
}
}Response fields
First receive a subscribe acknowledgement, then data:
| Field | Meaning |
|---|---|
channel | "userFills". |
data | Customer fill snapshot or update. |
data.isSnapshot | true for the first data message, including an empty snapshot; false for subsequent messages. |
data.user | Selected customer account address. |
data.fills | Retained fills in the initial snapshot, or newly observed fills in subsequent messages. |
Each fill contains:
| Fields | Meaning |
|---|---|
coin, side, px, sz | Market, buy/sell side and decimal-string execution price/size. |
time, tid, hash, oid | Millisecond execution time, fill trade ID, fill hash and order ID. |
startPosition, dir, closedPnl | Position before the fill, its effect and realized PnL. |
crossed | Whether the fill crossed the book. |
fee, feeToken | Decimal-string fee and its token ("USDC"). |
Response example
{
"channel": "userFills",
"data": {
"isSnapshot": true,
"user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf",
"fills": []
}
}Constraints
- An unchanged fill set produces no new message.
- The snapshot contains at most 2,000 retained fills; it is not an unlimited archive or a guarantee that every missed update can be replayed.
- Reconnect recovery uses fresh signed subscriptions and signed
/inforeconciliation. - Duplicate requests acknowledge the existing subscription without another snapshot.
unsubscribe stops this subscription. WebSocket overview covers connection limits and ongoing permissions.