A beautiful, Jupiter-style interface for Dollar Cost Averaging on Base chain. Built with Next.js, Viem, Wagmi, and RainbowKit.
- 🎨 Jupiter-style Design - Sleek, modern interface inspired by Jupiter Exchange
- 🔗 Base Chain Support - Native integration with Base mainnet and testnet
- 💼 Wallet Integration - Connect with MetaMask, WalletConnect, and more via RainbowKit
- 📊 Position Management - Create and monitor your DCA positions
- 🔄 Token Swapping - Easy token selection with visual interface
- ⚡ Real-time Updates - Live balance and position tracking
- Node.js 18+
- npm or yarn
- A deployed DCA contract on Base
-
Clone and install dependencies:
cd dca-interface npm install -
Configure your DCA contract:
Update
src/lib/contracts.tswith your deployed contract address:export const CONTRACTS = { DCA: '0xYourDeployedContractAddress', // Replace with your contract } as const
-
Get a WalletConnect Project ID:
- Visit WalletConnect Cloud
- Create a project and get your Project ID
- Update
src/app/providers.tsx:
const config = getDefaultConfig({ appName: 'DCA Protocol', projectId: 'YOUR_PROJECT_ID', // Replace with your Project ID chains: [base, baseSepolia], ssr: true, })
-
Start the development server:
npm run dev
- Connect your wallet using the connect button
- Select tokens - Choose what to sell and what to buy
- Set amount - Enter the total amount you want to DCA
- Configure schedule:
- Interval: How often to execute (5m, 1h, 1d, etc.)
- Orders: How many total orders to split into
- Approve tokens if needed
- Create position and confirm the transaction
- Navigate to the Positions tab to view all your DCA positions
- See progress, remaining amounts, and next execution times
- Monitor acquired tokens and completion status
Before using the interface, you need to deploy your DCA contract to Base:
-
Set your private key:
export PRIVATE_KEY="your_private_key_here"
-
Deploy to Base Sepolia (testnet):
forge create src/dca.sol:DCAPositionManager \ --private-key $PRIVATE_KEY \ --rpc-url https://sepolia.base.org \ --etherscan-api-key YOUR_BASESCAN_API_KEY \ --verify -
Deploy to Base Mainnet:
forge create src/dca.sol:DCAPositionManager \ --private-key $PRIVATE_KEY \ --rpc-url https://mainnet.base.org \ --etherscan-api-key YOUR_BASESCAN_API_KEY \ --verify -
Update the contract address in
src/lib/contracts.ts
- Next.js 14 - React framework with app router
- TypeScript - Type safety
- Tailwind CSS - Styling
- Viem - Ethereum interactions
- Wagmi - React hooks for Ethereum
- RainbowKit - Wallet connection
- Lucide React - Icons
DCAInterface- Main position creation interfacePositionsList- View and manage existing positionsNavigation- App navigation with wallet connectioncontracts.ts- Contract ABIs and addresses
The interface interacts with your DCA contract through:
- Reading positions - View user's DCA positions
- Creating positions - Submit new DCA strategies
- Token approvals - Approve spending for position creation
- Balance checking - Show token balances
Token list is sourced from public/oneinch-tokenlist.json and filtered to Base (8453) at runtime. No need to edit a hardcoded list.
The interface uses Tailwind CSS with a dark theme. Key colors:
- Primary: Purple/Blue gradient
- Background: Dark with blur effects
- Accents: Gray with transparency
To add more chains, update src/app/providers.tsx:
const config = getDefaultConfig({
// ...
chains: [base, baseSepolia, mainnet, polygon],
// ...
})Create a .env.local file:
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id
NEXT_PUBLIC_DCA_CONTRACT_ADDRESS=0x...- Push to GitHub
- Connect to Vercel
- Set environment variables
- Deploy
- Always verify contract addresses
- Test on testnet first
- Use proper slippage settings
- Monitor position execution
- Keep private keys secure
For issues and questions:
- Check the contract documentation
- Review transaction errors in block explorer
- Test on Base Sepolia first