TradeDNA is a Web3 wallet analytics dashboard built with Next.js that helps traders understand wallet-level performance from on-chain activity.
It combines wallet connection, address search, transaction ingestion, token pricing, and derived analytics into one interface.
- Connect wallet on desktop and mobile (WalletConnect fallback for mobile/deep-link flow).
- Analyze a connected wallet or pasted wallet address.
- View wallet-level metrics:
- Total PnL
- Win rate
- Total successful transactions
- Most-used network
- Review recent trade activity and token-level performance.
- See cumulative PnL over time.
- Get an automatic trader profile classification:
DegenSwing TraderDiamond HandsPro TraderInactive
- Ethereum Mainnet (
chainId: 1)
The architecture supports adding more chains later, but current production logic is Ethereum-focused.
- Landing page:
/ - Dashboard (connected wallet):
/dashboard - Search page (paste any wallet):
/search - Trending page placeholder:
/trending - API route for wallet analysis:
/api/analyze-wallet
- Next.js 16 (App Router)
- React 19
- TypeScript
- Tailwind CSS v4
- Ethers v6
- WalletConnect Ethereum Provider
- Recharts
- Sonner (toast notifications)
- User connects a wallet or enters an address.
- Client calls
POST /api/analyze-wallet. - Server pipeline (
analyzeWallet) fetches wallet transfers from Alchemy. - Server fetches full transaction + receipt data from Infura.
- Logs are decoded for ERC-20 transfer events.
- Trade heuristics build buy/sell sides from transfers.
- DexScreener prices are fetched for token valuation.
- Derived analytics are computed:
- total PnL
- win rate
- PnL series
- trader classification
- token performance table
- JSON response is rendered in dashboard/search UI.
- File:
src/lib/apis/transactions.ts - Uses Alchemy
alchemy_getAssetTransfersfor inbound and outbound transfers. - Uses Infura JSON-RPC to hydrate transactions and receipts.
- Includes successful status, timestamp, logs, and native value estimation.
- File:
src/lib/services/walletAnalysis.ts - ERC-20
Transferlogs are decoded and filtered to wallet-relevant transfers. - Heuristic selects largest incoming/outgoing transfer as trade legs.
- Handles native-side quote fallback when one side is missing.
- File:
src/lib/apis/dexscreener.ts - Fetches token price by address and picks best-liquidity pair.
- Uses WETH pricing to estimate native transfer USD value.
- Files in
src/lib/analytics/* pnl.ts: cumulative PnL and total PnL.winrate.ts: profitable trades ratio.traderType.ts: rule-based profile classification.
src/appApp Router pages, layout, API route.src/componentsReusable UI and wallet connection components.src/lib/apisExternal API clients and blockchain fetch logic.src/lib/servicesOrchestration/service layer for analysis.src/lib/analyticsDerived metrics and classification logic.publicStatic assets including project logotradedna-logo.svg.
Create .env.local in the project root:
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id
NEXT_PUBLIC_WALLETCONNECTPROJECT_ID=your_walletconnect_project_id
NEXT_PUBLIC_ALCHEMY_API_KEY=your_alchemy_api_key
NEXT_PUBLIC_INFURA_API_KEY=your_infura_api_key
NEXT_PUBLIC_DEXSCREENER_API_KEY=your_dexscreener_api_key_optionalNEXT_PUBLIC_WALLETCONNECT_PROJECT_IDis the primary WalletConnect key.NEXT_PUBLIC_WALLETCONNECTPROJECT_IDis supported as compatibility fallback.NEXT_PUBLIC_DEXSCREENER_API_KEYis optional.NEXT_PUBLIC_ALCHEMY_API_KEYandNEXT_PUBLIC_INFURA_API_KEYare required for transaction analysis.NEXT_PUBLIC_*values are baked at build time in production deployments.
Install dependencies:
npm installRun development server:
npm run devOpen:
http://localhost:3000
npm run dev
npm run build
npm run start
npm run lintThis project currently runs local dev with:
next dev --webpackReason:
- Turbopack produced environment-specific module-resolution issues in this workspace path.
- Build and production runtime remain Next.js standard.
Request body:
{
"address": "0x..."
}Success response (shape):
{
"totalTransactions": 0,
"totalTrades": 0,
"pnl": 0,
"winRate": 0,
"traderType": {
"type": "Inactive",
"riskLevel": "Low",
"description": "No recent trading activity detected."
},
"trades": [],
"pnlSeries": [],
"recentTrades": [],
"mostUsedNetwork": "Unknown",
"tokensPerformance": []
}Error responses:
400when address is missing.500when upstream APIs fail or processing errors occur.
- If injected provider exists (
window.ethereum), app uses injected wallet flow. - If no injected provider exists, app falls back to WalletConnect.
- Mobile browsers typically use WalletConnect path.
- User-facing error messages are intentionally non-technical.
- Push repository to GitHub.
- Import project in Vercel.
- Add environment variables in
Project Settings -> Environment Variables: NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDNEXT_PUBLIC_WALLETCONNECTPROJECT_ID(optional compatibility)NEXT_PUBLIC_ALCHEMY_API_KEYNEXT_PUBLIC_INFURA_API_KEYNEXT_PUBLIC_DEXSCREENER_API_KEY(optional)- Redeploy after every env change.
- Confirm WalletConnect env variable exists in Vercel.
- Redeploy after setting env variables.
- Ensure variable names are exact.
next/font/googlerequires network access during build.- Ensure CI/build environment has outbound internet access to Google Fonts.
- Some wallets have no usable ERC-20 transfer-derived trade data in sampled history.
- Upstream RPC/API limits or intermittent failures can reduce returned data.
- Known warning during server rendering.
- Does not block successful build/start.
- Ethereum-only by default.
- Trade reconstruction uses heuristics and may not match DEX-level execution semantics exactly.
- Prices are estimated from current liquidity sources and may differ from execution-time fill prices.
- Trending page is scaffolded and not yet connected to a live aggregation pipeline.
- Primary logo asset:
public/tradedna-logo.svg
TradeDNA provides analytical estimates from on-chain and third-party data. It is not financial advice and should not be used as the sole basis for trading decisions.
