Live on HyperEVM

HYPx402

Pay-per-request Hyperliquid trading data for AI agents and bots.
USDC payments via x402 on HyperEVM. No accounts. No API keys.

https://hypx402resource-server-production.up.railway.app

How it works

Two services. The resource server serves trading data behind a paywall. The facilitator verifies EIP-3009 payment signatures and settles USDC transfers on-chain. Your agent never pays gas.

Resource Server

Express API with x402 payment middleware. Returns 402 Payment Required with signing instructions. On valid payment, serves real-time Hyperliquid data.

Facilitator

Verifies EIP-3009 transferWithAuthorization signatures off-chain, then executes the USDC transfer on HyperEVM. Pays all gas.

Agent → 402 → Sign USDC auth Retry with payment Data ✓

API Reference

Endpoint Description Parameters Price
GET /mids Mid prices for all Hyperliquid perpetuals $0.001USDC
GET /orderbook L2 orderbook with bids and asks ?coin=ETH $0.001USDC
GET /funding Predicted & historical funding rates ?coin=ETH &hours=24 $0.005USDC
GET /liquidations Liquidation risk across all markets $0.005USDC
GET /portfolio Full portfolio: margins, positions, orders ?user=0x... $0.01USDC

How to use

1Install dependencies

shell
npm install @x402/core @x402/evm viem

2Setup client & helper

One-time setup. Your wallet needs USDC on HyperEVM — no HYPE needed.

typescript
import { createPublicClient, http, defineChain } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { x402Client } from "@x402/core/client";
import { decodePaymentRequiredHeader, encodePaymentSignatureHeader } from "@x402/core/http";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { toClientEvmSigner } from "@x402/evm";

const hyperEVM = defineChain({
  id: 999, name: "HyperEVM",
  nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
  rpcUrls: { default: { http: ["https://rpc.hyperliquid.xyz/evm"] } },
});

const account = privateKeyToAccount("0xYOUR_PRIVATE_KEY");
const signer = toClientEvmSigner(account, createPublicClient({ chain: hyperEVM, transport: http() }));
const client = new x402Client().register("eip155:999", new ExactEvmScheme(signer));

const API = "https://hypx402resource-server-production.up.railway.app";

async function fetchPaid(path: string) {
  const url = API + path;
  let res = await fetch(url);
  if (res.status === 402) {
    const req = decodePaymentRequiredHeader(res.headers.get("PAYMENT-REQUIRED")!);
    const payload = await client.createPaymentPayload(req);
    res = await fetch(url, {
      headers: { "PAYMENT-SIGNATURE": encodePaymentSignatureHeader(payload) },
    });
  }
  return res.json();
}

3Fetch data — one line each

typescript
const mids    = await fetchPaid("/mids");                    // $0.001
const book    = await fetchPaid("/orderbook?coin=ETH");      // $0.001
const funding = await fetchPaid("/funding?coin=ETH");       // $0.005
const liq     = await fetchPaid("/liquidations");             // $0.005
const port    = await fetchPaid("/portfolio?user=0x...");     // $0.01

HyperEVM Details

Chain ID
999
CAIP-2
eip155:999
Gas Token
HYPE
RPC
rpc.hyperliquid.xyz/evm
USDC Contract
0xb88339cb7199b77e23db6e890353e22632ba630f
Payment Protocol
x402 / EIP-3009

Agent wallets only need USDC — the facilitator pays all gas on HyperEVM. The USDC contract is Circle's FiatTokenV2_2 with native EIP-3009 support. EIP-712 domain: name "USDC", version "2".