Dio; Design and Rationale¶
Survivability as a Strategy
Diophant Solutions 2026
Dio is open-source, MIT licensed trading infrastructure: capital sizing, order handling, venue connectivity, and capital accounting. How you trade is yours to decide, expressed as a strategy file the engine loads and validates at startup. A ladder strategy is included as a worked example, and it is the one running publicly on diophantsolutions.com.
The pages below cover the engine, the strategy layer, and the reasoning behind both: the design decisions, the trade-offs behind them, and the assumptions the approach rests on. They are written for operators and integrators who want an accurate picture before risking real capital, and for anyone intending to modify or extend the system. Operational detail lives in the Using Dio section of this site and is not repeated here.
The engine is four layers. A Capital Oracle sizes each asset from its own recorded history, deriving a survivability budget from the worst decline that asset has ever produced and verifying candidate parameters by replaying them against that history. An order path handles rounding, lot sizing, minimums, deduplication, time-in-force recovery, and the accounting that keeps resting orders consistent with what the exchange holds. Connectivity adapters translate an abstract order book into native venue APIs and normalize balances. A runtime isolates each asset in its own domain, supervises the oracle, and persists accounting state across restarts.
A strategy uses those layers: a file in a declarative script language, bound to assets by name in configuration. Sizing arrives as a four-field decision record, and everything that defines an approach belongs to the strategy. The default ladder holds fully backed spot inventory. Overlay strategies can add venue derivatives with explicit quote reservation, position/margin monitoring, and reduce-only risk stops; the engine adds no hidden leverage and does not rely on market orders to get filled. It is built on OCaml 5.2 with domain-based parallelism, running each asset in its own isolated domain with lock-free communication.