🙋♂️ I made this repo to teach myself, "how to do x with y" where "y" is a DeFi protocol.
- Node.js v14+
- Alchemy - Make an alchemy account and set the
ALCHEMY_API_KEYenvironment variable in the .env file - Run
yarnto install dependencies - Run
yarn testto test the implementations
- 💽 Interfaces we use to interact with Compound's contracts
- # Addresses we use to connect to the mainnet deployed contracts
- ⚡️ Check Fixtures, we use these to setup our tests
- 📜 Compound Docs for cTokens, Comptroller, ie: controller
- 💰 How to
deposita token and get back a interest bearing cTokens? - 💸 How to
withdraw/cash outyour tokens by returning cTokens? - 🤔 How to
earn intereston your token deposits? (Demonstration) - 🏦 How to take a
loanand borrow tokens after setting a collateral? - ⚖️ How to check the balance you
borrowed? - 🥳 How to
repaythe loan? - 📈 How to calculate the
exchange rateof cTokens? - 📦 How many
underlying tokensdoes the compound contract holds? - 🧐 How to check the
total supplyandtotal borrowsof a token? - 🙋♂️ How to calculate the
supply APYandborrow APRof a token?
- 💽 Interfaces we use to interact with Aave V2 contracts
- # Addresses we use to connect to the mainnet deployed contracts
- ⚡️ Check Fixtures, we use these to setup our tests
- 📜 Aave V2 Docs for Lending Pool, Price Oracle, aTokens and FAQs
- 💰 How to
deposit erc20 tokenand get back interest bearingaTokens? - 💸 How to
withdraw/cashout erc20 tokensby returning backaTokens? - 🤔 How to
earn intereston yourerc20 tokendeposits? - 🏦 How to set a particular
erc20 tokenas collateral for your loan borrows? - 💵 How to take a
stable interest rate loanagainst your collateral? - 💱 How to convert your
stable interest loanto avariable interest loan? - 🥳 How to
repaythe loan? - 🧐 How to get
user data(ie: total collateral, debt, amount borrowable)? - 🧐 How to get
user data(ie: total collateral, debt, amount borrowable)? - 🙋♂️ How to get the
supply APYandborrow APRfor aerc20 token - ⚖️ How to get the
price of erc20 tokeninETHfrom aave oracle? - TBD - Flashloans
