A decentralized staking platform that allows users to stake their crypto assets across multiple DeFi protocols (Aave, Uniswap, Lido) through a unified interface.
poc-stake/
├── frontend/ # Next.js 14 frontend application
├── backend/ # Express.js backend API
├── contracts/ # Solidity smart contracts (Hardhat)
└── .agent/workflows/ # Development workflows
- Node.js 18+ and npm
- MongoDB (local or Atlas)
- Redis (for queue management)
- MetaMask or compatible Web3 wallet
# Install all dependencies
cd frontend && npm install
cd ../backend && npm install
cd ../contracts && npm installCreate .env files in each directory (see .env.example in each folder).
Frontend (frontend/.env.local):
NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_SEPOLIA_STAKING_ROUTER=0x...
NEXT_PUBLIC_SEPOLIA_WETH=0x...
NEXT_PUBLIC_SEPOLIA_WBTC=0x...
NEXT_PUBLIC_SEPOLIA_USDC=0x...Backend (backend/.env):
MONGO_URI=mongodb://...
PORT=3001
REDIS_URL=redis://localhost:6379
STAKING_ROUTER_ADDRESS=0x...
RPC_URL=https://ethereum-sepolia-rpc.publicnode.com
PRIVATE_KEY=your_private_keyContracts (contracts/.env):
SEPOLIA_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com
PRIVATE_KEY=your_private_key
ETHERSCAN_API_KEY=your_etherscan_keycd contracts
npx hardhat compile
npx hardhat run scripts/deploy.ts --network sepoliaSave the deployed contract addresses and update your .env files.
cd backend
npm run seed# Terminal 1 - Backend
cd backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm run devVisit http://localhost:3000 to see the app.
- Multi-Protocol Staking: Stake across Aave, Uniswap, and Lido
- Real-time Tracking: Monitor your positions and earnings
- Wallet Integration: Connect with MetaMask via RainbowKit
- Transaction History: View all your staking activities
- Unstaking: Withdraw your staked assets anytime
- Event Listeners: Automatic transaction confirmation via blockchain events
# Smart Contracts
cd contracts
npx hardhat test
# Backend
cd backend
npm test
# Frontend
cd frontend
npm test- Never commit
.envfiles - Use separate wallets for development and production
- Audit smart contracts before mainnet deployment
- Keep private keys secure
MIT
Contributions are welcome! Please read our contributing guidelines first.