Skip to content

Rebalancer refinements: cap trigger, buffer-aware target, retire spike#21

Merged
jayeshy14 merged 1 commit into
mainfrom
feat/rebalancer-refinements
Jul 6, 2026
Merged

Rebalancer refinements: cap trigger, buffer-aware target, retire spike#21
jayeshy14 merged 1 commit into
mainfrom
feat/rebalancer-refinements

Conversation

@jayeshy14

Copy link
Copy Markdown
Owner

Three small rebalancer refinements. 162 tests passing, including the mainnet-fork proof.

1. Cap trigger as a distinct, permissionless emergency

  • IMethodology.capTriggerBps() exposes the actual-weight ceiling (3000 bps at the 0.30e18 default) above the cap target.
  • Rebalancer.capTriggerBreached() flags any held, freshly-priced name past it (quarantined names skipped) and promotes openEpoch to a permissionless emergency, alongside drift >= D_LARGE_BPS.
  • Makes the Nasdaq-style hysteresis real: getWeights caps to the target, the higher trigger forces the off-cycle rebalance. Methodologies with no cap report 0 and the path is inert.

2. Buffer-aware rebalance target

  • openEpoch holds back the vault's operating buffer (bufferTargetBps, default 5%) on top of the redemption reserve: deployableNav = NAV - reserve - buffer.
  • Aligns the rebalancer with the vault's documented intent ("the level the rebalancer tops the buffer back toward") instead of draining the sync lane. Pulls the buffer toward target from either side.

3. Retire the CoWOrderHandler spike

  • Deleted the spike and its two tests. Ported the make-or-break mainnet-fork digest proof to RebalancerFork.t.sol, which builds the real stack and confirms the rebalancer's domain separator, relayer, and EIP-712 digest match the live GPv2Settlement byte-for-byte. Net -334 lines.

Also

  • Folded in leftover doc-only natspec touch-ups in ISupplyOracle and WeightMath.

Wire the methodology cap trigger as a distinct, permissionless emergency
open. IMethodology.capTriggerBps() exposes the actual-weight ceiling above
the cap target; the rebalancer promotes openEpoch to a permissionless
emergency when any held, freshly-priced name breaches it, so the Nasdaq-style
hysteresis (cap to target, trigger higher) is enforced off-cycle rather than
left to the drift band. Methodologies with no cap report zero and the path is
inert.

Make the rebalance target buffer-aware. openEpoch now holds back the vault's
operating buffer (bufferTargetBps) on top of the redemption reserve, so it
tops the sync USDC lane toward target instead of deploying the whole basket
and draining it. The hold-back pulls the buffer toward target from either
side.

Retire the CoWOrderHandler spike. Its mainnet-fork digest proof is ported to
RebalancerFork.t.sol, which builds the real stack and confirms the
rebalancer's domain separator, relayer, and EIP-712 digest match the live
GPv2Settlement byte-for-byte.

Also fold in leftover doc-only natspec touch-ups in ISupplyOracle and
WeightMath. 162 tests passing.
@jayeshy14 jayeshy14 merged commit 917bfe6 into main Jul 6, 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