> For the complete documentation index, see [llms.txt](https://docs.hyperlink.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyperlink.xyz/trade/trading.md).

# Trading

Trade spot and perpetual markets privately in the HyperLink web app at [app.hyperlink.xyz](https://app.hyperlink.xyz). HyperLink is a prime broker for Hyperliquid: it routes your orders into Hyperliquid's liquidity while keeping your balances, positions, and orders off the public chain.

Trading mirrors Hyperliquid's, with the differences below. For order mechanics, margining, and liquidations not covered here, see Hyperliquid's docs (linked below).

## How HyperLink differs from Hyperliquid

| Aspect             | HyperLink                                                                                                   | Hyperliquid                                                                                         |
| ------------------ | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| Privacy            | Balances, positions, and orders stay private inside the enclave.                                            | Wallet-linked balances, positions, and orders are public.                                           |
| Order types        | Limit (`Gtc`, `Ioc`, `Alo`), market, trigger, private TWAP, and scale orders. Cancel and replace to modify. | Native order types, TWAP, and order modification.                                                   |
| Max leverage       | Per-asset caps with a safety buffer below Hyperliquid's max tier.                                           | Per-asset [max margin tiers](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/margin-tiers). |
| Maintenance margin | Half the initial margin at max leverage.                                                                    | Same maintenance-margin model.                                                                      |
| Trading fees       | Lowest protocol-available rates through pooled volume and staking. See [Fees](/trade/fees.md).              | Based on account volume and staking.                                                                |
| API keys           | Agent wallets with `readOnly` permissions and optional `ipWhitelist` allowlists.                            | Agent wallets.                                                                                      |
| Account structure  | Pooled prime-broker account with OI/netting limits and a protocol-backed insurance fund.                    | Individual account exposure.                                                                        |

{% hint style="warning" %}
Leverage increases both gains and losses. A leveraged position can be liquidated, wiping out the margin backing it. Size positions conservatively.
{% endhint %}

## Place an order

1. Select a market and **Buy / Long** or **Sell / Short**.
2. Pick an order type and enter size (and price for limit orders).
3. For perps, set leverage and review the shown margin mode before opening the position.
4. Review, submit, and sign the order in your wallet.

On Hyperliquid: [order types](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types), [take-profit and stop-loss](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/take-profit-and-stop-loss-orders-tp-sl).

## Margining & liquidation

Margining mirrors Hyperliquid, applied to your account inside the enclave.

* **Max leverage:** HyperLink sets each asset's cap a step below Hyperliquid's: it trims a small safety buffer and rounds down to a multiple of 5. For example, BTC is 40x on Hyperliquid and 25x on HyperLink. The trade panel shows the exact cap.
* **Margin mode:** each market uses the mode shown in the trade panel; open positions keep that mode until closed.
* **Liquidation:** if your account value falls below the position's maintenance margin, the position is liquidated.
* **Auto-deleveraging:** follows Hyperliquid's priority order — see the [FAQ](/more/faq.md#how-is-auto-deleveraging-adl-handled).

For mechanics, see Hyperliquid's [margining](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/margining) and [liquidations](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/liquidations).

## Open order limits

HyperLink limits how many resting orders an account can keep on the book at once. Standing limit orders count toward this limit; market and `Ioc` orders execute immediately and don't, and nothing caps how much you trade.

The limit grows with your trailing 14-day raw trading volume, from 5 resting orders up to 100. You earn one additional slot for each $50k traded:

| Trailing 14-day raw volume | Resting orders |
| -------------------------- | -------------- |
| Under $50k                 | 5              |
| $50k                       | 6              |
| $250k                      | 10             |
| $1M                        | 25             |
| $4.75M+                    | 100            |

For most strategies this is ample headroom, and active traders reach the higher tiers automatically as volume accrues. Exceeding your current limit rejects the order with `Too many open orders for this account right now`; cancel or replace a resting order to free a slot.

## Track your portfolio

Your portfolio shows spot balances, perpetual account value, unrealized PnL, margin used, withdrawable balance, open positions, open orders, and trade history. Everything is private: it is reconstructed from read queries that only your account can authorize. No third party, not even the operator, can see it.

To read the same data programmatically, query `POST /exchange` (`clearinghouseState`, `spotClearinghouseState`, `openOrders`, `userFills`) or stream it live over the [WebSocket API](/api/websocket.md). See [Exchange Methods](/api/exchange-methods.md) for schemas.

## Next steps

* [Deposits & Withdrawals](/trade/deposits.md): fund or move funds.
* [API Quickstart](/api/setup.md): automate trading over the API.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hyperlink.xyz/trade/trading.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
