Source References: Use Doppler deployments as the contract source of truth for deployed addresses and revisions.
Rehypothecation Hook (Rehype)
When to use
- Tasks mention Rehype, the rehypothecation hook, buybacks, beneficiary fee distribution, or
claimAirlockOwnerFees - You are troubleshooting hook-driven swap behavior for pools managed through
DopplerHookInitializer
Prerequisites
- Pool asset address
- Access to
DopplerHookInitializer.getState(asset) - Correct signer (
airlock.owner()for protocol-owner fee claims)
Core workflow
- Resolve pool context and derive
poolId.- Use
DopplerHookInitializer.getState(asset)
- Use
- Read hook state:
getFeeDistributionInfo(poolId)getHookFees(poolId)getPoolInfo(poolId)getFeeRoutingMode(poolId)getFeeSchedule(poolId)
- Apply operation:
- Collect beneficiary-directed fees with
collectFees(asset) - Claim protocol-owner fees with
claimAirlockOwnerFees(asset)fromairlock.owner()
- Collect beneficiary-directed fees with
- Validate storage resets and token balance deltas after each action.
Quick facts
| Item | Detail |
|---|---|
| Supported hook | RehypeDopplerHookInitializer |
| Fee model | Decaying fee schedule via getFeeSchedule(poolId) |
| Distribution authority | Configured at initialization |
| Fee routing modes | DirectBuyback, RouteToBeneficiaryFees |
| Airlock owner share | Fixed 5% of the raw hook fee |
| Protocol-owner fee bucket | Claimable via claimAirlockOwnerFees(asset) |
Failure modes
- Treating initializer-side Rehype as a static
customFeehook instead of a fee-schedule hook - Distribution does not sum to
WAD(1e18, or 100%) - Non-owner caller for protocol-owner fee claim
- Assuming fee distribution can be updated after initialization
- Confusing Rehype
beneficiaryFeeswith initializer beneficiary-share accounting - Assuming hook fees equal transferable balances without checking internal buckets
References
- CONFIGURATION.md
- Source: RehypeDopplerHookInitializer.sol, RehypeTypes.sol, RehypeDopplerHookInitializer.md