# Orders

## Intent API

`POST /v1/orders` accepts USD-first intents. Prefer `POST /v1/orders/suggest` first. Do not use `/v1/perps/*`.

```json
{
  "market": "perp:BTC",
  "side": "long",
  "usdAmount": 45,
  "leverage": 10,
  "bracket": { "stopLoss": { "pct": -2 }, "takeProfit": { "pct": 4 } },
  "guardians": [{ "type": "max_hold", "seconds": 86400 }],
  "dryRun": true
}
```

When `dryRun: true`, response includes `planId`, `confirmToken`, and a human `summary`. Execute with `POST /v1/orders/confirm`.

## Suggest sizing

`POST /v1/orders/suggest` sizes an open/close to venue minimum and book depth.

## Close

`POST /v1/positions/{market}/close` with `{ "fraction": 0.5 }` or `{ "usdAmount": 20 }` or `{ "size": "…" }`.

## List & cancels

- `GET /v1/orders` — open + trigger orders
- `DELETE /v1/orders/{oid}` — cancel one
- `DELETE /v1/orders?coin=BTC` — cancel all for a coin

## Outcomes

`POST /v1/outcomes/trade` for prediction/event shares (no leverage).

Always confirm size, side, and leverage with the user before submitting (prefer `dryRun` → confirmToken).
