Skip to main content

Architecture

┌──────────────────────┐
│ apps/web (Next.js) │
│ RainbowKit + SIWE │
└──────────┬───────────┘
│ HTTPS (cookie)

┌──────────────┐ ┌──────────────────┐ ┌──────────────────────┐
│ apps/agent │ ── │ apps/api │ ── │ packages/scanner │
│ Claude Agent │ │ Hono + x402 │ │ - Etherscan V2 │
│ SDK + x402 │ │ gating mw │ │ - viem on-chain │
└──────────────┘ └────────┬─────────┘ │ - heuristics │
│ │ - Claude summary │
│ └──────────────────────┘

┌──────────────────────┐
│ Postgres │
│ - app tables │
│ - ponder schema │
└──────────┬───────────┘

┌──────────┴───────────┐
│ apps/indexer │
│ Ponder │
│ ETH + Base │
└──────────────────────┘

Components

  • packages/scanner — pure TypeScript analysis engine. Pulls verified source from Etherscan V2 (one unified API across chains), reads basic ERC-20 data and EIP-1967 storage via viem, classifies the owner (EOA / contract / multisig / timelock), decodes V4 hook permission bits from the address, and runs a battery of source-code pattern checks. Claude turns the flags + source excerpt into a short verdict.

  • apps/api — Hono server. Two routes matter: /auth/* (SIWE) and /scan (gated). Gating middleware accepts either a SIWE session whose wallet holds the gating token, or a settled x402 payment.

  • apps/indexer — Ponder app that indexes Uniswap V3 PoolCreated on both chains. The API joins against this to enumerate a token's pools and to do LP-lock detection.

  • apps/agent — Hono + x402-hono. The agent uses the Anthropic SDK tool-use loop with a single scan_token tool. Every request is paid via x402 — no SIWE, no NFT, just USDC.

  • apps/web — Next.js 15 dashboard. RainbowKit for wallet connect, SIWE for the API session, React Query for caching.