Telegram bot + mini-app for one-click DeFi copy-trading with delegated wallets using Privy
Deport-the-Dip turns a Telegram chat into a full-stack copy-trading platform:
Behind the scenes a Next.js UI handles approvals/swaps, a gRPC DeFi server builds & (optionally) broadcasts raw PancakeSwap transactions, and a Telegraf bot stitches the flow together. Because signing is delegated to Privy server-auth, followers never expose their private keys yet still trade in lock-step with the leader. The result: social trading that feels as simple as pressing “Copy-trade ✅” in chat.
Telegram Bot: Bun + Express + Telegraf => Sets webhooks via ngrok, pipes swap events back to chat; mirrors Mini-App state changes. Mini-App: Next.js 14, React-Server Components, shadcn/ui => Runs inside Telegram Web Apps. Uses Privy React hooks for wallet connect, streams tx status with SSE. DeFi gRPC Server: Bun runtime, TypeScript, protobuf-gRPC => Two services: TransactionService (build/submit raw tx) and SwapService.ExecuteSwap (delegated copy). PancakeSwap router ABIs loaded at runtime. Persistence: Supabase Postgres and The Graph => Stores users & follower graph; row-level security locks each bot instance. Indexing / Stats: The Graph => not finished
Notable hacks & optimisations: