PROPELOO

TRADING ENGINE DEVELOPMENT

Build the trading engine that sits between your users and the market — and handles both correctly.

PROPELOO engineers trading engines — order management system, smart order routing, exchange connectivity, position ledger, fee engine, real-time P&L and the reconciliation layer that proves every trade is accounted for. A trading engine is not a matching engine and not a portfolio tracker. It is the system that takes user intent and converts it into exchange-level execution while maintaining financial correctness.

Most trading engine failures are not execution failures — they are reconciliation failures. The trade happened; the books do not agree on what happened.

A trading engine that routes orders to exchanges but cannot reconcile fills, handle partial fills correctly, manage order state across websocket disconnections, or account for exchange fees in the position ledger is not a trading engine — it is an order submission proxy with unknown financial state. The hard problems in trading engine development are not the exchange API calls. They are: order state management across connectivity failures, idempotent order submission that prevents duplicates, fee model accuracy across multiple exchanges with different fee structures, and a reconciliation process that catches every discrepancy before it becomes a financial dispute. PROPELOO designs trading engines with these requirements as first-class concerns — not afterthoughts discovered in production.

What a production trading engine contains.

Order routing is one component. Financial correctness requires five more.

System Layers

  • Order Management System: Order lifecycle state machine, order types (market, limit, stop, bracket), parent/child order relationships, order history
  • Smart Order Router: Best execution routing across exchanges, liquidity aggregation, split order execution, exchange fee comparison
  • Exchange Connectivity: Multi-exchange REST + WebSocket adapters, FIX gateway, connection management, reconnect logic, rate limiting
  • Position & Ledger Layer: Real-time position tracking, cost basis calculation, unrealised/realised P&L, fee accounting, multi-asset ledger
  • Reconciliation Layer: Exchange trade history comparison, fill reconciliation, discrepancy detection, gap detection in order updates

Core Technical Capabilities

  • Order Management System

    Full order lifecycle: created → submitted → acknowledged → partial fill → filled/cancelled/rejected. Each state transition is journaled. Bracket orders, OCO, trailing stops handled as composite order trees. Order state survives process restart.

  • Smart Order Router

    Route orders to exchanges based on available liquidity, effective spread, fee structure and order size. Split large orders across exchanges to minimise market impact. Iceberg order execution for large positions.

  • Exchange Connectivity

    Adaptors for major exchanges (Binance, Bybit, OKX, Kraken, Coinbase). REST for order submission and account queries. WebSocket for real-time order updates and fills. Reconnect logic with order state reconciliation on reconnect.

  • Position Ledger

    Real-time position tracking across all exchanges. FIFO/LIFO cost basis. Unrealised P&L mark-to-market on every tick. Fee deduction from P&L. Multi-currency position with base currency conversion.

  • Trade Reconciliation

    Periodic reconciliation against exchange trade history. Fill completeness check. Fee verification. Discrepancy alerting. Gap detection in WebSocket order update stream.

  • Trade Reporting

    Trade history export (CSV, JSON), tax reporting format, P&L attribution by strategy/symbol/period, execution quality metrics (slippage vs arrival price).

How we approach trading engine architecture.

A trading engine must be correct before it is fast. Financial incorrectness compounds — it does not average out.

  • Order state must survive failures

    A trading engine that loses order state when a WebSocket disconnects or a process restarts is not production-ready. Every order state transition must be persisted before the transition is acted upon. On reconnect, order state is reconciled against the exchange — not assumed from in-memory state.

    Axiom: DURABLE ORDER STATE

  • Idempotent order submission

    Network failures between order submission and exchange acknowledgement create a dangerous state: was the order received or not? Client-order-ID based idempotency allows safe retry — the exchange either acknowledges the existing order or creates a new one, and the OMS handles both correctly.

    Axiom: IDEMPOTENT OR DANGEROUS

  • Fees must be in the P&L from the start

    Trading P&L that does not account for exchange fees looks better than it is. A strategy that appears profitable before fees may be loss-making after. Fee models must be accurate — including tiered fee schedules, maker vs taker distinction, and fee currency handling.

    Axiom: FEES IN EVERY P&L CALCULATION

Key decisions in trading engine architecture.

