> ## 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.

# 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)
- [Handling Hyperliquid fills](/en/sdk/pipes-sdk/hyperliquid/guides/basic-development/handling-fills.md)
- [Hyperliquid Portal API](/en/portal/hyperliquid/overview.md)
- [Hyperliquid](/en/data/hyperliquid/hyperliquid-fills.md)
