Why it exists
The rebalancer allocates capital between liquid and illiquid farms based on votes and lock durations. User redemptions can cause the liquid share to fall below the target reserve factor. The liquid keeper reserve:- Unwinds eligible illiquid farms when the reserve is too low.
- Pauses new wrapping on those farms until the reserve reaches the target.
- Lets the rebalancer move the released USDC to the liquid side.
Key concepts
For example, with a 25% target and 20% lower bound:
The hysteresis band prevents repeated withdrawals and reallocations when the reserve is slightly below the target.
Rebalancer integration
At the start of each rebalancer run, before the main allocation algorithm:- The rebalancer calculates the current liquid reserve ratio.
- If the ratio is below the lower bound, the rebalancer:
- Selects the eligible illiquid farm with the lowest 48-hour APY.
- Calls
automaticWithdrawto release USDC on that farm. - Withdraws the amount needed to reach the target, subject to the per-run cap.
- The standard rebalancer movements transfer the released USDC from the farm to liquid destinations, such as the mint controller or liquid farms.
automaticWithdraw runs before the standard movements so the released USDC is available to the allocation algorithm.
Farm keeper integration
When the liquid reserve ratio is in the hysteresis band:- The farm keeper does not wrap incoming USDC into the farm’s target asset. For example, Morpho Prime does not swap USDC for PYUSD or deposit PYUSD into the Morpho vault.
- USDC remains idle on the farm until the ratio recovers or a rebalancer run moves it.
Farm eligibility
Automatic withdrawals apply only to farms that opt in through configuration:
The rebalancer ignores farms without this flag. It also skips paused farms and farms with withdrawals disabled.
automaticWithdraw farm integration
Each eligible farm type implements automaticWithdraw on its farm manager. The rebalancer calls it before standard movements.
The method converts deployed positions back to USDC on the farm without sending funds to the mint controller. The rebalancer handles the subsequent transfer.
For example, Morpho Prime:
- Unwraps vault shares to PYUSD.
- Swaps PYUSD for USDC.
- Leaves USDC on the farm.
automaticWithdraw.
Configuration
Set the lower bound below the target to create the hysteresis band. Both values are configurable.
Execution flow
Safety
- The per-run cap limits how much the system can unwind in one cycle.
- The hysteresis band prevents oscillation between wrapping and unwrapping near the target.
- Per-farm opt-in limits participation to configured farms.
- Existing rebalancer guards still apply, including cooldowns, minimum and maximum movements, paused farms, and fake mode.