README.md
June 5, 2021 ยท View on GitHub
DeFi Playground ๐๐ฑ๐
๐โโ๏ธ I made this repo to teach myself, "how to do x with y" where "y" is a DeFi protocol.
Requirements
- 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
Compound Finance
Helpful Reading
- ๐ฝ 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 tos?
- ๐ฐ 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?
Aave V2
Helpful Reading
- ๐ฝ 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 tos?
- ๐ฐ 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