Skip to main content
Trade lets your users trade every market type through one interface. Perps are live today through the Perps API. Spot, tokenized stocks and prediction markets follow with the Trade API, which is the next version of the Perps API. The Perps API offers non-custodial perpetual futures on Hyperliquid, including markets that track stock prices. Users sign their own deposits and withdrawals. Orders are signed either by the user’s wallet or by an optional trading key that your app creates and holds, and that key can trade but cannot withdraw. Yield.xyz submits the signed orders to the venue, and your project can earn a builder fee of 0.01% to 0.1% on every fill once you configure one. The Trade API trades every market type with three calls: buy to go long or buy an asset, sell to go short or sell, and manage to close or adjust a position. Requests and responses look the same on every venue. Any setup step, such as funding an account or completing an issuer’s KYC, comes back as an action for the user to complete first. Yield.xyz builds every transaction, your user signs it, and the API submits and tracks it. The Trade API uses the same project API key as the Earn API, sent in the x-api-key header, and is served at https://trade.yield.xyz/v1 once live. For each market, the API returns the mark price, funding rate, open interest, volume and allowed leverage, along with price candles. For each user, it returns positions with PnL and liquidation price, open orders, balances and activity.
The Trade API is rolling out and is not live yet. Hyperliquid perps are live today through the Perps API at https://perps.yield.xyz/v1: see Perps API today. Endpoint and field names on these pages come from the Trade API design and can change before launch.

What you can trade

Each venue product is an integration with its own ID, such as hyperliquid-perps or dinari-spot. Coverage lists every integration and its status. Core concepts explains how each product type maps onto the same endpoints.
Perps trading carries jurisdictional restrictions. Read the perpetuals disclaimer before integrating.

How it works

  1. Pick an integration with GET /v1/integrations and a market with GET /v1/markets.
  2. Optionally call POST /v1/actions/buy/simulate to preview the price and see what the user still has to do first, such as funding or KYC.
  3. Request POST /v1/actions/buy, POST /v1/actions/sell or POST /v1/actions/manage. The response lists every transaction to sign.
  4. Sign each transaction in order and submit it with POST /v1/transactions/{transactionId}/submit.
  5. Poll GET /v1/actions/{actionId} until it finishes, then read GET /v1/positions, GET /v1/orders and GET /v1/balances.

What stays the same across venues

  • The simple request is the same everywhere. A market ID, an address and an amount give you a market-rate trade, whether the market is a perp, an outcome share or a stock.
  • Everything else is an optional argument. Limit price, leverage, margin mode, take profit, stop loss and slippage go in arguments, and each integration declares the ones it supports in a schema you read from the API.
  • Unsupported arguments are rejected. The error names the argument, and a limit order never quietly becomes a market order.
  • Prerequisites come back as pending actions. Funding, trading keys, approvals and KYC are returned as requests you can send as they are.
  • Yield.xyz never holds user funds or signing keys. Where a venue needs a delegated trading key, your client generates and holds it.
The API reference covers the live Perps API today. The Trade API reference is published with its OpenAPI spec at launch.

Next steps

Core concepts

Integrations, markets, buy, sell and manage, simulate, signing, statuses and portfolio reads.

Perps

Perps on Hyperliquid today, Lighter with the Trade API, and how the live Perps API maps onto it.

Tokenized Stocks

Stocks, ETFs and funds from Dinari and Ondo Global Markets, with issuer KYC and trading hours.

Coverage

Every integration, its venue, product type and status.

Monetization

Builder and partner fees per venue, and where they are configured.

Perps API reference

The live Perps API: every endpoint, argument schema and response field.