Giter Site home page Giter Site logo

0xdaksh / defi-playground Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 5.0 1.01 MB

⚡️Playground for DeFi protocols like Compound, Aave, Maker & Uniswap.

License: MIT License

JavaScript 1.18% Shell 0.40% Solidity 49.22% TypeScript 49.19%
compound-contracts lending-protocol defi aave

defi-playground's Introduction

DeFi Playground 📈😱🚀

🙋‍♂️ I made this repo to teach myself, "how to do x with y" where "y" is a DeFi protocol.

Requirements

  1. Node.js v14+
  2. Alchemy - Make an alchemy account and set the ALCHEMY_API_KEY environment variable in the .env file
  3. Run yarn to install dependencies
  4. Run yarn test to test the implementations

Helpful Reading

🤔 How tos?

  1. 💰 How to deposit a token and get back a interest bearing cTokens?
  2. 💸 How to withdraw / cash out your tokens by returning cTokens?
  3. 🤔 How to earn interest on your token deposits? (Demonstration)
  4. 🏦 How to take a loan and borrow tokens after setting a collateral?
  5. ⚖️ How to check the balance you borrowed?
  6. 🥳 How to repay the loan?
  7. 📈 How to calculate the exchange rate of cTokens?
  8. 📦 How many underlying tokens does the compound contract holds?
  9. 🧐 How to check the total supply and total borrows of a token?
  10. 🙋‍♂️ How to calculate the supply APY and borrow APR of a token?

Helpful Reading

🤔 How tos?

  1. 💰 How to deposit erc20 token and get back interest bearing aTokens?
  2. 💸 How to withdraw/cashout erc20 tokens by returning back aTokens?
  3. 🤔 How to earn interest on your erc20 token deposits?
  4. 🏦 How to set a particular erc20 token as collateral for your loan borrows?
  5. 💵 How to take a stable interest rate loan against your collateral?
  6. 💱 How to convert your stable interest loan to a variable interest loan?
  7. 🥳 How to repay the loan?
  8. 🧐 How to get user data (ie: total collateral, debt, amount borrowable)?
  9. 🧐 How to get user data (ie: total collateral, debt, amount borrowable)?
  10. 🙋‍♂️ How to get the supply APY and borrow APR for a erc20 token
  11. ⚖️ How to get the price of erc20 token in ETH from aave oracle?
  12. TBD - Flashloans

defi-playground's People

Contributors

0xdaksh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.