> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 120+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> Every page on this site is available as Markdown by appending .md to its URL.

# Hyperliquid fills portal stream

> API reference for hyperliquidFillsPortalStream().

`hyperliquidFillsPortalStream()` reads trade-fill blocks from SQD Portal and applies one or more query outputs.

```ts theme={"system"}
import {
  hyperliquidFillsPortalStream,
  hyperliquidFillsQuery,
} from '@subsquid/pipes/hyperliquid'

const stream = hyperliquidFillsPortalStream({
  id: 'btc-fills',
  portal: {
    url: 'https://portal.sqd.dev/datasets/hyperliquid-fills',
    finalized: true,
  },
  outputs: hyperliquidFillsQuery()
    .addFields({ block: { number: true }, fill: { coin: true, px: true, sz: true } })
    .addFillRequest({ range: { from: 'latest' }, request: { coin: ['BTC'] } }),
})
```

## Options

| Option | Required | Description |
| - | - | - |
| `id` | Yes | Stable, non-empty pipe identifier. Targets use it as the default cursor key. |
| `portal` | Yes | Dataset URL or a `PortalClientOptions` object. |
| `outputs` | Yes | A `HyperliquidFillsQueryBuilder`, transformer, or record of named outputs. |
| `cache` | No | Portal response cache. |
| `logger` | No | Pino-compatible logger, log level, `false`, or `null`. |
| `metrics` | No | Metrics server instance. |
| `profiler` | No | `boolean` or profiler span hooks. |
| `progress` | No | Progress callbacks and reporting interval. |

When `portal` is an object, it accepts `url`, `finalized`, `http`, `maxBytes`, `maxIdleTimeMs`, `maxWaitTimeMs`, and `headPollIntervalMs`.

Use `for await` to consume batches, `.pipe()` to add a whole-stream transformer, or `.pipeTo()` to connect a target.

<Warning>
  The fills dataset currently uses all-zero block hashes. Set `finalized: true` for persistent targets.
</Warning>

See the [query builder reference](./query-builder) for typed fields and filters.


## Related topics

- [Hyperliquid fills quickstart](/en/sdk/pipes-sdk/hyperliquid/quickstart.md)
- [Hyperliquid fills query builder](/en/sdk/pipes-sdk/hyperliquid/reference/basic-components/query-builder.md)
- [Hyperliquid Data API: Fills and Trades](/en/portal/hyperliquid/overview.md)
- [Handling Hyperliquid fills](/en/sdk/pipes-sdk/hyperliquid/guides/basic-development/handling-fills.md)
- [Hyperliquid](/en/data/hyperliquid/hyperliquid-fills.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.