A tool for leveraging DAI yield in AAVE using QiDao Protocol, in Polygon Network.
Detailed non-technical info
Mechanism is as follow:
- Take a flash-swap in DAI
- Deposit DAI in AAVE
- Deposit amDai in camDai Vault (QiDaoProtocol)
- Deposit camDai as collateral in Vault (QiDaoProtocol)
- Borrow MAI
- Swap MAI for DAI
- Pay flash-swap
This tool is a Instadapp style
protocol, you can call createNew()
function to create a new contract that only your account (msg.sender
) can manage.
Install
-
Clone repo
-
npm install
-
Create a
secrets.json
file, fill the blanks. -
npx hardhat test tests/test.js
Functions
LeverageFactory:
createNew()
: create a new camDaiLeverage contractgetContractAddresses(address account)
: get all contract addresses by account
camDaiLeverage:
doRulo(uint amount)
: do the loopundoRulo()
: undo the looptransferTokens(address _tokenAddress)
: transfer any token to the owner, used for rescue tokens