← Back to the case studies

PreDEX

I wanted to find out what a trading terminal could do with a capable research assistant built into it.

Architect & sole engineer

0
Trades the AI executed
1,020
Automated tests
5
Live services
~10 wks
Solo build
Where it started

If a position exists, I want to be able to explain why. That requirement shaped the whole platform, including the parts the AI isn't allowed to do.

From a hunch to a strategy

Dex, the assistant inside PreDEX, works across market research, strategy design, backtesting, and review. It can watch news and market feeds, score sentiment, and help turn a loosely worded idea into a strategy with parameters you can inspect.

I wanted it to be useful both when I'm exploring a vague question and when I'm comparing a whole fleet of experiments. Giving it access to the platform's data and tools was much more useful than adding a chat box beside the charts.

Where orders come from

Every position traces to a deterministic strategy evaluated against a saved parameter set, or to an order I placed manually. Dex's write tools produce proposals with approval cards. They don't execute trades.

Strategies move through an L0–L5 promotion ladder. Each promotion records its hypothesis, parameters, and parent lineage against a fleet epoch, so I can trace a live strategy back to the idea that started it.

Five services underneath

A Next.js terminal sits in front of a market-data hub, a strategy runtime, an execution gateway, and a news service. The hub subscribes to Hyperliquid and Paradex over WebSocket. The runtime runs four strategy archetypes and the backtest engine. The gateway is the only service with access to the live account.

Postgres holds the state. The order-management layer and a 30-second reconciler check what the runtime intends against what the database and exchange actually report. News is scored for sentiment per instrument.

The Stop button that didn't

An early bug let fills continue landing for roughly thirty seconds after I hit Stop. An asynchronous dispatch was already in flight. The fix was a synchronous halt flag checked at the execution boundary.

That was a useful reminder of where to spend engineering time. The AI can produce a convincing analysis; the system still needs to stop when you ask it to. A separate plumbing audit also caught three cross-venue data gaps before they could reach a live order.

A closer look

On the parts list

TypeScriptNext.jsPostgresAnthropic ClaudeTavilyTurborepoRailway
More from the collection