DefiPanda
Automated DCA investing on Ethereum powered by Chainlink CRE and Rhinestone smart accounts.
What it is
DefiPanda is an automated Dollar-Cost Averaging (DCA) platform that lets users set up recurring USDC-to-ETH purchases without manual intervention. Users log in with social accounts (Google, GitHub, Discord, etc.) via Privy or Reown AppKit, receive a Rhinestone ERC-7579 smart account, and configure a DCA strategy (amount and interval). After a one-time session key approval, the system executes swaps autonomously on the user's behalf.
The core problem it solves is making DCA in DeFi truly hands-off. Traditional DCA on decentralized exchanges requires users to manually sign every trade or trust a custodial service with their funds. DefiPanda eliminates both problems: a Chainlink CRE workflow running on a decentralized oracle network triggers executions on schedule, reads a consensus-verified ETH/USD price feed, and calls the backend. The backend then uses a scoped, time-limited, spending-capped session key to execute a Uniswap V3 swap through the user's smart account, the user's keys never leave their control.
How it Works
- Frontend + Backend: Next.js (App Router) with TypeScript, serving both the UI and API routes. Auth via Privy social login with non-custodial embedded wallets. PostgreSQL stores users, sessions, and DCA positions.
- Smart Accounts: Rhinestone ERC-7579 smart accounts with session keys, scoped to approve USDC and call Uniswap V3's exactInputSingle, with spending-limit and time-frame policies. The backend holds a scoped session key signer; the user signs once to enable it.
- Automation: Chainlink CRE (Chainlink Runtime Environment) workflow deployed to a DON. A cron trigger fires on schedule, reads the Chainlink ETH/USD price feed with BFT consensus across multiple nodes, then POSTs execution parameters to the backend via HTTP.
- Execution: The backend encodes Uniswap V3 swap calldata, submits it via the Rhinestone SDK's intent system (prepare -> sign with session key -> submit -> wait for fill), and records the result.
- Deployment: Docker Compose (Postgres + Next.js + CRE cron container). Production deployment on GCE with Caddy for HTTPS.
- Key dependencies: @chainlink/cre-sdk, @rhinestone/sdk, wagmi, viem, @privy-io/react-auth.
Links
Created by
- Aleksandar Hadzibabic