This repository is based on an in-depth study of the Aave Protocol and demonstrates several practical case studies aimed at deepening the understanding of its mechanisms. The exercises are designed to explore how Aave’s core data and logic can be leveraged for building more effective strategies, particularly for yield aggregator applications.
Included Case Studies:
-
#getAaveAssetData.js : Retrieve key asset data such as APY, LTV, and liquidation threshold. Token assets include: DAI, USDC, WBTC.
-
Simulate a wallet’s Supply & Borrow state for risk analysis
-
Simulate asset deposits and calculate projected 30-day earnings (Compound interest logic)
-
Implement a minimal strategy contract that connects to Aave, automates deposits, and fetches yield
-
Combine multiple Aave token strategies and construct a weighted return analysis function
This project uses Alchemy's Ethereum Mainnet fork feature for local testing:
- Fork Source: Ethereum Mainnet
- RPC Provider: Alchemy
- Local testing is conducted via Hardhat's
forkingfunctionality, which simulates the mainnet state in a local development environment. - To run the local forked node (requires your own Alchemy API key stored in
.env):
npx hardhat node --fork https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}