Skip to content
Back to the galaxy

Case study · 2026

In development

Phantom AI

A market-intelligence platform for traders: deterministic technical analysis, a 0–100 confluence score, backtesting and paper trading — with an AI analyst that explains the calculated data and never invents it.

Role
Design & full-stack development
Year
2026
Stack
Next.js 16, TypeScript, FastAPI · Python 3.12, Supabase + RLS, OpenAI API, Lightweight Charts
Phantom AI — Market workspace

01

Project Overview

Phantom AI is a research, risk-management and decision-support platform for traders. A Python engine calculates indicators, market structure and a 0–100 Confluence Score from closed price bars; an AI analyst then explains those results in plain language. It is not a trading bot: it doesn't place real-money trades, promise profit or predict prices.

02

Problem

Trading tools tend to do one of two things: show raw charts and leave the interpretation to you, or hand out confident signals with no evidence behind them. AI makes the second problem worse, because a language model will happily invent numbers. I wanted a tool where every statement can be traced back to data.

03

Solution

A strict order: data, then deterministic calculations, market structure and risk, then AI interpretation, then your decision. The model only sees a compact, hashed summary of results computed in Python, and its reply is checked before it's shown — every number must exist in that summary, and certainty, probability and trade-instruction language is rejected. Every market component is labelled LIVE, DELAYED, DEMO or STALE with its timestamp.

04

My Role

Design & full-stack development

  • Next.js 16 web app: charts, analysis panels, scanner, backtesting, paper trading and journal
  • FastAPI service with a market-data layer for Coinbase, Twelve Data and a labelled demo generator
  • Analysis engine in Python: indicators, swing structure, zones, regimes and the Confluence Score
  • AI pipeline with schema validation, number checking and an audit record for every analysis
  • Supabase auth and Postgres with row-level security on every table
  • Risk engine, bar-by-bar backtester and server-filled paper trading with exact decimal maths
  • Automated tests across the API, engine, database policies, web app and end-to-end flows

05

Tech Stack

  • Next.js 16
  • TypeScript
  • FastAPI · Python 3.12
  • Supabase + RLS
  • OpenAI API
  • Lightweight Charts

Connected planets

06

Key Features

  • 01

    Confluence Score

    A 0–100 agreement score for each side from seven documented components, each with its evidence — labelled everywhere as not a probability.

  • 02

    Market structure

    Swings, breaks of structure, changes of character, support and resistance zones, fair value gaps, liquidity sweeps and order blocks, all calculated on closed bars.

  • 03

    Grounded AI analyst

    Explains the calculated analysis. Every number in its text must exist in the data it was given, otherwise the reply is withheld.

  • 04

    Scanner, alerts and risk

    Markets ranked by score, alerts evaluated on the server, and position sizes rounded down so the risk never exceeds the target.

  • 05

    Backtesting

    Strategies stored as validated rules, simulated bar by bar with trading costs, and reported in-sample, validation and out-of-sample.

  • 06

    Paper trading and journal

    Simulated accounts where the server, never the browser, decides the fill price — plus a journal with statistics and confidence intervals.

07

Screenshots

Phantom AI — Confluence Score and setup rules
Confluence Score and setup rulesThe score for BTC/USD with its seven components. No setup qualified on this timeframe, and the panel lists exactly which rules failed.
Phantom AI — Technicals, structure and liquidity
Technicals, structure and liquidityIndicators at the last closed bar, structure with the evidence behind it, and support and resistance zones with touches and distance.
Phantom AI — Strategy builder
Strategy builderA strategy is data, not code: entry and exit rules built from a fixed set of indicators and operators, validated live by the server.
Phantom AI — Backtest results
Backtest resultsOne year of BTC/USD on the EMA crossover template: equity and drawdown, then metrics split into in-sample, validation and out-of-sample. This template lost money, and the report shows it.
Phantom AI — Risk calculator
Risk calculatorPosition size for a trade risking 1% of a 10,000 USD account: 0.06 BTC, rounded down so the loss at the stop stays under 100 USD.
Phantom AI — Paper trading
Paper tradingA simulated account with an open BTC/USD position. The server filled the order at the price it observed, with modelled spread, slippage and commission.

08

Challenges

  1. 01

    Keeping the AI honest

    The reply is validated against a schema, every number is checked against the calculated data, and banned wording triggers one corrective retry. If it still fails, nothing is shown.

  2. 02

    No peeking at the future

    Calculations never use the bar that is still forming. Backtests decide on closed bars and fill at the next open, and tests prove that adding later data never changes earlier results.

  3. 03

    Never inventing data

    When a provider fails, the interface says the data is unavailable instead of substituting sample values. Demo data is watermarked on the chart itself, so a screenshot can't pass as real.

09

What I Learned

  • A language model is most useful when it explains numbers, not when it produces them.
  • Exact decimal arithmetic and the direction of rounding matter as soon as money is involved.
  • Access rules belong in the database, not only in application code.
  • Showing “unavailable” is better than showing a guess.

10

Result

Seven phases built so far — from market data and the analysis engine to backtesting, paper trading, a machine-learning lab and chart-image reading — covered by more than 630 automated tests.

Phases built
7
Automated tests
630+
Instruments
8

Next mission

Avelon Crypto

A crypto portfolio tracker with one Spring Boot 3 backend and two front ends — a server-rendered Thymeleaf app and a Vue 3 single-page app — secured with sessions and JWT.

Read case study
Avelon Crypto — Portfolio dashboard