---
title: Quickstart
description: Fetch the current funding rate for every Hyperliquid perp and rank the top 10 by annualized rate.
url: https://hl-funding.thally.app/quickstart
lastUpdated: 2026-12-04
last_updated: 2026-12-04
last_updated_source: git
lastVerified: 2026-12-04T00:00:00.000Z
---

# Quickstart

Fetch the current funding rate for every Hyperliquid perp and rank the top 10 by annualized rate.

## What you'll achieve

In about five minutes you will:

- Make your first request to the Hyperliquid Info API.
- Read one market's funding rate and convert it to a yearly rate.
- Run a short script that ranks every liquid perp market by annualized funding.

## Tools you'll use

- **[Hyperliquid Info API](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint)**: the public endpoint that serves
  market data. No account, API key, or wallet needed.
- **[curl](https://curl.se/docs/manpage.html)**: sends the first requests from
  your terminal.
- **[jq](https://jqlang.org/manual/)** (optional): makes the JSON readable.
  Install with `brew install jq` or `sudo apt install jq`.
- **[Node.js](https://nodejs.org/en/download) 18 or later**: runs the script in
  step 3, using its built-in [`fetch`](https://nodejs.org/api/globals.html#fetch).
  Check with `node --version`.

## Fetch and rank funding rates

#### Make your first request

    Every Info API call is a `POST` to the same URL. The `type` field in the
    body picks the data. `metaAndAssetCtxs` returns all perp markets with their
    live state.

    ```bash
    curl -s https://api.hyperliquid.xyz/info \
      -H 'Content-Type: application/json' \
      -d '{"type": "metaAndAssetCtxs"}' | head -c 400
    ```

    The response is a two-element array. The first element holds market
    metadata (`universe`), the second holds live values. Index `i` in one
    matches index `i` in the other:

    ```json
    [
      { "universe": [ { "name": "BTC", "szDecimals": 5, "maxLeverage": 40, ... }, ... ] },
      [ { "funding": "0.0000125", "markPx": "51658.0", "openInterest": "43500.78", ... }, ... ]
    ]
    ```

#### Read one market's funding rate

    Pair the two arrays and select ETH with `jq`:

    ```bash
    curl -s https://api.hyperliquid.xyz/info \
      -H 'Content-Type: application/json' \
      -d '{"type": "metaAndAssetCtxs"}' \
    | jq '[.[0].universe, .[1]] | transpose
          | map(select(.[0].name == "ETH"))[0]
          | {coin: .[0].name, funding: .[1].funding, markPx: .[1].markPx, openInterest: .[1].openInterest}'
    ```

    You should see something like this (your values will differ):

    ```json
    {
      "coin": "ETH",
      "funding": "0.0000125",
      "markPx": "1565.5",
      "openInterest": "792867.9677999998"
    }
    ```

    `funding` is the market's current hourly funding rate as a decimal:
    0.0000125 is 0.00125% per hour, or about 10.95% a year. See
    [which rate to use](/introduction#current-predicted-and-settled-rates)
    for how it relates to the other funding endpoints. `openInterest` is in coins, not dollars.

#### Rank every market by annualized funding

    Save this as `top-funding.mjs`. It ranks listed markets with at least
    $1M of open interest by annualized funding and prints the top 10.

    ```js title="top-funding.mjs"
    const API_URL = 'https://api.hyperliquid.xyz/info';
    const MIN_OPEN_INTEREST_USD = 1_000_000; // skip thin markets where funding is noisy

    const res = await fetch(API_URL, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ type: 'metaAndAssetCtxs' }),
    });
    if (!res.ok) {
      throw new Error(`Hyperliquid API returned ${res.status}: ${await res.text()}`);
    }

    // [meta, assetContexts]: meta.universe[i] and assetCtxs[i] are the same market.
    const [meta, assetCtxs] = await res.json();

    const rows = meta.universe
      .map((asset, i) => {
        const ctx = assetCtxs[i];
        const hourly = Number(ctx.funding); // decimal rate paid every hour
        return {
          coin: asset.name,
          delisted: asset.isDelisted === true,
          hourlyPct: hourly * 100,
          aprPct: hourly * 24 * 365 * 100,
          openInterestUsd: Number(ctx.openInterest) * Number(ctx.markPx),
        };
      })
      .filter((r) => !r.delisted && r.openInterestUsd >= MIN_OPEN_INTEREST_USD)
      .sort((a, b) => b.aprPct - a.aprPct || b.openInterestUsd - a.openInterestUsd) // ties: larger market first
      .slice(0, 10);

    console.table(
      rows.map((r) => ({
        coin: r.coin,
        'hourly %': r.hourlyPct.toFixed(5),
        'APR %': r.aprPct.toFixed(2),
        'open interest ($M)': (r.openInterestUsd / 1e6).toFixed(1),
      })),
    );
    ```

    Run it:

    ```bash
    node top-funding.mjs
    ```

#### Verify the result

    You should see a table with 10 rows, sorted by `APR %`, highest first.
    Your coins and numbers will differ. This is real output, trimmed to four rows:

    ```text
    ┌─────────┬────────┬───────────┬──────────┬────────────────────┐
    │ (index) │ coin   │ hourly %  │ APR %    │ open interest ($M) │
    ├─────────┼────────┼───────────┼──────────┼────────────────────┤
    │ 0       │ 'XTEN' │ '0.05989' │ '524.66' │ '6.4'              │
    │ 1       │ 'BTC'  │ '0.00125' │ '10.95'  │ '2420.6'           │
    │ 2       │ 'ETH'  │ '0.00125' │ '10.95'  │ '1291.3'           │
    │ 3       │ 'HYPE' │ '0.00125' │ '10.95'  │ '1175.9'           │
    └─────────┴────────┴───────────┴──────────┴────────────────────┘
    ```

    An outlier with a very high APR is normal: a small, one-sided market can
    pay more than 1% a day (0.05989% an hour is about 1.4% a day). Rows at
    exactly `10.95` are markets paying only the base interest rate, described
    in the [introduction](/introduction#read-a-funding-rate-correctly-units-and-who-pays).
    Ties are ordered by open interest, so the largest markets come first.

## If something goes wrong

#### 415: Expected request with `Content-Type: application/json`

    The API rejects bodies without a JSON content type. Add
    `-H 'Content-Type: application/json'` to `curl`, or the `headers` option to `fetch`.

#### `fetch is not defined` or `await is only valid in async functions`

    You are on Node.js 16 or older, or the file ends in `.js` inside a CommonJS
    project. Upgrade to Node.js 18+ and keep the `.mjs` extension so top-level
    `await` works.

#### The table is empty

    Lower `MIN_OPEN_INTEREST_USD`. If it is still empty, print `meta.universe.length`
    to confirm the request returned markets.

## Next step

Current rates tell you where funding is now. To know whether a rate is
unusual, you need history. [Build a funding monitor](/guides/funding-monitor)
next.