Skip to content

Pawar7349/LiquidVault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LiquidVault

ERC4626 yield aggregator that automatically deploys USDC to Aave strategies. Deposit, earn yield, withdraw anytime.

Live Demo

What It Does

Users deposit USDC → Vault mints shares → Auto-deploys 70% to Aave → Earns yield → Withdraw with profits

Tech Stack

Contracts:

  • Solidity 0.8.20
  • Foundry
  • OpenZeppelin v5
  • ERC4626 standard

Frontend:

  • React
  • ethers.js
  • MetaMask integration

Features

  • ERC4626 tokenized vault
  • Automatic 70/30 allocation
  • Multi-strategy support
  • Real-time tracking
  • Performance fees on profits
  • Emergency pause system

Installation

Smart Contracts

cd Blockchain
forge install
forge test

Frontend

cd frontend
npm install
npm start

Testing

forge test -vvv

20/20 tests passing covering deposits, withdrawals, strategies, and edge cases.

Deployment

export PRIVATE_KEY=your_key
export SEPOLIA_RPC_URL=your_rpc

forge script script/DeployFinal.s.sol:DeployFinal \
  --rpc-url $SEPOLIA_RPC_URL \
  --broadcast \
  --verify

Usage

Frontend

  1. Connect MetaMask (Sepolia)
  2. Get test USDC from faucet
  3. Deposit USDC
  4. Earn yield automatically
  5. Withdraw anytime

Smart Contracts

// Deposit
IERC20(usdc).approve(vault, amount);
uint256 shares = vault.deposit(amount, receiver);

// Withdraw
vault.withdraw(assets, receiver, owner);

Architecture

User → Vault (ERC4626) → Strategy (70%) + Idle (30%) → Aave

Project Structure

LiquidVault/
├── Blockchain/
│   ├── src/
│   │   ├── LiquidVault.sol      # Main vault
│   │   ├── MockAave.sol         # Test mock
│   │   ├── strategies/
│   │   │   └── AaveStrategy.sol # Aave integration
│   │   └── interfaces/
│   │       └── IStrategy.sol    # Strategy interface
│   ├── test/
│   │   └── LiquidVault.t.sol   # All tests
│   ├── script/
│   │   └── DeployFinal.s.sol   # Deployment
│   └── foundry.toml
└── README.md

Key Contracts

LiquidVault.sol - Main ERC4626 vault with automated strategy allocation

AaveStrategy.sol - Aave V3 integration for yield generation

MockAave.sol - Mock lending pool with 5% APY for testing

How It Works

  1. User deposits USDC
  2. Vault mints lvUSDC shares (1:1 initially)
  3. Vault deploys 70% to Aave strategy
  4. 30% stays idle for quick withdrawals
  5. Aave earns interest on deposited funds
  6. Share value increases
  7. User withdraws USDC + yield

Security

  • OpenZeppelin contracts
  • SafeERC20 for all transfers
  • ReentrancyGuard
  • Pausable emergency mechanism
  • Owner access controls
  • Comprehensive tests

Future Improvements

  • Additional strategies (Compound, Yearn)
  • Multi-asset support (USDT, DAI)
  • Automated rebalancing
  • Analytics dashboard
  • Mainnet deployment

License

MIT

Disclaimer

Educational project. Not audited. Use at your own risk.

Contact

About

ERC4626 yield aggregator that auto-deploys USDC to Aave strategies. 20/20 tests passing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors