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
Trading endpoints act on a specific funded account. Pass its id in the
X-Prop-Account header. Get ids from prop accounts.trade_pair uses the wire id
Use the validator's wire id (e.g.
BTCUSD), not a display label like BTC/USD. Sending the wrong format returns 400 Bad Request.Submit an order
POST
/v2/trading/ordersUser session
Request body
trade_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
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"
}'lib/hsc/client.ts
import { trading } from "@/lib/hsc/client";
await trading.submit(
{ trade_pair: "BTCUSD", order_type: "LONG", leverage: 1.0, execution_type: "MARKET" },
propAccountId,
);200 OK
{ "success": true, "order_uuid": "ord_...", "message": null, "processing_time": 0.42 }Manage positions & orders
Endpoints
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.
GET
/v2/trading/desk-pollUser session
200 OK
{
"positions": [ /* open positions */ ],
"orders": [ /* resting orders */ ],
"history": [ /* closed positions */ ],
"balance": { "account_size": 25000, "status": "active" }
}GET
/v2/trading/desk-pollRuns live against your environment using the app's server-side credentials and your session. Sign in to the dashboard first for authenticated reads.
Individual reads: GET /v2/trading/positions, GET /v2/trading/orders, GET /v2/trading/history, GET /v2/trading/balance.