🙋♂️ 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_KEY
environment variable in the .env file - Run
yarn
to install dependencies - Run
yarn test
to 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
deposit
a token and get back a interest bearing cTokens? - 💸 How to
withdraw
/cash out
your tokens by returning cTokens? - 🤔 How to
earn interest
on your token deposits? (Demonstration) - 🏦 How to take a
loan
and borrow tokens after setting a collateral? - ⚖️ How to check the balance you
borrowed
? - 🥳 How to
repay
the loan? - 📈 How to calculate the
exchange rate
of cTokens? - 📦 How many
underlying tokens
does the compound contract holds? - 🧐 How to check the
total supply
andtotal borrows
of a token? - 🙋♂️ How to calculate the
supply APY
andborrow APR
of 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 token
and get back interest bearingaTokens
? - 💸 How to
withdraw/cashout erc20 tokens
by returning backaTokens
? - 🤔 How to
earn interest
on yourerc20 token
deposits? - 🏦 How to set a particular
erc20 token
as collateral for your loan borrows? - 💵 How to take a
stable interest rate loan
against your collateral? - 💱 How to convert your
stable interest loan
to avariable interest loan
? - 🥳 How to
repay
the 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 APY
andborrow APR
for aerc20 token
- ⚖️ How to get the
price of erc20 token
inETH
from aave oracle? - TBD - Flashloans