Gearbox-protocol / core-v3

Other
28 stars 4 forks source link

Liquidator is able to withdraw unclaimed user's rewards #182

Open lekhovitsky opened 8 months ago

lekhovitsky commented 8 months ago

Liquidations are designed to be quite general to allow liquidators to make use of adapters and router instead of solving the routing issue themselves. The price of this flexibility is that we can't fully control what adapter calls are made during liquidation and what happens to the tokens that were not enabled as collateral and were not accounted in totalValue. One slightly unexpected and unfortunate instance of this is that liquidator can claim and withdraw user's farming rewards.

Full mitigation of this issue might require an undesired overhaul of the system. Much simpler to implement, "deleverage bots" can perform actions like claiming rewards / enabling disabled tokens / swapping collateral to underlying once account's health factor drops below 1.01.