Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Rebalance breaks ltv #499

Closed pedrovalido closed 1 year ago

pedrovalido commented 1 year ago

This PR addresses M-5

The changes made to the RebalancerManager are to prevent the rebalance to change the current ltv. So, a check was added to verify the ltv before and after the rebalance. Also, there's a check for redundant calls of rebalance: if the amount of assets passed = 0, then it revertes straight away. It wouldnt make sense to rebalance only debt and it would be impossible to do so and keep the same ltv

pedrovalido commented 1 year ago

Note to self: check the assets==0 revert check. This might have to be removed due to the current path this fix is taking

pedrovalido commented 1 year ago

@DaigaroCota Ive included the #502 in this PR

pedrovalido commented 1 year ago

All above changes have been addressed. Let me know if it ready to merge @DaigaroCota