AutoYield is a decentralized finance (DeFi) application that allows users to deposit USDC and earn yield through automated ETH investment strategies. Built on the Ethereum Sepolia testnet, it provides a user-friendly interface for managing crypto investments with real-time price tracking and automated rebalancing.
- USDC Deposits: Securely deposit USDC into the yield vault
- ETH Growth Strategy: Automatically invest deposited USDC into ETH for potential growth
- Flexible Withdrawals: Withdraw your USDC holdings at any time
- Real-time Tracking: Monitor your vault positions and ETH price movements
- Admin Controls: Owner-only functions for investment strategy management
- Dashboard: Comprehensive overview of vault statistics and personal holdings
- Live Price Feeds: Real-time ETH/USD prices via Chainlink oracles
- Responsive Design: Optimized for both desktop and mobile devices
- Dark/Light Theme: Toggle between themes for better user experience
- Transaction Feedback: Real-time notifications for all blockchain interactions
- MetaMask Support: Seamless wallet connection and transaction signing
- Network Management: Automatic Sepolia testnet detection and switching
- Smart Contract Interaction: Direct integration with AutoYieldVault contract
- Real-time Updates: Live blockchain data updates via event listeners
The application interacts with the AutoYieldVault smart contract deployed on Sepolia:
- Vault Address:
0x8EeAa896e0820944bBe31d3E4dA9b2C389E38E8E - USDC Token:
0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 - Chainlink Price Feed:
0x694AA1769357215DE4FAC081bf1f309aDC325306
- Web3Provider: Manages wallet connections and blockchain state
- Contract Utilities: Handles all smart contract interactions
- Price Hooks: Real-time ETH price fetching from Chainlink
- UI Components: Reusable components built with shadcn/ui
- Vault Statistics: Total USDC and ETH holdings in the vault
- Personal Holdings: Your individual USDC and ETH positions
- Wallet Balance: Available USDC in your connected wallet
- Live ETH Price: Current ETH/USD price with USD value calculations
- Quick Actions: Direct links to deposit and withdraw functions
- Amount Input: Specify USDC amount to deposit
- Balance Display: Shows available wallet USDC balance
- Max Button: Quick selection of maximum available balance
- Approval Flow: Automatic ERC-20 token approval handling
- Transaction Status: Real-time feedback on deposit progress
- Withdrawal Amount: Specify USDC amount to withdraw from vault
- Vault Balance: Shows your current vault USDC holdings
- Max Withdrawal: Quick selection of maximum withdrawable amount
- Instant Processing: Direct withdrawal from your vault position
Owner-only features for vault management:
- Investment Control: Set percentage of vault USDC to invest in ETH (0-100%)
- Strategy Preview: Review investment details before execution
- Rebalancing: Convert ETH holdings back to USDC based on current prices
- Owner Verification: Automatic access control based on configured owner address
- Real-time Stats: Live vault statistics for informed decision making
- React 18 - Modern React with hooks and concurrent features
- TypeScript - Type-safe development with full IntelliSense
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - High-quality, accessible UI components
- React Router - Client-side routing and navigation
- ethers.js v6 - Ethereum library for blockchain interactions
- MetaMask Integration - Wallet connection and transaction signing
- Chainlink Price Feeds - Real-time ETH/USD price data
- Sepolia Testnet - Ethereum test network for safe development
- TanStack Query - Server state management and caching
- React Context - Global Web3 state management
- Custom Hooks - Reusable logic for price fetching and mobile detection
- ESLint - Code linting and quality enforcement
- PostCSS - CSS processing and optimization
- TypeScript ESLint - TypeScript-specific linting rules
- Node.js 18+ and npm
- MetaMask browser extension
- Sepolia testnet ETH for gas fees
- Sepolia USDC tokens for testing
# Clone the repository
git clone <repository-url>
cd autoyield
# Install dependencies
npm install
# Start development server
npm run dev- Connect MetaMask to Sepolia testnet
- Get Sepolia ETH from a faucet for gas fees
- Obtain Sepolia USDC tokens for testing deposits
- Access the application at
http://localhost:5173
- Connect Wallet: Click "Connect Wallet" and approve MetaMask connection
- Switch Network: Automatically switch to Sepolia if needed
- Deposit USDC: Navigate to
/depositand deposit test USDC - Monitor Growth: Watch your position on the dashboard
- Withdraw: Use
/withdrawto retrieve your USDC plus any gains
npm run dev # Start development server
npm run build # Build for production
npm run build:dev # Build in development mode
npm run lint # Run ESLint
npm run preview # Preview production buildsrc/
├── components/ # Reusable UI components
├── context/ # React context providers
├── hooks/ # Custom React hooks
├── pages/ # Route components
├── web3/ # Blockchain interaction utilities
├── lib/ # Utility functions
└── styles/ # Global styles and Tailwind config
- Owner-only Admin Functions: Access control for sensitive operations
- Input Validation: Comprehensive validation on all user inputs
- Network Verification: Operations restricted to Sepolia testnet
- Approval Flows: Secure ERC-20 token approval handling
- Error Boundaries: Graceful error handling and user feedback
The application can be deployed to any static hosting service:
# Build for production
npm run build
# Deploy the dist/ folder to your hosting serviceRecommended platforms:
- Vercel
- Netlify
- GitHub Pages
- AWS S3 + CloudFront
This project is open source and available under the MIT License.