A TRM Labs-style fund-flow tracker and Sybil detection tool powered by OpenGradient TEE-verified AI.
Paste any wallet → see every connected wallet → get a cryptographically verifiable risk score.
# 1. Clone / unzip the project, then:
chmod +x start-local.sh
./start-local.sh
# Frontend → http://localhost:3000
# Backend → http://localhost:8000
# API docs → http://localhost:8000/docsWorks in demo mode with zero API keys. Add keys to backend/.env for live blockchain data.
trace-ai/
├── .cursor/rules ← Cursor AI rules
├── .env.example ← copy to backend/.env and fill in keys
├── start-local.sh ← starts both servers with one command
├── frontend/ ← Next.js 15 + TypeScript + Tailwind
│ ├── app/
│ │ ├── page.tsx ← homepage (search)
│ │ └── analyze/[address]/ ← results page
│ ├── components/
│ │ ├── FundFlowGraph.tsx ← canvas graph engine
│ │ ├── RiskCard.tsx ← risk score + signals
│ │ ├── ProofViewer.tsx ← TEE proof display
│ │ └── WalletList.tsx ← connected wallets table
│ └── lib/
│ ├── types.ts ← all TypeScript interfaces
│ └── api.ts ← backend client + demo data fallback
└── backend/
├── main.py ← FastAPI: POST /analyze, GET /health
├── blockchain.py ← Etherscan + Helius fetchers
├── opengradient_agent.py ← OpenGradient SDK + heuristic fallback
├── deploy_workflow.py ← run once to deploy OG workflow
└── requirements.txt
| Key | Link |
|---|---|
| Etherscan | etherscan.io/apis |
| Helius (Solana) | helius.dev |
| OpenGradient | hub.opengradient.ai |
| OG Testnet tokens | faucet.opengradient.ai |
Add them to backend/.env — copy from .env.example.
Run this once after adding your OG_PRIVATE_KEY to backend/.env:
cd backend
source venv/bin/activate
python deploy_workflow.pyCopy the printed contract address into backend/.env as OG_WORKFLOW_ADDRESS.
Frontend → Vercel
- Push to GitHub
- Import repo on vercel.com, set root directory to
frontend - Add env var:
NEXT_PUBLIC_BACKEND_URL=https://your-backend-url.com
Backend → Railway
- Import repo on railway.app, set root directory to
backend - Add all env vars from
backend/.env - Copy the Railway URL into Vercel's
NEXT_PUBLIC_BACKEND_URL
- Frontend: Next.js 15, TypeScript, Tailwind CSS
- Graph: Custom Canvas API force-directed engine (no D3/Cytoscape)
- Backend: Python FastAPI
- AI: OpenGradient SDK (Llama 3.1 8B in TEE mode)
- Blockchain: Etherscan API (EVM), Helius API (Solana)
- Fonts: Syne, Space Mono, DM Sans