Skip to content

Apache 2.0 VGP v1 paper Deribit Bybit

One small protocol between qkt and a trading venue — one container per account.

qkt-venue-gateway gives qkt one protocol, VGP v1, for futures, perpetuals, options and spot. An order is placed at most once, nothing is lost on a restart, and a kill switch lives outside qkt.

Start the paper gateway, point qkt at it, send an order and read the fill
Start the paper gateway, point qkt at it, send an order, read the fill. Every command was run for real against the paper account: they are the ones in Quickstart. Watch the full walkthrough.
§ 01

What the gateway guarantees

One gateway process serves one venue account. qkt places orders and reads market data through it, and a venue adapter does the talking to the venue. The same four things hold for every venue:

  • Orders are never doubled. A client order id is placed at most once; a retried submit returns the same order.
  • Nothing is lost on restart. Every order, fill and position change is journaled before it is sent. After any restart, qkt replays from its last sequence number.
  • Lost orders are recovered. An order the venue has forgotten is resolved from its fills, never sent again.
  • A kill switch outside qkt. A guardian token can block new exposure for the account or per symbol.
qkt ──────┐                ┌─────────── qkt-venue-gateway (one per account) ───────────┐
          ├── VGP v1 ─────▶│ auth · kill switch · idempotency · journal · reconciler   │──▶ venue
guardian ─┘  HTTP + WS     │                      adapter                              │
                           └────────────────────────────────────────────────────────────┘
§ 02

How it works, in three steps

1

Start a gateway

One container per account, configured by GATEWAY_* variables. The paper account needs only Docker and two tokens: docker compose up -d.

2

Point qkt at it

One type: gateway broker in qkt's config. qkt refuses to start if the gateway's adapter, account or trade mode do not match what you wrote.

3

Trade

Deploy a strategy. Each order and fill is journaled, streamed to qkt in order, and survives a restart of either side.

§ 03

Adapters

Adapter Venue Status
paper Simulated account on Deribit's public prices; no account needed Stable
deribit Deribit testnet and mainnet: USDC-linear perpetuals, futures and options Stable
bybit Bybit testnet and mainnet: USDT/USDC linear contracts, or spot New

Another venue is one adapter module. See writing an adapter and the adapter rules.

§ 04

Where to go next

I want to Read
Run it in five minutes Quickstart
Run a gateway for a real account Run a gateway · Going live
Connect qkt Connect qkt
Stop trading from outside qkt Kill switch and guardrails
Look up a variable or a route Configuration · API at a glance
Back up, upgrade, troubleshoot Operations
Add a venue Writing an adapter
Understand how it works and why How it works · Design

The same idea for MetaTrader 5 is mt5-gateway. The engine is qkt.