Skip to content
Alchemy Logo

userFills stream

Beta

HyperCore APIs are in beta. Message fields, limits, and behavior may change, including breaking changes. To request access, contact [email protected].

Fills for one or more wallet addresses.

{
  "method": "subscribe",
  "subscriptionId": "wallets_01",
  "subscription": {
    "type": "userFills",
    "users": [
      "0x654086857e1fad6dcf05cf6695cce51ea3984268"
    ]
  }
}

ParameterTypeRequiredDescription
usersstring[]YesWallet addresses. Case-insensitive; returned lowercase. 1 to 200 addresses; split larger sets across subscriptions.
fromBlockintegerNoReplay from this block (inclusive), then continue live. Omit for live only.
aggregateByTimebooleanNoMerge a taker order's partial fills in the same block. Default false.

The user in each [user, fill] pair is the subscribed address the fill belongs to.

{
  "channel": "subscriptionResponse",
  "subscriptionId": "wallets_01",
  "data": {
    "type": "userFills",
    "users": [
      "0x654086857e1fad6dcf05cf6695cce51ea3984268"
    ]
  }
}

Each message carries the fills from one block.

{
  "seq": 1,
  "channel": "userFills",
  "subscriptionId": "wallets_01",
  "data": {
    "blockNumber": 1183759646,
    "blockTime": 1791999593756,
    "fills": [
      [
        "0x654086857e1fad6dcf05cf6695cce51ea3984268",
        {
          "coin": "BTC",
          "px": "81772.0",
          "sz": "0.00067",
          "side": "B",
          "time": 1791999593756,
          "startPosition": "-0.37115",
          "dir": "Close Short",
          "closedPnl": "0.012",
          "hash": "0x5a1e...",
          "oid": 574446008493,
          "crossed": true,
          "fee": "0.0246",
          "tid": 87654321,
          "feeToken": "USDC",
          "twapId": null
        }
      ]
    ]
  }
}
FieldDescription
data.blockNumberBlock the fills came from. Persist it to resume.
data.blockTimeBlock time, Unix milliseconds.
data.fillsArray of [user, fill] pairs.

FieldTypeDescription
coinstringMarket. See coin names.
pxstringExecution price.
szstringExecuted size.
sidestringB (buy) or A (sell), for this user.
timeintegerFill time, Unix milliseconds.
startPositionstringPosition size before the fill.
dirstringDisplay direction, for example Open Long or Close Short.
closedPnlstringRealized profit or loss from this fill.
hashstringTransaction hash.
oidintegerID of the order that filled.
crossedbooleantrue if this side was the taker.
feestringFee paid; negative for a rebate.
tidintegerTrade ID. Both sides of a trade share the same tid.
feeTokenstringToken the fee was paid in.
twapIdinteger or nullTWAP order ID, if the fill came from a TWAP.
liquidationobjectPresent on liquidation fills: liquidatedUser, markPx, method.
builderstringPresent when the order used a builder code.

Fill objects follow Hyperliquid's native fill format, so conditional fields such as builderFee, deployerFee, priorityGas, and cloid can also appear. Ignore fields you don't use.

aggregateByTime (default false) merges a taker order's partial fills within the same block into one record: sz, fee, closedPnl, and, when present, builderFee, deployerFee, and priorityGas are summed, and px is the size-weighted average price, which isn't rounded to the tick size. Other fields, including tid, hash, and startPosition, come from the first partial fill. Maker fills are never merged.

Pass fromBlock to replay from a recent block, inclusive. After a disconnect, resubscribe with fromBlock set to the last processed blockNumber plus one and deduplicate on tid plus user. If the block is older than the replay window, you receive a gap message for the missing range, then data from the oldest available block. See replay and recovery.

{"method":"unsubscribe","subscriptionId":"wallets_01"}
Was this page helpful?