Inspiration:

I was inspired from the interactive 3D world building games I used to play on my phone. When I heard the theme was the heist, I wanted to incorporate this past passion into something useful and innovative.

What it does

A live 3D city for catching financial heists as they happen.

Every building is an account. Every glowing pulse is a transaction. SQL detectors running inside Tiger Data flag suspicious money movement within seconds. An AI investigator traces the money and writes a case file that cites the exact transactions it used. You can also rewind the city like security footage, all the way back into the compressed archive.

Layers:

Ingestion Layer: Transactions enter three ways: a live simulator that streams normal payments and can inject heists on demand, a backfill script that loads weeks of realistic history, and a CSV importer that rebuilds the city from a ledger or bank statement.

Storage (Tiger Data) Layer: Every transaction lands in a time-partitioned hypertable. Older chunks are compressed into "the vault," and continuous aggregates keep per-minute, 5-minute, hourly and daily rollups up to date automatically.

Detection Layer: Three SQL functions run inside the database every 5 seconds, catching velocity bursts, structuring and round-trip laundering. They compare recent activity against rolling baselines and write deduplicated alerts, each stamped with the transaction that tripped it and how fast it was caught.

Investigation (agent) Layer: New alerts are grouped by triage so one heist means one investigation. A LangGraph agent on Groq then queries the data through four read-only SQL tools and writes a case file. Every transaction ID it cites is checked against what the tools actually returned, and finished reports are cached per incident.

API: FastAPI connects everything. It runs the detector loop and agent worker in the background, pushes events, alerts and reports to the browser over a WebSocket, and serves REST endpoints for the inbox, rewind, stats, term report and CSV import.

Visualization Layer: A React Three Fiber city shows accounts as buildings and transactions as pulses. Around it are the alert inbox, case files, a scrubber that replays any past moment from the aggregates, a stats bar showing compression and query speed, and a monthly spend report for the treasurer.

How I built it

Frontend: Vite, React 19, TypeScript, React Three Fiber, drei, @react-three/postprocessing and Tailwind CSS 4 to render the live 3D city, where accounts are buildings and transactions are glowing pulses, along with the alert inbox, case files and rewind scrubber.

Backend: Python 3.12, FastAPI, WebSockets, and psycopg 3 with psycopg_pool to run the fraud detectors every few seconds, stream live transactions and alerts to the browser, and serve the inbox, rewind, CSV import and reporting endpoints.

Database: Tiger Data (TimescaleDB) to store an organization's transactions over time in a compressed hypertable, detect fraud with SQL running inside the database, and power fast rewind and reporting queries through continuous aggregates.

AI Agent: LangGraph and LangChain Groq to build an investigator agent that queries the database through read-only tools, traces how money moved during suspicious activity, and writes a report citing the exact transactions as evidence.

Challenges I ran into

Challenge #1: The main challenge was to develop a 3D interface for this application. It was kind of my first time working with such an aspect of an application. I also had trouble integrating the frontend with my backend.

Challenge #2: I also trouble engineering a data ingestion pipeline that can use imported data to generate "3D cities". Instead, I used sample data that I configured to the frontend to demo the pipeline

Accomplishments that I'm proud of

I'm proud to have utilized real-time databases and 3D visual layout to create an accessible and interactive tool for organizations, such as student organizations and small businesses, for such a useful and necessary case that is stressed enough nowadays.

What's next for The Ledger

Create an authentication aspect to secure an organization's financial activities from any external sources

Perfect the data ingestion pipeline to handle various forms of data rather than just simple CSVs.

Built With

Share this project:

Updates

Submission history