Project to learn how to build an Defi API. It is implemented using Koa framework from NodeJS, Web3, Infura, Compound and Heroku. There are 4 endpoints:
- Get the current balance of the current contract
/tokenBalance/:cToken/:address
- Current balance of another contract
/cTokenBalance/:cToken/:address
- Send tokens
/mint/:cToken/:amount
- Redeem tokens
/redeem/:cToken/:amount
As an example, here is one of the endpoints to call the token balance GET call from the API: