You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(v3-lp): liquidator profit/receiver guards, deposit preview rounding, range params
Liquidator:
- onMoolahLiquidate counts native in the before-snapshot when the loan token is
the wrapped-native, so stray native from earlier redemptions or receive()
donations no longer reads as fresh profit and lets a shortfall clear NoProfit.
- redeemV3Shares requires receiver == self when a fundSource is set, keeping
vault-funded proceeds inside the reflow path.
- setReflowBlacklist rejects a no-op status change, matching the other setters.
Provider:
- previewDepositAmounts rounds the leg amounts UP, matching _quoteDeposit, so the
preview reports exactly what deposit() consumes.
- Range half-width INITIAL_RANGE_BPS 100 -> 50 (+/-0.5%), which also tightens the
maxSpotDeviationBps and maxTwapDeviationBps defaults; centerRateThresholdBps
drops to 1bp so the BOT, not the contract, picks the rebalance cadence.
- Correct two stale comments: the zero-liquidity guard covers compound only (the
rebalance re-mint has none), and the spot-vs-fair gate does not apply to the
rebalance re-mint. Drop the previewDepositForToken0 suggestion to deposit a
single leg when fair leaves the range -- every shape reverts until a recenter.
Tests:
- Counter-tests for each liquidator fix, incl. a WBNB-loan market so the
wrapped-native branch is exercised.
- previewDepositAmounts exact-match test; regression test pinning that deposits
are closed while fair sits past tickUpper and reopen after a BOT recenter.
- _deposit helpers derive a non-zero minShares from previewDepositShares:
min0/min1 floor the consumed amounts, not the entry price.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments