Video in the works
XQuant
The real demo from September 2025, losses included.

About the project
Describe a crypto trading strategy in a chat. An AI agent turns it into rules and code, then tests how it would have done on real past prices from Binance.
XQuant lets you describe a crypto trading strategy in plain English. An AI agent turns it into rules, writes the code, and backtests it on real Binance data, asking your permission before each step.
I built it with Ashutosh Pradhan and a TermiX colleague, starting from a Chinese codebase that I translated. The whole flow worked in the demo. The strategies didn't: they lost money, and we stopped.
How it works
Describe
Chat about the strategy you want.
Approve each step
Every tool call waits for you: create rules, generate code, backtest, analyse the market, save.
Rules, then code
The AI fills a strict strategy format, then writes code from it.
Backtest
On real Binance candles, fetched in pages and retried on rate limits.
Read the result
Trades, return and drawdown on the analysis screen.
Under the hood
- Backend
- Node.js and Express, Prisma on Postgres, models through OpenRouter.
- Frontend
- React with Ant Design and Recharts.
- Market data
- The Binance API.
What I did
- A tool-calling chat agent that runs up to 6 rounds, where every tool call waits for the user to approve it
- Five tools: create the strategy rules, generate code, run a backtest, analyse market data, save the strategy
- A strict schema so the AI always returns the same strategy format
- Replaced mock data with real Binance candles, paged and retried on rate limits
- Extended the backtest engine with price sources, volume, arithmetic in rules and breakout operators
- Saved backtests in the database, with REST routes to run and fetch results
- The backtest analysis screen and the chat screen with the approval modal
- Translated the original Chinese codebase into English
What was new
- A human-in-the-loop agent: no tool runs without approval
- A two-step pipeline from plain language to rules to code, with fallbacks when no API key is set
- AI-made strategies often barely trade, and loosening them doesn't make them profitable
Problems I hit, and how I fixed them
The user's message was sent to the AI twice.
Fix Check history before adding it.
Backtests were running on mock data, and asking for ETH loaded BTC.
Fix A real Binance data fetcher with paging and retries.
AI-generated strategies stacked so many conditions that they made zero trades.
Fix A relaxer that loosens the rules. In hindsight it changes the user's strategy before testing, which I would do differently.
Saving a strategy crashed on a wrong field name.
Fix Renamed the field.
The strategies lost money: -8.8% and -7.5% in the demo, and the AI called one "profitable" before testing it.
Fix Not fixed. We stopped.
Screenshots
Screenshots in the works
Real screens from XQuant go here.