mstable/mStable-contracts

Unliquidator

rafaelugolini opened this issue · 11 comments

MIP 26 vote was passed. We should stop liquidating COMP and stkAave rewards. A contract to claim and send the rewards to the Treasury is specified in https://mips.mstable.org/MIPS/mip-26.html

  • To add test coverage to Unliquidator Smart Contract
  • Deploy the Unliquidator to mainnet
  • Protocol DAO propose new Liquidator module in the Nexus to new Unliquidator contract
  • After a week Protocol DAO accepts new Liquidator module
  • Each integration contract approves the new Unliquidator contract
    • Aave mUSD used by USDT, sUSD and DAI
    • Compound mUSD used by USDC
    • Aave mBTC used by WBTC
    • Aave BUSD Feeder Pool
    • Aave RAI Feeder Pool
  • Execute first claim for each integration contract

Current PR #331 , I added some comments on it.

Deploying Unliquidator contract with hash 0xfad2121af11edef138788ff03e0ef54dedac67869be33f5dee90e90cf789d69d from 0xb81473f20818225302b8fffb905b53d58a793d84 with gas price 27.3 Gwei
Deployed Unliquidator to 0xC643B9D66C68d06EA844251a441A0a1211E60656 in block 14306896, using 651613 gas costing 0.0177890349 ETH

Protocol DAO tx 267. Change Liquidator module in Nexus to newly deployed Unliquidator contract 0xC643B9D66C68d06EA844251a441A0a1211E60656 so COMP and stkAAVE are sent to treasury rather than liquidated

267 fail as it ran out of gas. The safeTxGas was only 36,981 for some reason. When I execute it as a fork it uses 72,952 gas. I've reraised the tx and it has estimate the safeTxGas at 90,071 which should be plenty.
273. Change Liquidator module in Nexus to newly deployed Unliquidator contract 0xC643B9D66C68d06EA844251a441A0a1211E60656 so COMP and stkAAVE are sent to treasury rather than liquidated

Protocol DAO tx 273 to propose the Liquidator module in the Nexus be changed to the Unliquidator contract has been executed https://etherscan.io/tx/0xf9e3cd04e22394294006787ec609983e4b9591de6fa69bcba1480dae758c625d

A new Protocol DAO tx to accept this proposal can be raised on Tuesday, 15 March.

  1. Accept proposed Nexus model upgraded of Liquidator to new Unliquidator contract. This will allow COMP and stkAAVE to be sent to Treasury rather than be liquidated

We have another example of the safeTxGas being set too low by Gnosis Safe. According to Gnosis Safe docs this should not happen when using their UI but it is. I've raised the issue in a Gnosis <> mStable TG channel we have.

I'm executing 280 with a low gas price as that's quicker than getting it rejected. The inner tx while fail with "Out of Gas".
I've raised 281 to replace 280 which did set enough gas to execute.

tx 281 has been executed to accept proposed Nexus model upgrade of Liquidator to new Unliquidator contract https://etherscan.io/tx/0x9255d9a840777a515c1ba6f6976349710ba44c102e4f2850a42a7c457760b6a3

Protocol DAO txs so each integration contract approves the new Unliquidator contract
287. mUSD Aave V2 integration approves Unliquidator
288. mUSD Compound integration approves Unliquidator
289. mBTC Aave V2 integration approves Unliquidator
290. BUSD Feeder Pool Aave integration approves Unliquidator
291. RAI Feeder Pool Aave integration approves Unliquidator

All the integration contract approvals have been executed