Skip to content

dio

dio is an OCaml 5 multicore trading engine. Trading behaviour lives in strategy files: the engine loads a strategy, validates it, and runs it over a registered library of actions. The strategy it ships is a ladder grid that buys dips and sells into reversals, and it runs against Kraken, Hyperliquid, Lighter, Interactive Brokers, and Alpaca.

Each traded asset runs in its own OCaml domain. Order intents funnel through a lock-free executor, market data lands in lock-free ring buffers, and a capital-survival oracle sizes each position from the asset's all-time drawdown history. A terminal dashboard attaches to the running engine over a Unix domain socket, with latency and log views and an alert popup for warnings and errors.

See it running live: the Dio experiment →

This trades real money

dio places real orders and comes with no warranty. Test on a testnet before risking capital. Read the risk and terms before you start.

Quick start

The image is public, on GitHub Container Registry (ghcr.io/malciller/dio-domains) and Docker Hub (malciller/dio-domains). Pull it, extract the starter files, and run it:

IMAGE=ghcr.io/malciller/dio-domains:latest
docker pull $IMAGE
docker run --rm -v "$PWD:/out" --entrypoint cp $IMAGE /usr/share/doc/dio/config.example.json /out/config.json
docker run --rm -v "$PWD:/out" --entrypoint cp $IMAGE /usr/share/doc/dio/.env.example /out/.env
docker run --rm -v "$PWD:/out" --entrypoint cp $IMAGE /usr/share/doc/dio/compose.yaml /out/compose.yaml
# edit config.json and .env for your venues and instruments

docker compose up -d                 # start the engine
docker compose run --rm dashboard    # attach the dashboard (Ctrl-p Ctrl-q to detach)

The deployment guide is a step-by-step walkthrough for first-time users. Configuration reference documents every config.json key and environment variable.

Using Dio

Operational guides and specifications for running the engine. For what the engine is and why it is built the way it is, see Dio; Design and Rationale.

Document Contents
Deploying Docker, compose, building from source, and remote deployment.
Configuration reference config.json keys and environment variables.
Strategy script language Reference for triggers, facts, steps, and the script grammar.
Your first strategy Build, validate, and run a minimal overlay, step by step.
Action glossary The action verbs the runtime handles, plus the older registered names it does not.
Authoring a strategy Wiring a .strategy file into a running engine.
Editor support (VS Code) Syntax highlighting and live validation (dio strategy lsp).
Editor support (Zed) The same highlighting and validation, via the tree-sitter grammar and a Zed dev extension.
Oracle specification The sizing mathematics.
Product specification The full software product specification (DIO-SPS-001).
Risk disclosures Terms of use and how to pull the image.

Source

The source, releases, and issue tracker are on GitHub: https://github.com/malciller/dio-domains. Bug reports and feature requests are welcome there.