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

# Trading

> Trading actions on Ondo and the venue's order constraints

The Ondo provider exposes trading actions in the `actions` array from `GET /providers`. Every trading action is signed by the venue **API key** (`PerpsSigner.SDK`) using the `hmac` signing method and relayed to the venue by the backend — see [Signing Model](/providers/ondo/signing-model#the-hmac-signed-trading-relay). For setup actions, see [Setup](/providers/ondo/setup). For full parameter schemas, see the [Actions API reference](/api-reference/actions).

## Order constraints

These apply across `placeOrder` and `placeTriggerOrder`:

* **Cross margin only.** `marginMode: ISOLATED` is rejected.
* **`LIMIT` and `MARKET` order types only.**
* **`price` required for a limit order** and validated on the market's price grid; `size` is validated on the size grid.
* **Time-in-force:** `GTC`, `IOC`, `POST_ONLY` (post-only submits as `GTC` with the post-only flag).
* **No order expiry** — `expiresAt` must be omitted.
* **Trigger legs execute at market** — a `limitPrice` on a `takeProfit` / `stopLoss` is rejected.

## `actions`

### `placeOrder`

Places a market or limit order. When `leverage` is supplied, the SDK first submits a leverage step for the market, then the order. Optional `takeProfit` / `stopLoss` legs attach trigger orders to the entry.

|                 |                                                                                                                                         |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Signers**     | `SDK` (HMAC relay)                                                                                                                      |
| **Params**      | `PlaceOrderParams` — `{ market, side, type?, size, price?, leverage?, marginMode?, reduceOnly?, timeInForce?, takeProfit?, stopLoss? }` |
| **SDK methods** | `placeOrder()`                                                                                                                          |

### `placeTriggerOrder`

Attaches standalone take-profit and/or stop-loss triggers to an open position. Triggers execute at market (no limit price).

|                 |                                                                        |
| --------------- | ---------------------------------------------------------------------- |
| **Signers**     | `SDK` (HMAC relay)                                                     |
| **Params**      | `PlaceTriggerOrderParams` — `{ market, side, takeProfit?, stopLoss? }` |
| **SDK methods** | `placeTriggerOrder()`                                                  |

### `placeTwapOrder`

Places a TWAP parent order over REST, relayed by the backend as an HMAC-signed venue request (`POST /v1/perps/twap/order`).

|                 |                                                                                                                          |
| --------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **Signers**     | `SDK` (HMAC relay)                                                                                                       |
| **Params**      | `PlaceTwapOrderParams` — `{ market, side, size, durationSeconds, reduceOnly?, frequencySeconds?, minPrice?, maxPrice? }` |
| **SDK methods** | `placeTwapOrder()`                                                                                                       |

`durationSeconds` (the venue's `runningTime`) must be between 300 and 86400 seconds and an exact multiple of `frequencySeconds` (the child-order interval, default 30s; allowed values 30/60/300/900/3600s) — the resulting child-order count must fall between 2 and 200. `minPrice`/`maxPrice` bound the acceptable child-order price when both are supplied (`minPrice` below `maxPrice`); either or both may be omitted for no bound. `randomize` must be omitted — Ondo's REST TWAP endpoint takes no randomization parameter.

### `cancelOrder`

Cancels one or more open orders by id. A single id cancels one order; multiple ids cancel as a batch.

|                 |                                 |
| --------------- | ------------------------------- |
| **Signers**     | `SDK` (HMAC relay)              |
| **Params**      | `CancelOrderParams` — `{ ids }` |
| **SDK methods** | `cancelOrders()`                |

### `cancelTwapOrder`

Cancels a running TWAP parent by id (`DELETE /v1/perps/twap/order/{twapId}`).

|                 |                                                |
| --------------- | ---------------------------------------------- |
| **Signers**     | `SDK` (HMAC relay)                             |
| **Params**      | `CancelTwapOrderParams` — `{ market, twapId }` |
| **SDK methods** | `cancelTwapOrder()`                            |

`twapId` is Ondo's globally-unique `twap_`-prefixed identifier returned from `placeTwapOrder`. `market` is required by the shared params shape but unused here — Ondo's TWAP ids need no market to disambiguate.

### `cancelAllOrders`

Immediately cancels every open order on the account.

|                 |                                                                                   |
| --------------- | --------------------------------------------------------------------------------- |
| **Signers**     | `SDK` (HMAC relay)                                                                |
| **Params**      | (none beyond the implicit account/key context)                                    |
| **SDK methods** | Dispatched via [`execute()`](/sdk/trading/methods#execute) — no dedicated wrapper |

### `updateLeverage`

Sets the cross-margin leverage for a market.

|             |                                                              |
| ----------- | ------------------------------------------------------------ |
| **Signers** | `SDK` (HMAC relay)                                           |
| **Params**  | `UpdateLeverageParams` — `{ market, leverage, marginMode? }` |
