Koda — Execution Engine
Koda handles precision trade execution with optimal timing, order routing, and slippage management.
Overview
Koda is the Execution Agent. Once Riven has designed a strategy, Koda handles the critical task of turning that strategy into actual positions on exchanges. Good execution can be the difference between a profitable strategy and a losing one — Koda ensures that every order is placed with precision.
Execution Capabilities
Intelligent Order Routing
Koda evaluates execution conditions across all connected exchanges and routes orders to the venue offering the best combination of:
- Liquidity depth at the target price level
- Current spread width
- Exchange fee structure
- Funding rate conditions
- Historical fill quality
Order Type Selection
Based on market conditions and urgency, Koda selects the optimal order type:
- Limit orders — Used when time isn't critical and price improvement is available
- Market orders — Used when speed is more important than price
- TWAP (Time-Weighted Average Price) — Splits large orders across time to minimize impact
- Iceberg orders — Hides total order size to reduce information leakage
- Conditional orders — Triggered by specific price or condition events
Slippage Management
Koda monitors and minimizes slippage through:
- Pre-trade impact estimation based on order book depth
- Dynamic order sizing to stay within optimal impact zones
- Real-time fill monitoring with automatic adjustment
- Post-trade slippage analysis fed back to improve future execution
Timing Optimization
Koda doesn't just execute immediately — it evaluates whether timing can improve outcomes:
- Volatility-aware timing — Avoids executing during high-spread periods
- Volume pattern analysis — Times executions for historically liquid periods
- Event avoidance — Delays non-urgent executions around scheduled events
- Cascade detection — Pauses during liquidation cascades that would cause excessive slippage
Execution Reports
Every execution generates a detailed report including:
- Requested price vs. fill price
- Slippage analysis and attribution
- Exchange selection reasoning
- Order type selection reasoning
- Timing decisions and their impact
Configuration
- Execution urgency — Default priority level (speed vs. price improvement)
- Max slippage tolerance — Hard limit on acceptable slippage per trade
- Preferred exchanges — Priority ordering for venue selection
- Order splitting — Rules for breaking large orders into smaller pieces
- Retry policy — How Koda handles failed or partial fills