Trading Gateway

The Tektii Trading Gateway is an open-source, self-hosted trading proxy. It sits between your strategy and an upstream broker (or the Tektii simulation backend) and normalises every supported broker behind one REST + WebSocket protocol on port 8080. Your strategy codes against one protocol; the Gateway routes to the broker.

Every broker speaks a different language — different endpoints, auth schemes, order models, and failure modes. The Gateway solves that. You write your strategy once, backtest it against historical data via the tektii provider, and then promote the same binary to paper and live trading by switching environment variables.

Three modes

A Gateway instance runs in exactly one mode at a time, chosen at startup:

  • BacktestGATEWAY_PROVIDER=tektii, connects to the Tektii simulation backend for historical replay
  • PaperGATEWAY_MODE=paper (default), routes orders to the broker's paper-trading sandbox
  • LiveGATEWAY_MODE=live, routes orders to real markets with real money

To switch providers or modes, restart the Gateway. There is no runtime switching.

Get started

  1. Install the Gateway — Docker quickstart and source build
  2. Setup — Provider config, feature flags, and monitoring
  3. Going Live — Promote a backtested strategy to paper then live
  4. Protocol Reference — The wire protocol your strategy speaks

If you also use the hosted backtesting platform, see the Tektii CLI.