TradeCraft AI

Inspiration

At our first hackathon, we built a beginner-friendly AI trading system (runner-up prize). It taught us that AI's probabilistic nature is risky when placed directly in financial decision-making, the same market conditions should produce the same explainable outcome. So we redesigned the architecture: AI handles research and strategy improvement, while a deterministic engine handles trading decisions.

What it does

TradeCraft AI is a fully automated, self-improving quantitative trading system that separates strategy development from trading execution.

  • Deterministic trading engine: evaluates market data using fixed quantitative rules, producing only mechanical outputs (LONG, SHORT, veto, no action). Position sizing, leverage, stop-losses, take-profits, backtesting, scoring, and live execution are all rule-based, no AI involved.
  • AI research layer: every night, the system automatically reviews new quant finance research, diagnoses strategy weaknesses, and uses Codex to propose improvements.
  • Automated promotion pipeline: each candidate strategy is compiled, sandboxed, tested for determinism and look-ahead bias, backtested, stress-tested, and validated on holdout data, with zero manual intervention. Only strategies that pass every gate get promoted; otherwise the current strategy stays untouched.

This end-to-end automation lets the system learn and evolve continuously while keeping every real trading decision deterministic, testable, and explainable.

How we built it

Full-stack TypeScript app:

  • Backend: Node.js + Express, node-cron for scheduled/automated jobs, better-sqlite3 for storage, Axios for the Binance Futures API.
  • AI layer: OpenAI Codex via a headless app-server workflow; generated code is type-checked (TS Compiler API, strict mode) and run in isolated worker_threads/VM sandboxes.
  • Frontend: Next.js 15, React 19, Tailwind CSS, Lucide icons; Zod for schema validation.
  • Testing: Vitest with strict TypeScript checks; tsx for dev, tsc for builds; supports Binance Testnet and production.

Challenges we ran into

Isolating Codex execution was our biggest hurdle: running AI-generated code directly in our main environment risked corrupting state and breaking deterministic logic. We built a sandboxed runtime with strict memory/state boundaries to safely automate this execution without touching core operations.

Accomplishments we're proud of

Building a largely self-sustaining, automated research-and-strategy pipeline that's both safe and measurable; combining AI-driven innovation with fully deterministic trading decisions.

What we learned

Using AI for automated R&D rather than direct decision-making is more reliable and safer in high-stakes systems.

What's next

Refine quant resources and UX, let users upload their own papers to test custom strategies, and fine-tune a finance-specialized model.

Built With

Share this project:

Updates

Submission history