# GET /perps/funding: $0.003 per call

Perpetual futures funding rates from Hyperliquid and dYdX: the current hourly rate, 8-hour and annualised equivalents, premium, mark and oracle price and open interest per market, plus up to 7 days of hourly funding history and averages for one coin. Pass ?coin=BTC&hours=24 (&venue=dydx), or no coin for the top markets by open interest.

- **Price:** $0.003 in USDC, the same on Base, Solana, Polygon, Arbitrum. Failed calls are never charged.
- **Free trial:** yes, 20 free calls a day from Claude, Cursor or any MCP client ([set-up](/mcp/setup)).
- **Answers cached for:** 1 min
- **Data sources:** Hyperliquid public info API; dYdX v4 public indexer
- **Lane:** Perpetual futures data ([OpenAPI](/openapi/perps.json))
- **Live health:** [status page](/status)

## Free sample

See an answer for the demo input first, free (no payment, 10 a minute): [https://aayatai.com/sample/perps-funding](/sample/perps-funding). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

```bash
curl "https://aayatai.com/sample/perps-funding"
```

## 1. See the price (free)

Call it without paying: you get `402 Payment Required` and a `PAYMENT-REQUIRED` header with the exact price and where to pay.

```bash
curl -i "https://aayatai.com/perps/funding?coin=BTC&hours=24&limit=20"
```

## 2. Pay and call (TypeScript)

```bash
npm install @x402/fetch @x402/evm viem
```

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet used only by your agent, holding a little USDC on Base.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await pay("https://aayatai.com/perps/funding?coin=BTC&hours=24&limit=20");
console.log(await res.json());
```

## 3. Or as an MCP tool

```ts
// MCP server: https://aayatai.com/mcp (Streamable HTTP). With the x402 MCP client (see /start):
const result = await client.callTool("perps-funding", {"coin":"BTC","hours":24,"limit":20});
```

## Inputs

- `coin` (string): Market symbol, e.g. BTC, ETH, SOL. Leave out for the top markets by open interest.
- `hours` (integer; default `24`): With coin: hours of hourly funding history to include (0-168).
- `limit` (integer; default `20`): Without coin: how many markets to list, largest open interest first (1-100).
- `venue` (string; one of `auto`, `hyperliquid`, `dydx`; default `auto`): auto (default: Hyperliquid, or dYdX while Hyperliquid is unavailable), hyperliquid or dydx.
- `detail` (string; one of `full`, `brief`; default `full`): brief = key fields only (same price)

Bad inputs are rejected with HTTP 400 before any payment is asked for.

## Example answer

Example only: the shape of an answer, with placeholder addresses and made-up figures. It is not data about any real token or wallet; call the service (or its free sample) for real results.

```json
{
  "venue": "hyperliquid",
  "fundingIntervalHours": 1,
  "asOf": "2026-09-29T18:23:33.070Z",
  "markets": [
    {
      "coin": "BTC",
      "fundingRate": 0.0000125,
      "fundingRate8h": 0.0001,
      "fundingAprPct": 10.95,
      "premium": -0.0003308178,
      "markPx": 83401,
      "oraclePx": 83429.6,
      "openInterest": 35716.10368,
      "openInterestUsd": 2978758763,
      "maxLeverage": 40
    }
  ],
  "history": [
    {
      "time": "2026-09-29T16:00:00.055Z",
      "fundingRate": 0.0000125,
      "premium": -0.0003537751
    },
    {
      "time": "2026-09-29T17:00:00.021Z",
      "fundingRate": 0.0000125,
      "premium": -0.0002522556
    },
    {
      "time": "2026-09-29T18:00:00.018Z",
      "fundingRate": 0.0000125,
      "premium": -0.0003137224
    }
  ],
  "summary": {
    "hours": 24,
    "points": 24,
    "avgFundingRate": 0.0000059528,
    "avgFundingAprPct": 5.21,
    "minFundingRate": -0.0000081007,
    "maxFundingRate": 0.0000125,
    "positiveHours": 19,
    "negativeHours": 5
  },
  "attribution": "Data from Hyperliquid's public info API (api.hyperliquid.xyz)."
}
```

## Related

- [GET /perps/open-interest](/services/perps-open-interest) ($0.002): Open interest on Hyperliquid or dYdX perpetual futures: contracts and USD value per market, share of the venue total, 24h volume, volume/OI, 24h price change an

New here? [Getting started in 60 seconds](/start). All services: [Aayat AI](/).