nodeset-org / constellation

GNU General Public License v3.0
5 stars 0 forks source link

Fix rebalance after hasSufficientLiquidity() #351

Closed VVander closed 4 weeks ago

VVander commented 4 weeks ago

Previously, provisionLiquiditiesForMinipoolCreation() rebalanced the vaults. This was happening after hasSufficientLiquidity() was checked but before the deposit to RP was made. This is incorrect, because rebalancing the vaults may move liquidity away from OD and cause it to not have enough left for minipool creation.

This PR fixes the above by moving the rebalance of the vaults to happen after the minipool deposit is made.