Rebalancer refinements: cap trigger, buffer-aware target, retire spike#21
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 promotesopenEpochto a permissionless emergency, alongsidedrift >= D_LARGE_BPS.2. Buffer-aware rebalance target
openEpochholds back the vault's operating buffer (bufferTargetBps, default 5%) on top of the redemption reserve:deployableNav = NAV - reserve - buffer.3. Retire the CoWOrderHandler spike
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
ISupplyOracleandWeightMath.