Instadapp / flashloan-aggregator

Flashloan Aggregator on all major chains.

Home Page:https://docs.instadapp.io/flashloan/flashloanAggregator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update Flashloan aggregator

shriyatyagii opened this issue · comments

We need to update the flashloan aggregator from scratch. Current code has a lot of redundant code that has caused the contract size to increase a lot and it's hard to add new routes to it.

We need to merge all the common code together and try to make logics as modular and reusable as possible. All the core logics and storage variable updates should remain on the core contract. Rest everything can be moved to helpers or separate implementation.

  • Set up a new proxy
  • The main flashloan aggregator will have 11 routes.
  • Currently we have 8 and we need to add 2 new routes:
    • Route 8 for Uniswap V3. We have this route on other chains, just need to add on mainnet. Eg for polygon.
    • Route 11 for Maker PSM. Maker PSM allows DAI to USDC swaps at 1:1 ratio. The flow for this will be, if the flashloan token is USDC, take flashloan of DAI from Maker. Swap this DAI from Maker PSM for 1:1 USDC. The user will payback USDC + flashloan fee. Swap this amount from PSM and payback on Maker.