System Architecture

KEK is designed as a validation layer that sits between strategy generation and capital deployment. Its architecture enforces thorough testing before any optional execution, with clear separation between intelligence, validation, and custody.

What this covers

  • KEK's layered architecture and design philosophy
  • How validation separates from execution
  • The Memory Layer for persistent AI context
  • Data flow and system boundaries
  • The meta-learning feedback loop
  • Custody separation and non-custodial design

Architectural overview

KEK is structured in distinct layers, each with specific responsibilities:

  1. Products Layer — User-facing interfaces (Terminal, Mix, DEX)
  2. Intelligence Layer — Strategy generation, knowledge processing, and memory systems
  3. Validation & Execution Simulation — Backtesting, paper trading, and time-series storage
  4. Meta-Learning & Drift Tracking — Performance monitoring and refinement
  5. Deployment Gate — Validated strategy approval checkpoint
  6. Execution & Custody — Optional, non-custodial trade execution (external)

Each layer maintains clear boundaries. Intelligence produces strategies. Validation tests them. Execution is optional and requires explicit user authorization.

Core Design Principles

Validation-First

No strategy reaches execution without passing through validation stages:

  • Backtesting tests strategy logic against historical data
  • Paper trading simulates execution under real market conditions
  • Monitoring tracks performance and detects drift

Validation outputs inform user decisions. They do not guarantee future performance.

Separation of Concerns

Each layer has a single, well-defined purpose:

  • Intelligence generates machine-readable strategies
  • Validation tests strategies without deploying capital
  • Execution is handled by external, non-custodial infrastructure
  • Meta-learning refines generation based on observed outcomes

This separation ensures KEK does not custody funds, initiate trades autonomously, or blend strategy generation with execution.

Non-Custodial by Design

KEK never controls user funds or private keys:

  • Validation runs entirely in simulation
  • Execution happens via external infrastructure (e.g., Orderly Network)
  • Users authorize trades explicitly through their own custody solution
  • KEK provides intelligence and validation, not custody or execution

Execution is Optional

Strategies validated through KEK may be used in multiple ways:

  • Manual trading informed by validated signals
  • External bots consuming KEK strategy specs
  • Optional live execution via non-custodial DEX integration

Users decide if, when, and how to deploy capital. Validation does not imply a commitment to execute.

Layer Details

Products Layer

Purpose: User interfaces for strategy lifecycle management

  • KEK Terminal — Research, validation, monitoring interface
  • KEK Mix — Strategy generation and optimization engine
  • KEK DEX — Optional execution and community layer

Products coordinate workflows but do not execute trades autonomously.

Intelligence Layer

Purpose: Generate machine-readable strategies using domain knowledge and multi-agent coordination

The Intelligence Layer orchestrates KEK's AI capabilities through several interconnected systems:

MCP Agent Server

The Model Context Protocol (MCP) is an open standard that enables secure connections between AI systems and external data sources. KEK's MCP Agent Server orchestrates specialized agents through three primitives:

  • Tools — Executable functions that agents can invoke (query data, run analysis, generate strategies)
  • Resources — Read-only data sources (market feeds, knowledge bases, performance metrics)
  • Prompts — Templated workflows for common operations (strategy analysis, risk assessment)

This coordination model ensures agents share context consistently and operate through structured interfaces rather than hidden state.

Knowledge Network

The Knowledge Network provides domain-specific intelligence including market regime analysis, narrative tracking, and signal aggregation. It supplies structured context to all agents through the MCP interface.

Memory Layer

The Memory Layer provides persistent context through two complementary systems:

  • Mem0 — User and agent memory for preferences, past outcomes, and personalized context (sub-50ms retrieval)
  • Graphiti — Temporal knowledge graph for time-aware facts and evolving relationships (bi-temporal model)

Memory enables agents to maintain context across sessions without exceeding context window limits. For detailed documentation, see Memory Layer.

Strategy Synthesis

Intelligence outputs are deterministic, machine-readable strategy definitions (JSON specs). They describe intent, not execution commands.

Validation & Execution Simulation

Purpose: Test strategies without deploying capital

The Validation Layer ensures no strategy reaches execution without rigorous testing:

Backtesting Engine (VectorBT)

KEK uses VectorBT for high-speed strategy evaluation. VectorBT's vectorized approach enables testing thousands of parameter combinations simultaneously — 1,000,000 backtests can complete in approximately 20 seconds. This enables:

  • Rapid parameter optimization across large search spaces
  • Walk-forward analysis to prevent overfitting
  • Multi-objective evaluation (Sharpe, Sortino, max drawdown, etc.)

