Trading Gateway
The Tektii Trading Gateway is a source-available (Elastic License 2.0), self-hosted trading proxy — free to use, self-host, and embed. It sits between your strategy and an upstream broker 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 on the hosted Tektii platform, and then promote the same binary to paper and live trading by self-hosting the Gateway and switching environment variables.
Three modes
Your strategy speaks the same protocol in all three modes:
- Backtest — runs on the hosted Tektii platform against historical data; you do not start the Gateway yourself (see the Tektii CLI)
- Paper — self-host the Gateway with
GATEWAY_MODE=paper(default); routes orders to the broker's paper-trading sandbox - Live — self-host the Gateway with
GATEWAY_MODE=live; routes orders to real markets with real money
For paper and live, a Gateway instance serves exactly one provider, chosen at startup. To switch providers or modes, restart the Gateway — there is no runtime switching.
Supported Providers
GATEWAY_PROVIDER | Feature flag | Required credentials |
|---|---|---|
alpaca | alpaca (default) | ALPACA_API_KEY, ALPACA_API_SECRET |
binance_spot | binance (default) | BINANCE_API_KEY, BINANCE_API_SECRET |
oanda | oanda (default) | OANDA_API_KEY, OANDA_ACCOUNT_ID |
saxo | saxo (default) | SAXO_APP_KEY, SAXO_APP_SECRET, SAXO_ACCOUNT_KEY |
mock | mock (default) | none — in-memory simulation for development |
All four broker adapters (alpaca, binance_spot, oanda, saxo) plus the mock simulation ship as default Cargo features and are compiled into the published Docker image. See Supported Brokers in the Gateway README for the canonical matrix as providers are added.
Get started
- Install the Gateway — Docker quickstart and source build
- Setup — Provider config, feature flags, and monitoring
- Going Live — Promote a backtested strategy to paper then live
- Protocol Reference — The wire protocol your strategy speaks
If you also use the hosted backtesting platform, see the Tektii CLI.