The Flash Loans transactions used to rebalance the mUSD basket as part of the mUSD V3 contract upgrade.
- Swap out TUSD from mUSD
- Flash loan 1m USDC from DyDx
- mUSD swap 1m USDC->TUSD
- Swap 0.5m TUSD->USDC using Curve Y pool
- Swap 0.5m TUSD->USDC using Curve TUSD pool
- Loan shortfall 634 USDC
- Gas used 2,318,563. 0.310687442 Ether ($558.23)
https://etherscan.io/tx/0xe71da8d2b5447d095ff6a8cbfae6ee3975230a03fd459912b07bfce54bc8ecd4
Tranaction Sequence diagram without params
Tranaction Sequence diagram with params
- Attempt to swap out TUSD and USDT
- Flash loan 5.5m DAI from DyDx ran out of gas
- Gas limit was 3,233,929
- Gas used was 3,090,548. 0.3863185 Ether ($693.94)
- Next tx was the same but with a higher gas limit so the gas estimation was wrong
https://etherscan.io/tx/0xbb0592b5dcd4155b52d2bcd0dba3f768f8d475da34168ccf3ce5fb9621b21d6d/advanced
- Swap out TUSD and USDT from mUSD
- Flash loan 5.5m DAI from DyDx
- mUSD swap 2.7m DAI->TUSD
- mUSD swap 2.7m DAI->USDT
- Swap 1.35m TUSD->DAI using Curve Y pool
- Swap 1.35m TUSD->DAI using Curve TUSD pool
- Swap 2.7m USDT->DAI using Curve 3pool
- loan shortfall 9,979 DAI
- Gas used 2,764,284. 0.34337708 Ether ($615.98)
https://etherscan.io/tx/0x77cea5a059bf8e86a1f51b53e661918d2bc05cc3961a9c0c0f9ce04c51a32952
Tranaction Sequence diagram without params
Tranaction Sequence diagram with params
- Swap out TUSD from mUSD
- Flash loan 5.2m DAI from DyDx
- mUSD swap 5.2m DAI->TUSD
- Swap 2.6m TUSD->DAI using Curve Y pool
- Swap 2.6m TUSD->DAI using Curve TUSD pool
- loan shortfall 14,400 DAI
- Gas used 2,764,284. 0.323421228 Ether ($580.97)
https://etherscan.io/tx/0xbcaa641d718e1627d21a6b0fc26b7390271dfd288059a96b5b366a0c97c44586