Skip to content

feat(rebalancer): basket-funded redemptions (Section 3)#19

Merged
jayeshy14 merged 1 commit into
mainfrom
feat/basket-funded-redemptions
Jul 1, 2026
Merged

feat(rebalancer): basket-funded redemptions (Section 3)#19
jayeshy14 merged 1 commit into
mainfrom
feat/basket-funded-redemptions

Conversation

@jayeshy14

Copy link
Copy Markdown
Owner

Closes the liquidity gap where a redemption larger than the buffer reverted in settle, because the value sat in the basket, not USDC. The rebalancer now raises USDC from the basket to fund such a redemption before settle pays it.

What changed

  • Vault views: redemptionFundingNeeded() (the current epoch's pending redemption value exceeds the idle buffer) and rebalanceReserveUsd() (the full redemption value to hold back as USDC; since NAV already includes the buffer, the basket only sells the shortfall down to reach it).
  • Rebalancer: a pending redemption the buffer cannot cover is a first-class trigger, so the keeper may open an epoch regardless of drift or cadence, since redemption liveness cannot wait for the reweight schedule. The reserve is grossed up by max slippage (so the net USDC raised covers the redemption) and held back, so targets sum to NAV - reserve, the basket becomes overweight and is sold to USDC, and settle pays the redemption from the topped-up buffer.

The reserve is zero whenever the buffer already covers redemptions, so a pure reweight is unchanged and no existing tests churn.

Tests

4 new tests in test/BasketFundedRedemption.t.sol: the funding-needed view, the funding-triggered epoch opening below the drift gate (keeper-gated), the reserve held back in the targets, and a full end-to-end where a $150k redemption against a zero buffer is funded by selling the basket and paid at settle. 166 total, all green, forge fmt clean.

Large redemptions previously reverted in settle when they exceeded idle +
deposit inflow, because the value sat in the basket, not USDC. The rebalancer
now raises USDC from the basket to fund them before settle pays.

- Vault: redemptionFundingNeeded() (pending redeem value exceeds the buffer)
  and rebalanceReserveUsd() (the full redemption value to hold back as USDC;
  since NAV already includes the buffer, the basket only sells the shortfall).
- Rebalancer: a pending redemption the buffer cannot cover is a first-class
  trigger, so the keeper may open an epoch regardless of drift or cadence. The
  reserve is grossed up by max slippage and held back, so targets sum to
  NAV - reserve, the basket is overweight and sold to USDC, and settle pays the
  redemption from the topped-up buffer.

The reserve is zero when the buffer already covers redemptions, so a pure
reweight is unchanged and no existing tests churn. 4 new tests including a full
end-to-end where a 150k redemption against a zero buffer is funded by selling
the basket. 166 total green.
@jayeshy14 jayeshy14 merged commit 556fa57 into main Jul 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant