Flows
Trading
Submit orders, manage positions, and read the live trading desk for a funded prop account. Orders are routed to the validator network and reflected back in positions/history.
Always send X-Prop-Account
X-Prop-Account header. Get ids from prop accounts.trade_pair uses the wire id
BTCUSD), not a display label like BTC/USD. Sending the wrong format returns 400 Bad Request.Bots: authenticate with an API key instead
X-Api-Key: <key_id>.<key_secret> on its own — no bearer or session token needed. Mint one per trader at /docs/api-keys.Submit an order
/v2/trading/orderstrade_pair | string | required | Wire id, e.g. "BTCUSD" |
order_type | "LONG" | "SHORT" | "FLAT" | required | Direction |
leverage | number | optional | Size by leverage… |
value | number | optional | …or by notional value… |
quantity | number | optional | …or by quantity (pick one) |
execution_type | string | optional | MARKET (default), LIMIT, STOP_LIMIT, BRACKET… |
limit_price | number | optional | For LIMIT / STOP_LIMIT |
stop_price | number | optional | For STOP_LIMIT |
take_profit | number | optional | Optional TP price |
stop_loss | number | optional | Optional SL price |
curl -X POST http://localhost:8000/v2/trading/orders \
-H "Authorization: Bearer <app_access_token>" \
-H "X-Session-Token: <user_session_token>" \
-H "X-Prop-Account: prop_..." \
-H "Content-Type: application/json" \
-d '{
"trade_pair": "BTCUSD",
"order_type": "LONG",
"leverage": 1.0,
"execution_type": "MARKET"
}'import { trading } from "@/lib/hsc/client";
await trading.submit(
{ trade_pair: "BTCUSD", order_type: "LONG", leverage: 1.0, execution_type: "MARKET" },
propAccountId,
);{ "success": true, "order_uuid": "ord_...", "message": null, "processing_time": 0.42 }Manage positions & orders
POST /v2/trading/orders/close | body { trade_pair } | optional | Flatten a position |
POST /v2/trading/orders/bulk-close | body { position_uuids } | optional | Close many at once |
DELETE /v2/trading/orders/{uuid} | ?trade_pair=… | optional | Cancel a resting order |
POST /v2/trading/orders/{uuid}/edit | body { trade_pair, order_type, … } | optional | Edit a resting order |
POST /v2/trading/orders/tp-sl | body { trade_pair, take_profit?, stop_loss? } | optional | Attach TP/SL |
Read the desk
Reads accept X-Prop-Account and return snapshots. desk-poll bundles everything in one round-trip — ideal for a UI refresh loop.
/v2/trading/desk-poll{
"positions": [ /* open positions */ ],
"orders": [ /* resting orders */ ],
"history": [ /* closed positions */ ],
"balance": { "account_size": 25000, "status": "evaluation", "subaccount_info": { /* validator snapshot */ } }
}balance.status mirrors the prop-account status — provisioning, subaccount_failed, evaluation, funded or eliminated. It is never active. Both status and subaccount_info are omitted entirely when the account has no synthetic_hotkey yet or the validator fetch fails, so the bundle degrades to { "account_size": 25000 } with empty positions, orders and history.
Individual reads: GET /v2/trading/positions, GET /v2/trading/orders, GET /v2/trading/history, GET /v2/trading/balance.