Skip to main content

Core Architecture

Von Neumann Architecture (Design Principle) The foundational design principle behind ClyptQ’s engine. Just as the Von Neumann architecture separates stateless computation (CPU) from stateful memory (RAM) connected by a control unit, ClyptQ separates stateless Operators from the stateful StatefulGraph, connected by the TradingDriver. This separation is what makes Research = Backtest = Live possible. Architecture Overview → TradingSpec The complete strategy definition: data + strategy + execution mode. Changing mode is all it takes to go from backtest to live. Full Reference → TradingDriver The runtime orchestrator. Reads a TradingSpec, computes warmup, and runs the tick loop. Architecture Overview → StatefulGraph A DAG execution engine where operators are stateless and the graph manages all state via RollingBuffers. Deep Dive → Operator A stateless computation unit that receives TaggedArrays and returns a TaggedArray. ClyptQ ships operators across 14 roles. Operator System → BaseOperator The abstract base class all operators inherit from. Requires implementing compute() and declaring a role. Protocol Reference → OperatorRole One of 14 roles (ALPHA, INDICATOR, TRANSFORM, OPTIMIZER, etc.) that categorizes what an operator does. Role Table →

Data Concepts

FIELD Market data namespace: FIELD:exchange:market:ohlcv:field. The only way operators receive market data. FIELD & STATE → STATE Portfolio data namespace: STATE:exchange:market:key. Updated by the executor after each fill. FIELD & STATE → TaggedArray 4-field data structure (value, exists, valid, updated) that distinguishes missing data from invalid data. Why 4 Fields? → RollingBuffer Pre-allocated circular buffer that stores historical data for each operator input. Prevents lookahead by only exposing the declared lookback window. Lookback Buffers → SymbolSourceMap Maps symbols to exchanges: {"binance:futures": ["BTC/USDT", "ETH/USDT"]}. Determines which symbols appear in each FIELD source. TradingSpec → AxisMeta Frozen metadata about the symbol dimension — symbol names, exchange sources, index mappings. TaggedArray → Input Declaration of what data an operator needs: Input(source, timeframe, lookback). Tells the graph how to set up buffers. StatefulGraph → Forward-Fill When no new data arrives for a FIELD source, the last known value is reused with updated=False. FIELD & STATE →

Execution Concepts

Intention Target portfolio state produced by ORDER operators: “I want 0.5 BTC long.” Execution Pipeline → Delta The difference between current position and target: “I need to buy 0.3 BTC.” Execution Pipeline → BacktestFactory / LiveFactory Fill engines. BacktestFactory simulates fills against historical data. LiveFactory sends real orders via CCXT. Architecture Overview → Warmup Pre-execution period where the graph processes ticks to fill RollingBuffers before generating trading signals. Computed automatically by tracing the graph backward. StatefulGraph → Ephemeral Operator An operator that calls external APIs (LLM, web search). Cannot reproduce outputs for backtesting. Only runs in paper/live mode. Semantic Operators →

Platform Concepts

Code Parity The guarantee that the same graph runs identically in backtest, paper, and live modes. Only the data source and fill engine change. Deep Dive → Cross-Exchange Validation Platform tests strategies on exchange data the builder never saw, proving the strategy isn’t overfit to a single venue. Marketplace → Trading Commerce The marketplace model: builders create strategies, platform verifies them, traders deploy them. Marketplace →

Backtesting Concepts

Lookahead Bias Using future data in backtesting. ClyptQ prevents this structurally via RollingBuffers. Prevention → Funding Rate Periodic payment between long/short holders in perpetual futures. Simulated at settlement boundaries. Funding Rates → MMR (Maintenance Margin Ratio) Minimum equity required to keep a leveraged position open. Varies by exchange and position tier. Liquidation Logic → CostModelSpec Configuration for maker/taker fees, slippage, and funding rate overrides. Auto-fetched from exchanges if not specified. Cost Models →