Tektii just went live. We're shipping fixes daily — spot a bug? Let us know

Trading API

The Trading API is the wire protocol your strategy speaks to the Trading Gateway. The same protocol covers all three Gateway modes — backtest, paper, and live — so strategy code stays identical as you promote from simulation to real markets.

Your strategy opens a WebSocket connection to :8080/v1/ws to receive market events (ticks, bars, fills, position updates) and uses REST endpoints at :8080/v1/* to place, modify, and cancel orders. See Concepts for the full architectural picture, including how the Gateway maps a single normalised order model onto each broker's native API.

Get started

  1. Concepts — Unified protocol, execution modes, connection model
  2. Connection — Authenticate and connect your strategy
  3. Hello World — Your first strategy: the SDK path in Python, plus the raw protocol in four more languages

Reference

PagePurpose
OrdersOrder types, statuses, and request/response schemas
PositionsPosition schema, P&L calculation, and REST endpoints
EventsWebSocket event types, market data, and client messages
InstrumentsAsset classes, provider-native symbol formats, and symbol discovery
WebSocketWebSocket message types: subscriptions, heartbeats, acknowledgments
RESTREST endpoints for orders, positions, trades, account, and market data
Placing OrdersWorked example: submit market, limit, and stop-loss orders
Handling EventsWorked example: route and handle WebSocket events

The Trading API is implemented by the Trading Gateway. To run a Gateway, follow the setup guide.