Introduction #
There was a quant trading competition with synthetic stocks and a simulated market. We were allowed to make decisions using any math based tool. So I built a tool for the trading rounds. Much of the competition (as the package for the simulation admitted) was going to be shock rounds: news would be sent out, and we had to trade as the markets shifted to how a certain sector (industry, software, biotech, financials, oil, shipping etc.) responded to that shock.
Now, the market was supposed to be composed of random noise, index drift, and the shocks from the news. If we think about it in this way, it is essentially a pond with some random noise and slight ripples from motion and then from periods of time, a stone is thrown inside the pond (the shock). How do you model that?
I used a few things to build this: my general knowledge of Green functions (first applied to this by Jean-Philippe Bouchaud in his Propagator Model), dirac deltas (though these weren’t necessary as I later found out we had no continuous events, only discrete ones and was drawn from this helpful guide) and an exponential decay kernel based on the work of Obizhaeva and Wang (2013). Huge inspirations were drawn from their work, and this project would not have gone anywhere if I didn’t have such great help- the internet’s a wonderful thing.
We weren’t allowed an API to interact with the model, and hence this was intentionally a single-file Julia terminal system- compiled and ready to operate on every input in 3-5 seconds. We were also not allowed an API to interact with the market. But I engineered a model for the headlines: for difficult headlines it calls Llama 3.2 3GB with a fine-tuned prompt to return sector + direction + rough magnitude in response to complex headline topics.
The way it would work #
This was the loop of events
- headline arrives,
- identify sector + direction + rough magnitude- or do it via Ollama
- get current marks into the model,
- compute fair values and sizing immediately,
- call the trade,
- manage the decay and exit before the edge disappears.
The competition also constrained what was worth building. Everything had to stay manual-input and operator-driven. No simulator automation, no browser scripting, no fake “autonomous trading” nonsense. So Tachyon became a decision-support system for a two-person workflow: one person watches the simulator and executes, the other runs the model and makes the call.
Why I built it #
The goal was competition performance, not pretty infrastructure.
- I needed a faster reaction loop than “read headline -> think from scratch -> trade.”
- I needed consistent sizing with hard risk limits.
- I needed state persistence so a restart would not nuke inventory context mid-session.
- I needed something that matched the actual rules of the game instead of pretending this was a normal trading system.
Runtime loop #
At runtime, the loop is:
- When news arrives Two fast input paths drive the system:
- Structured shock input:
ENG + 150 70.50 55.20 - Headline input: free text with optional trailing prices, classified by local Ollama
- update exposed ticker marks from appended prices,
- append a
Shockinto active state, - recompute fair values and trade actions,
- confirm fills (full, partial, or skip),
- run a second-by-second decay loop with overshoot checks,
- keep doing this until the next event.
If you’re really interested in the math, check out the blog post.
Operator workflow #
The parser strips trailing numeric tokens as prices, then interprets the remaining text as either a structured sector shock or a headline. For headlines, Ollama classifies sector and direction, and I still enter magnitude manually in bps.
After every event, the tool prints a full recommendation table and prompts fill confirmation ticker-by-ticker.
Stack #
- Julia (single-file terminal app:
trading_tool.jl) - HTTP.jl + JSON3.jl for Ollama calls and state serialization
- Local Ollama model routing with runtime model switch support