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

# Trading Perpetuals on Hyperliquid

> Use Otto's live ACP or x402 Trade Execution rails for Hyperliquid perps; the DApp RSI strategy remains an in-validation preview.

Hyperliquid order execution is live through the **Trade Execution Agent** on ACP and through the matching x402 endpoints. The `/app` RSI Scalper page is a separate strategy preview: it has executed zero public trades and is not enabled for public execution.

### Key Features

1. **Seamless & Secure "One-Click" Trading:**
   * For each session, Otto generates a temporary, in-browser **ephemeral key** for trading.
   * After a single, initial approval for the session, you can execute trades without needing to sign every transaction. This key is discarded when your session ends, ensuring your main wallet keys are never exposed for trading operations.

2. **Open and Close Positions:**
   * Open long or short positions with the ACP `trade_perpetuals` job or x402 `POST /trade-perpetuals`.
   * Close positions with `close_position` or `POST /close-position`.

3. **Risk Controls:**
   * Set leverage subject to the asset's Hyperliquid limit, with optional native take-profit and stop-loss orders.
   * Modify orders and isolated-position margin through the dedicated management jobs or endpoints.

4. **Account Awareness:**
   * Query `getHyperliquidAccount` (ACP) or `GET /hyperliquid-account` (x402) before placing an order to check available USDC, open positions, margin, and orders.

### How to Trade

1. **Choose a live rail:** use `acp-cli` with the Trade Execution Agent or call the [x402 storefront](/acp-swarm/x402).

2. **Check and fund the account:** query the Hyperliquid account first. If needed, use `hyperliquid_deposit_withdrawal` on ACP or `POST /hl-deposit-withdraw` on x402.

3. **Set up the trade:** provide the asset, position size, direction, leverage, and any take-profit or stop-loss values.

   **Example positions you can set up:**

   * Long 0.5 ETH with 10x leverage
   * Short 1000 ARB with 5x leverage
   * View your open positions, margin, and account balance on Hyperliquid

4. **Initial Approval:** For your first trade in a session, you'll be asked to approve the use of the temporary session key.

5. **Submit and verify:** review the exact parameters, submit the job or paid request, and verify the returned position and order state with the account resource.

**Security Note:** All your Hyperliquid trading data, such as leverage settings and position details, are strictly isolated to your account and session.

## Getting Out

**Today, exiting Hyperliquid means using the live rails above:** cancel your orders with the order-management jobs or endpoints, close each position with `close_position` / `POST /close-position`, then withdraw with `hyperliquid_deposit_withdrawal` / `POST /hl-deposit-withdraw`. Withdrawals settle on **Arbitrum** and are pinned server-side to your own Otto Safe address — a request cannot send your money anywhere else.

Because Otto's runtime signs each of those steps, **getting out currently depends on Otto's service being available.** That is the honest state of things, and it is worth knowing before you size a position.

<Note>
  **In development — not yet available.** Two additions are being built and gated, and neither is live: a **single close-everything-and-withdraw request**, and a **user-facing export of your Hyperliquid vault key**. Neither has a callable endpoint today. They are described in [Wallet Security](/safety-and-security/wallet-security) so you can see where custody is heading — do not plan around them until this page says they have shipped.
</Note>

<Warning>
  The DApp's **RSI Scalper** is not a live execution route. Its converged-Safe eligibility is default-off while the strategy is validated; use ACP or x402 for live manual Hyperliquid execution.
</Warning>

<Note>
  **Custody:** your Hyperliquid margin does **not** sit in your Otto Safe. Hyperliquid requires a plain EOA signature, which a smart-contract Safe cannot produce, so perps margin is held in a dedicated **MPC vault** that Otto operates through its wallet provider — an Otto-managed key signs your trades and your withdrawals. Your Safe is the funding source and the pinned withdrawal destination, not the trading account. The user-owned [Safe7579](/introduction/safe7579-architecture) model governs your Safe on Base — activation grants the named Otto trading operator unrestricted, non-expiring authority until revocation, and the separate billing operator only a bounded, expiring permission — but it does not change who signs on Hyperliquid. See [Wallet Security](/safety-and-security/wallet-security) for the full picture across surfaces.
</Note>
