Steer Protocol
Module Deep DivesExecution Layer

HybridCollateralSettlementHook

Swap interception, pre-trade risk gating, and bounded post-trade settlement.

What It Does

HybridCollateralSettlementHook is the execution control plane between Uniswap v4 swap flow and external settlement.

For swaps without signed quote hookData, it returns ZERO_DELTA, skips vault sizing, and leaves no active settlement state. On registered-issuer hooks, this AMM path is available only while RiskConfig.poolAllowed is true.

For signed quote swaps, at runtime it:

  1. runs pre-trade checks in beforeSwap
  2. asks the liquidity source for the safe vault leg size
  3. rejects any remaining AMM leg when RiskConfig.poolAllowed is false on registered-issuer hooks
  4. stores transient context for this swap
  5. validates post-trade settlement bounds in afterSwap
  6. triggers external settlement or signed-quote consumption and clears transient state

Runtime Flow

Core Responsibilities

  • enforce pool-level configuration (enabled, collateral, limits)
  • enforce the registered-issuer poolAllowed switch for unsigned swaps and signed routes with a pool leg, while allowing fully external settlement
  • gate swap-driven minting during RedeemOnly/Paused conditions
  • treat empty and malformed non-signed hookData as pure AMM pass-through
  • enforce risk and oracle checks only after signed quote metadata is present
  • delegate signed-quote policy validation to CollateralManager during settlement
  • enforce bounded settlement magnitudes
  • emit BeforeSwapRiskEvaluated and AfterSwapSettlementEvaluated
  • unconfigured pools and no-collateral pool configs revert closed instead of bypassing pool-level risk checks

Failure Modes

Source

On this page