KryptoniteDAO / krp-cdp-contracts

Kryptonite stable coin kUSD relevant contracts
0 stars 0 forks source link

The maximum number of slots can be shortened even if there are bids in the last positions #11

Open smithmonnnnnnn opened 10 months ago

smithmonnnnnnn commented 10 months ago

Description: The update_collateral_info from liquidation_queue contract allows to modify the max_slot parameter at anytime. If the new value is lower than before and there were some bids in the last positions, those bids will never be used when the execute_liquidation function is executed because the for loop will not reach them. Code Location: krp-cdp-contracts/contracts/liquidation_queue/src/contract.rs#L326-L331

smithmonnnnnnn commented 10 months ago

Yes, the situation described will occur. When the new max_slot is smaller than the previous one, some liquidation funds set in a higher slot will not be executed, but users can withdraw this part of the funds that will not be used. This makes it easier to manage the number of effective slots when max_slot needs to be reduced.