Quick Start

Get started with the SDK in just a few lines of code.

1

Set up Transport

First, create a Transport — the layer that handles communication with Hyperliquid servers.

Use HttpTransport for simple requests.

import { HttpTransport } from "@nktkas/hyperliquid";

const transport = new HttpTransport();
2

Create a Client

Next, create a Client with your transport. The SDK provides three clients for different purposes:

Use InfoClient to query market data, account state, and other read-only information.

import { HttpTransport, InfoClient } from "@nktkas/hyperliquid";

const transport = new HttpTransport();

const client = new InfoClient({ transport });

// Get mid prices for all assets
const mids = await client.allMids();
// => { "BTC": "97000.5", "ETH": "3500.25", ... }

Last updated