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

> Stream Hyperliquid trade fills with Pipes SDK.

Pipes SDK streams Hyperliquid trade executions from the `hyperliquid-fills` Portal dataset. The dataset is real-time and starts at block 750,000,000.

<Info>
  This source covers HyperCore fills. HyperEVM uses the standard [EVM Pipes SDK](/en/sdk/pipes-sdk/evm/quickstart) with the [`hyperliquid-mainnet`](/en/data/evm/hyperevm-mainnet) or [`hyperliquid-testnet`](/en/data/evm/hyperevm-testnet) dataset.
</Info>

<Note>
  The Pipes CLI currently scaffolds EVM and SVM projects only. Set up Hyperliquid and Tron pipes manually as shown here.
</Note>

## Create the project

Node.js 22.15 or later is required.

```bash theme={"system"}
mkdir hyperliquid-pipe && cd hyperliquid-pipe
npm init -y
npm pkg set type=module
npm install @subsquid/pipes@beta tsx
```

Create `index.ts`:

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

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

for await (const { data } of stream) {
  for (const block of data) {
    for (const fill of block.fills) {
      console.log(block.header.number, fill)
    }
  }
}
```

Run it:

```bash theme={"system"}
npx tsx index.ts
```

<Warning>
  The fills dataset currently exposes zero-filled block hashes. Use `portal: { url, finalized: true }` with persistent targets so recovery does not depend on distinguishing forks by block hash.
</Warning>

## Next steps

* [Handle fills](./guides/basic-development/handling-fills) for trade-side, volume, and deduplication semantics.
* [Query builder reference](./reference/basic-components/query-builder) for every field and filter.
* Use the shared [Postgres](../evm/reference/basic-components/target/postgres-drizzle), [ClickHouse](../evm/reference/basic-components/target/clickhouse), [BigQuery](../evm/reference/basic-components/target/bigquery), or [Parquet](../evm/reference/basic-components/target/parquet) target APIs to persist the stream.


## Related topics

- [Handling Hyperliquid fills](/en/sdk/pipes-sdk/hyperliquid/guides/basic-development/handling-fills.md)
- [Hyperliquid fills query builder](/en/sdk/pipes-sdk/hyperliquid/reference/basic-components/query-builder.md)
- [Hyperliquid fills portal stream](/en/sdk/pipes-sdk/hyperliquid/reference/basic-components/source.md)
- [Hyperliquid](/en/data/hyperliquid/hyperliquid-fills.md)
- [Pipes SDK 1.0](/announcements/pipes-sdk-1-0.md)