For high-fidelity simulation requiring event-driven execution realism, KEK also uses Nautilus Trader.

Paper Trading

Real-time simulation under live market conditions validates:

  • Signal timing and execution behavior
  • Slippage and liquidity sensitivity
  • Strategy stability across regime transitions

Time-Series Database (TimescaleDB)

All validation artifacts are stored in TimescaleDB, a PostgreSQL extension optimized for time-series data:

  • Hypertables — Automatic time-based partitioning for fast queries
  • Compression — 90%+ storage reduction for historical data
  • Continuous aggregates — Real-time materialized views for monitoring dashboards

This serves as KEK's source of truth for strategy records, backtest outputs, paper trading metrics, and monitoring signals.

Risk Controls

Validation enforces leverage limits, position sizing constraints, and drawdown thresholds before any strategy becomes eligible for execution.

Simulation results are not guarantees of live performance.

Meta-Learning & Drift Tracking

Purpose: Monitor performance and refine strategies over time

  • Performance Snapshots — Periodic tracking of key metrics against baselines
  • Drift Detection — Identifies performance degradation or regime changes using statistical methods
  • Refinement Jobs — Triggers reoptimization or variant generation when drift exceeds thresholds
  • Feedback Loop — Informs intelligence layer with observed outcomes

Meta-learning improves generation quality but does not promise continuous profitability.

Deployment Gate

Purpose: Explicit approval checkpoint before execution eligibility

Strategies that pass validation enter the Deployment Gate, which:

  • Locks approved strategy versions and execution parameters
  • Requires explicit user permission before proceeding
  • Maintains clear separation between validation and execution

Execution & Custody

Purpose: Optional, user-authorized trade execution via external infrastructure

KEK integrates with Orderly Network for non-custodial execution. Orderly uses a three-layer architecture:

Asset Layer (User Custody)

User funds remain in smart contract vaults on their native chain (Arbitrum, Optimism, Base, Solana, etc.). Only the user's wallet signature can authorize withdrawals.

Settlement Layer (Orderly L2)

An OP Stack-based app-chain maintains the ledger of all transactions, balances, and trading activity. Periodic rollups to Ethereum provide finality.

Engine Layer (Off-Chain Matching)

A high-performance matching engine provides CEX-like speed while all orders require cryptographic signatures verified on-chain.

Custody guarantees:

  • Users retain custody at all times — KEK cannot move funds
  • Every trade requires explicit wallet signature
  • Even if the operator is compromised, funds remain safe (signature verification prevents unauthorized orders)
  • Omnichain trading without asset bridging (only messages cross chains via LayerZero)

Execution is external to KEK's core validation layer.

Data Flow

Strategy Generation to Validation

  1. User inputs define goals, constraints, and preferences (via Terminal)
  2. KEK Mix generates candidate strategies as machine-readable JSON
  3. Strategies are stored in the time-series database (source of truth)
  4. Backtesting runs historical simulations
  5. Paper trading simulates real-time execution
  6. Monitoring tracks performance and drift

Validation to Optional Execution

  1. User reviews validation outputs (backtest results, paper trading metrics)
  2. User decides whether to deploy capital
  3. If executing, user authorizes trades via non-custodial infrastructure
  4. KEK does not execute trades autonomously
  5. Execution layer (external) handles order placement and fills

Meta-Learning Feedback

  1. Performance snapshots are captured periodically
  2. Drift detection compares current vs. expected performance
  3. If drift detected, refinement jobs are queued
  4. Reoptimization generates new variants or adjustments
  5. New candidates enter validation workflow

This loop improves strategy generation over time but does not eliminate risk.

System Boundaries

What KEK Does

  • Generates machine-readable strategies
  • Validates strategies through backtesting and paper trading
  • Monitors performance and detects drift
  • Suggests refinements based on observed outcomes

What KEK Does Not Do

  • Custody user funds or control private keys
  • Execute trades autonomously without user authorization
  • Guarantee strategy performance or profitability
  • Provide investment advice or financial recommendations

Security and Trust Model

KEK's architecture enforces separation between validation and execution:

  • No custody — KEK cannot access user funds
  • No autonomous execution — Trades require explicit user authorization
  • Transparent limitations — Validation outputs do not guarantee future results
  • Open monitoring — Performance drift is tracked and disclosed

Validation reduces uncertainty. It does not eliminate risk.

Capital Strategy

Capital Strategy & Validation Economics

For approved parties, detailed financial modeling and deployment strategy are available in the Investor Room.