Trade
Trade with your own account
An API key, signed requests and live fills. Use the REST API, WebSockets or an SDK.
Quick startPOST /api/v1/orders
// signed: X-STX-ACCESS-* headers
{
"market_id": "9d42e9c9-…",
"action": "buy",
"order_type": "limit",
"price": "0.42",
"quantity": "10"
}// /socket/websocket?vsn=2.0.0
["1", "1", "orderbook",
"phx_join",
{"market_ids": ["9d42e9c9-…"]}]
// then a "book" push per market:
{"market_id": "9d42e9c9-…",
"bids": [...], "offers": [...]}import { STX } from
"@stxapp/stx-typescript";
const client = new STX();
await client.placeOrder(
marketId, "buy", "limit",
{ price: "0.42",
quantity: "10" }
);
