Skip to main content
POST
/
finalized-stream
Query BTC Fills
curl --compressed -X POST 'https://portal.sqd.dev/datasets/hyperliquid-fills/finalized-stream' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "hyperliquidFills",
    "fromBlock": 900000000,
    "toBlock": 900000100,
    "fields": {
      "block": {
        "number": true,
        "timestamp": true
      },
      "fill": {
        "user": true,
        "coin": true,
        "px": true,
        "sz": true,
        "side": true,
        "dir": true,
        "fee": true
      }
    },
    "fills": [{
      "coin": ["BTC"]
    }]
  }'
[
  {
    "header": {
      "number": 123,
      "hash": "<string>",
      "parentHash": "<string>",
      "timestamp": 123
    },
    "fills": [
      {
        "fillIndex": 123,
        "user": "<string>",
        "coin": "<string>",
        "px": "<string>",
        "sz": "<string>",
        "side": "A",
        "time": 123,
        "startPosition": "<string>",
        "dir": "<string>",
        "closedPnl": "<string>",
        "hash": "<string>",
        "oid": 123,
        "crossed": true,
        "fee": "<string>",
        "builderFee": "<string>",
        "tid": 123,
        "cloid": "<string>",
        "feeToken": "<string>",
        "builder": "<string>",
        "twapId": 123
      }
    ]
  }
]

Body

application/json

Data query to filter and retrieve finalized blocks

type
enum<string>
default:hyperliquidFills
required

The type of data (fixed to hyperliquidFills for this API).

Available options:
hyperliquidFills
fromBlock
integer<int64>
required

The block number to start fetching from (inclusive).

toBlock
integer<int64>

The block number to fetch up to (inclusive). Optional; if omitted, streams until dataset height or timeout.

parentBlockHash
string

Expected hash of the parent of the first requested block.

includeAllBlocks
boolean
default:false

If true, includes blocks with no matching data in the response.

fields
object

Field selector for data items to retrieve.

fills
object[]

Fill data requests. An empty object matches all fills; an empty array matches no fills.

Response

A stream of finalized blocks in JSON lines format, optionally gzipped. Can be empty if the data query has a bounded range and all blocks in the range have been skipped.

header
object
required

Block header data. Fields are conditionally returned based on the fields.block parameter in the request. Only requested fields will be included in the response.

fills
object[]

Trade fill records contained in this block. Fields are conditionally returned based on the fields.fill parameter in the request.