These choices define correctness, reliability and operational complexity.

  • Centralised OMS vs per-exchange order tracking?

    Impact: Centralised OMS with per-exchange adaptors. The OMS holds the canonical order state; adaptors translate between OMS state model and exchange-specific APIs.

    • Centralised OMS — single source of truth for all orders across all exchanges, requires careful sync with exchange state
    • Per-exchange tracking — simpler per-exchange logic, complex cross-exchange portfolio view
    • Hybrid — per-exchange adaptor, centralised OMS aggregating state
  • WebSocket vs REST for order updates?

    Impact: WebSocket primary with REST reconciliation on connect/reconnect. Never rely solely on WebSocket — assume it will disconnect.

    • WebSocket — real-time updates, requires reconnect handling and state reconciliation
    • REST polling — simpler, higher latency, misses rapid state changes
    • Hybrid — WebSocket primary, REST for reconciliation and recovery
  • How to handle exchange rate limits?

    Impact: Per-exchange rate limiter that tracks consumed weight and queues requests approaching the limit. Exchange rate limits change — the limiter must be configurable.

    • Implement per-exchange rate limiter in the adaptor — prevents rejection, requires accurate rate limit modelling
    • Retry on rejection — simple, wastes attempts, can cascade
    • Queue with backpressure — smooth throughput, adds latency under burst
  • Position ledger: event-sourced vs current-state?

    Impact: Event-sourced position ledger. Every fill event is appended; current position is derived. This gives a complete audit trail and the ability to replay history for reconciliation.

    • Event-sourced — full history, audit trail, replay capability, more complex queries
    • Current-state with history table — simpler queries, requires careful update logic
    • Current-state only — simplest, no audit trail, not acceptable for financial systems

What PROPELOO builds.

  • Crypto Trading Engine

    Multi-exchange trading engine for crypto — OMS, smart order routing, WebSocket connectivity, real-time P&L, reconciliation.

  • Institutional OMS

    Order management system for institutional trading desks — FIX connectivity, position management, compliance pre-trade checks, allocation.

  • Retail Trading Platform Backend

    Backend execution layer for a retail trading app — order routing, position tracking, fee calculation, trade history API.

  • Trading Engine Replacement

    Replace an existing trading engine with correctness and reliability problems — state migration, parallel running, zero-downtime cutover.

  • DeFi Trading Engine

    On-chain trading engine — DEX order routing, gas optimisation, MEV protection, transaction monitoring, on-chain position tracking.

The trading engine stack.

Reliability and correctness over raw performance.

  • OMS Core

    Stack: Go / TypeScript (Node.js), PostgreSQL (order journal), Redis (real-time state cache), Event sourcing pattern, State machine library

  • Exchange Connectivity

    Stack: REST + WebSocket adaptors, FIX engine (institutional), ccxt (multi-exchange abstraction), Rate limiter middleware, Circuit breaker pattern

  • Position & Reporting

    Stack: Real-time P&L engine, Fee model library, Reconciliation job, Trade history API, CSV/JSON export

  • Observability

    Stack: Order fill latency metrics, Reconciliation discrepancy alerts, Position drift monitoring, Fee accuracy tracking, WebSocket connection health

Trading engine security: prevent financial loss from both external attacks and internal bugs.

An API key compromise or a duplicate order bug both result in financial loss.

  • API key security

    Exchange API keys stored in secrets manager. Trade-only permissions — no withdrawal capability on trading keys. Per-strategy/per-user keys to limit blast radius of compromise.

  • Duplicate order prevention

    Client-order-ID uniqueness enforced at the OMS level. Idempotency checks before submission. Duplicate detection on WebSocket fill events that may be delivered multiple times.

  • Reconciliation discrepancy alerting

    Any discrepancy between OMS state and exchange trade history triggers an alert within the next reconciliation cycle (typically 5 minutes). Unresolved discrepancies escalate to manual review.

  • Position limit enforcement

    Maximum position size per symbol, maximum total notional exposure, and per-account limits enforced before order submission — not just in the UI.

From specification to live trading operations.

  1. 01. Architecture

    OMS design, exchange adaptor interface, position model, reconciliation process, fee model.

  2. 02. OMS Core

    Order state machine, persistence, idempotency, bracket order logic.

  3. 03. Exchange Adaptors

    REST + WebSocket connectivity, rate limiting, reconnect logic, order state sync.

  4. 04. Position Engine

    Real-time position tracking, P&L calculation, fee accounting, multi-currency support.

  5. 05. Reconciliation

    Exchange trade history comparison, discrepancy detection, alerting.

  6. 06. Testing & Validation

    Paper trading validation, chaos testing (disconnect simulation), reconciliation correctness.

  7. 07. Production

    Monitoring, runbooks, on-call setup, performance baseline.

