2026Co-Author
Latency-Aware Execution Engine
Breaking a large crypto order into child trades is a losing game against your own market impact: trade too fast and you push the price against yourself, trade too slow and you drift from your target, and the naive schedules most people fall back on bleed cost the whole way.
The result
Beat TWAP by 10.2 basis points on Bitcoin in walk-forward testing (+3.5 bps averaged across three assets), and cut execution cost 96.7% versus immediate execution.
An end-to-end trade-execution engine that decides how to slice a large order over time to keep cost low. It pairs classical forecasting models (Linear Regression, Random Forest, XGBoost) with a Double DQN reinforcement-learning agent (dueling architecture, prioritized experience replay), and it prices the cost of its own trading through the Almgren-Chriss market-impact model. Everything is validated against 98 million real market trades across three assets.
- vs TWAP (BTC)
- +10.2 bps
- Cost reduction
- 96.7%
- Validation
- 98M trades
- Tests / Ablations
- 176 / 17
Where it wins, and where it does not
The headline number is Bitcoin. Walk-forward across all three assets, the picture is uneven, and the unevenness is the interesting part: the agent's edge tracks how much liquidity there is to hide in.
| Asset | Versus TWAP, walk-forward |
|---|---|
| BTCUSDT | +10.2 bps, winning 75% of orders. The deepest book of the three. |
| ETHUSDT | +0.6 bps, winning 65% of orders. Positive, but close to noise. |
| SOLUSDT | -0.2 bps, winning 12% of orders. The agent loses here. |
| Average | +3.5 bps across the three, so the mean is well below the Bitcoin figure. |
Two things follow, and both are worth saying plainly. The edge is real but concentrated: quoting only the Bitcoin number would describe one asset as though it were the result. And the agent does not beat VWAP, which is the stronger baseline (-0.5 bps on average), so what it demonstrably beats is TWAP. My reading of the gap is liquidity: on a deep book there is room to wait for a better price, and on a thin one almost any deviation from a steady schedule costs more than it saves, which is also why the win rate collapses rather than drifting.
Architecture
Market data
98M real trades, 3 assets
Forecast layer
Linear Regression, Random Forest, XGBoost
Double DQN agent
dueling + prioritized experience replay
Execution schedule
Walk-forward evaluation
vs TWAP, vs immediate
Market data feeds a forecast layer where the classical models estimate short-horizon price and cost. Those forecasts, together with an Almgren-Chriss estimate of how much the engine's own trading will move the price, become the state the Double DQN agent reads. The agent chooses a child-order schedule, and every run is scored with walk-forward validation against TWAP and an immediate-execution baseline, so the numbers reflect trades the model never saw during training.
Key decisions and trade-offs
Classical models plus a Double DQN agent, not one or the other
Linear Regression, Random Forest, and XGBoost are cheap, stable, and easy to sanity-check for short-horizon forecasting, but they do not plan a sequence of dependent actions. The Double DQN agent handles the sequential decision (how much to trade now versus later) while leaning on the classical forecasts as features, so the system gets interpretable signals and learned timing instead of having to choose between them.
Almgren-Chriss for market impact
Rather than assume trades fill at the quoted price, the engine prices its own footprint with a well-studied closed-form impact model. That gives the agent an honest cost to trade against and keeps it from learning schedules that only look good because they ignore slippage.
Double DQN with a dueling head and prioritized replay
The agent is a Double DQN, which decouples action selection from value estimation to curb the overestimation bias plain DQN is prone to. A dueling head splits state value from action advantage, which helps when many timing choices have near-identical value. Prioritized experience replay then concentrates training on the rare, high-error transitions (the sharp adverse moves) instead of the calm majority.
Walk-forward validation on real trades
Results come from 98 million real trades across three assets, evaluated walk-forward so the model is always tested on the future relative to its training window. That is the difference between a backtest that flatters itself and one that survives contact with unseen data.
Results
- Beats TWAP by 10.2 basis points on Bitcoin, winning 75% of orders (walk-forward).
- Across all three assets the average is +3.5 bps, and on the thinnest book it loses to TWAP.
- Does not beat VWAP, the stronger baseline, at -0.5 bps on average.
- 96.7% cost reduction versus immediate execution (the naive baseline).
- Validated on 98 million real market trades across 3 assets.
- 17 ablation studies, 176-test suite.