> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yield.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Trade

> Let users trade every market type through one interface. Perps on Hyperliquid are live today through the Perps API, and the Trade API, coming soon, adds spot, tokenized stocks and prediction markets.

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.

<Note>
  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](/documentation/trade/perps#perps-api-today). Endpoint and field names on these pages come from the Trade API design and can change before launch.
</Note>

## What you can trade

| Product | What a trade is | Venues | Status |
| - | - | - | - |
| [Perps](/documentation/trade/perps) | A leveraged long or short on a perpetual futures market | Hyperliquid, Lighter | Live on Hyperliquid through the Perps API. Lighter and the Trade API are coming soon |
| Spot | Buying or selling a token pair, held as a balance | Hyperliquid | Coming soon |
| Prediction markets | Buying an outcome share that pays out when the event resolves | Hyperliquid (HIP-4) | Coming soon |
| [Tokenized Stocks](/documentation/trade/tokenized-stocks) | Buying a token that tracks a listed share, ETF or fund | Dinari, Ondo Global Markets | Coming soon |

Each venue product is an integration with its own ID, such as `hyperliquid-perps` or `dinari-spot`. [Coverage](/documentation/trade/coverage) lists every integration and its status. [Core concepts](/documentation/trade/core-concepts/index) explains how each product type maps onto the same endpoints.

<Warning>
  Perps trading carries jurisdictional restrictions. Read the [perpetuals disclaimer](/legal/perpetuals-disclaimer) before integrating.
</Warning>

## 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

<Columns cols={2}>
  <Card title="Core concepts" icon="shapes" href="/documentation/trade/core-concepts/index">
    Integrations, markets, buy, sell and manage, simulate, signing, statuses and portfolio reads.
  </Card>

  <Card title="Perps" icon="chart-candlestick" href="/documentation/trade/perps">
    Perps on Hyperliquid today, Lighter with the Trade API, and how the live Perps API maps onto it.
  </Card>

  <Card title="Tokenized Stocks" icon="chart-line" href="/documentation/trade/tokenized-stocks">
    Stocks, ETFs and funds from Dinari and Ondo Global Markets, with issuer KYC and trading hours.
  </Card>

  <Card title="Coverage" icon="table" href="/documentation/trade/coverage">
    Every integration, its venue, product type and status.
  </Card>

  <Card title="Monetization" icon="percent" href="/documentation/trade/monetization">
    Builder and partner fees per venue, and where they are configured.
  </Card>

  <Card title="Perps API reference" icon="code" href="/api-reference/perps-api/discovery/list-providers">
    The live Perps API: every endpoint, argument schema and response field.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.