Trading engines we have shipped to production.

Three trading system builds handling real capital deployment and execution.

  • Crypto algorithmic trading engine running 8 strategies with live risk management

    Challenge: Prop trading firm running crypto strategies via manual execution needed an automated trading engine — strategy signals from Python quant models executing via a Go order manager with per-strategy position limits, drawdown controls, and real-time P&L.

    Architecture: Python strategy layer generating signals, Go execution layer managing orders across 4 exchanges via CCXT, Redis for live position state, per-strategy risk limits (max position, daily drawdown, max order size), kill switch per strategy and global.

    Outcome: 8 strategies live simultaneously, $4.2M capital deployed, Sharpe ratio 1.8 across portfolio in first 6 months, zero margin calls, kill switch triggered correctly in 3 market stress events.

  • Market making system maintaining two-sided quotes on 12 crypto pairs

    Challenge: Market making firm needed a low-latency quoting engine maintaining two-sided order books on 12 crypto pairs across 3 exchanges — tight spreads, inventory-adjusted quotes, and position flattening on exposure breach.

    Architecture: Rust quote engine calculating bid/ask based on mid-price, inventory skew, and volatility. Go order management for placement and cancellation. Cross-exchange inventory aggregation. Exposure limits per pair and in aggregate. Automatic hedge orders on limit breach.

    Outcome: Quoting on 12 pairs across 3 exchanges, median spread 0.04%, inventory turnover 8x daily, P&L positive in 5 of first 6 months.

  • Cross-exchange triangular and statistical arbitrage engine executing 200+ trades/day

    Challenge: Trading firm needed an arbitrage engine scanning for cross-exchange price dislocations and triangular arb opportunities — and executing within milliseconds before the opportunity closes.

    Architecture: WebSocket price feed aggregation from 6 exchanges into in-memory price matrix, opportunity scanner running every 10ms, execution router sending orders to cheapest exchange simultaneously, slippage guard cancelling execution on adverse fill.

    Outcome: 200+ arb trades executed per day, average capture per trade $12, 68% opportunity win rate (vs 45% baseline), annualised return 31% on deployed capital.

Frequently Asked Questions

What exchanges can you connect to?

Any exchange with a REST and WebSocket API. We have built connectors for Binance, Bybit, OKX, Kraken, Coinbase, Deribit and others. For institutional clients requiring FIX connectivity, we build or integrate FIX engines.

How do you handle exchange API changes?

Exchange APIs change — sometimes with short notice. We version-control adaptor code separately from OMS logic, maintain integration test suites against exchange sandboxes, and monitor for exchange API deprecation announcements. We also build in configuration-driven rate limits so API limit changes do not require a code deploy.

Can the engine support multiple asset classes?

Yes. The OMS and position engine are asset-class agnostic — the exchange adaptor handles asset-specific normalisation. Spot, futures, options and perpetuals can be managed in the same OMS with asset-class-specific position calculation logic.

How do you handle partial fills?

Partial fills are tracked as fill events against an open order. The OMS maintains remaining quantity, average fill price, and total fees paid. Parent orders (bracket, OCO) are updated based on partial fill state. Slippage is calculated against the order arrival price.

What matching algorithms do you implement?

We support multiple execution and matching algorithms: Price-Time Priority (FIFO) for standard competitive markets, Pro-Rata allocation for institutional fixed income/derivatives, and volume-weighted allocation. We also build custom order routing logic including Iceberg orders, TWAP (Time-Weighted Average Price), and VWAP algorithms.

How do you minimize latency and jitter in high-frequency trading (HFT)?

We optimize the engine using memory-aligned C++ / Rust data structures, cache-friendly CPU cache line layouts, zero-allocation matching paths during hot-loop execution, kernel bypass networking (Solarflare OpenOnload / DPDK), and dedicated CPU core pinning to maintain sub-10-microsecond matching latency.

What pre-trade risk controls and fat-finger protections are enforced?

Every inbound order passes through an inline, microsecond risk engine before hitting the order book. The system validates account margin adequacy, price collars (rejecting orders deviating excessively from current mid-price), maximum notional order sizes, short-selling restrictions, and credit limit utilization in real time.

Can the trading engine connect with FIX Protocol and low-latency WebSockets simultaneously?

Yes. We architect dual gateway topologies: FIX 4.2 / 4.4 / 5.0 engines for institutional broker and proprietary trading desk integration, alongside ultra-high-concurrency binary or JSON WebSocket gateways for retail and programmatic algorithmic traders.