Steer Protocol
Module Deep DivesExecution Layer

CollateralManager

Collateral accounting and constrained mint/redeem execution.

What It Does

CollateralManager owns collateral balances, debt balances, and mint/redeem execution under oracle and risk controls.

It is also the external settlement endpoint used by HybridCollateralSettlementHook for swap-driven mint/redeem paths.

Execution Flow

Mint and Redeem Fees

CDP minting books the gross amount as debt and issues the amount minus the mint fee. Solvency, debt ceilings, and the shared debt registry include the fee debt. Repaying only the minted proceeds leaves that fee debt outstanding; the borrower must acquire additional stablecoin to close it before withdrawing all collateral. Mint fees are issued in stablecoin to the admin-configured feeRecipient. Redemption debits gross collateral from the borrower, transfers net collateral to the borrower or settlement hook, and sends the collateral fee to the same recipient. A nonzero fee-bearing mint or redemption reverts until a recipient is configured. The recipient must make the fee tokens available for borrowers to acquire; minting them does not ensure liquidity. Zero configured or rounded fees impose no round-trip fee cost. Repayment does not restore mint-cap usage. This policy does not backfill fees recorded as debt before the change, or distribute collateral fees previously retained by the manager.

Settlement Models

CollateralManager supports one hook-driven vault settlement mode:

  • Non-signed hookData: vaultSettlementSpecifiedAbs, previewSwapExternal, and settleSwapExternal no-op for hook settlement.
  • Signed Quote: a signed quote payload is provided in hookData and validated; settlement still uses SwapParams for amount and direction.
  • Signed zero-vault success: when the hook chooses pool-only execution for a valid signed quote, consumeSignedQuoteForSwap validates and consumes the replay key without vault token movement.

Signed-quote validation includes:

CheckConditionFailure family
payload encodingpayload decodes with supported signed-quote versionmalformed/unsupported payload reverts
expiryexpiry >= block.timestampSignedQuoteExpired
trader bindingmsg.sender == traderSignedQuoteTraderMismatch
pool bindingquote pool matches current poolSignedQuotePoolMismatch
amount boundmaxAbsAmount >= abs(params.amountSpecified)SignedQuoteAmountLimitExceeded
signer bindingrecovered signer equals CollateralConfig.quoteSigner and signer is configuredSignedQuoteSignerMismatch / SignedQuoteSignerMissing
replay safetyderived replay key not consumed yetSignedQuoteReplay
oracle-policy envelopesigned quote value remains within policy versus oracleSignedQuotePolicyViolation

Replay lifecycle note:

  • The derived replay key is consumed only after all settlement checks pass and state transition is accepted.
  • A failed attempt reverts and does not consume the quote.

Observability model:

  • Success path emits SignedQuoteSettled and standard settlement telemetry.
  • Non-signed hook callbacks emit no settlement telemetry and leave vault/debt state unchanged.
  • Failure path reverts with explicit signed-quote errors; no settlement state is applied.

Core Responsibilities

  • maintain collateralBalance, debtBalance, and totalDebt
  • execute depositCollateral, withdrawCollateral, mint, and redeem
  • allow hook callbacks only from the configured hook via setSettlementHook
  • store settlement hook address with setSettlementHook
  • emit lifecycle events (Minted, Redeemed, HookSettlementExecuted)

Key Enforcement Points

  • collateral enablement and pause flags (mintPaused, redeemPaused)
  • per-collateral limits (mintCapTx, mintCapBlock, mintCapDay, redeem equivalents)
  • global limits (globalMintCapDay, globalRedeemCapDay, globalDebtCeiling)
  • solvency and debt bounds via SolvencyEngine checks

Common Reject Cases

  • MintNotAllowed/RedeemNotAllowed for blocked safe modes
  • OracleUnavailable for missing or paused oracle output
  • CapExceeded when throughput windows breach configured limits
  • CollateralDisabled when the collateral is not enabled in risk config
  • UnsupportedCollateral when OracleAdapter has no enabled config for this collateral
  • DebtCeilingExceeded or GlobalDebtCeilingExceeded on issuance overflow
  • UnauthorizedSettlementCaller for invalid callback source
  • InsufficientCollateral/InsufficientDebt and AmountTooLargeForDelta for settlement accounting constraints
  • signed-quote failures: SignedQuoteReplay, malformed/unsupported signed payload reverts, SignedQuoteExpired, SignedQuoteTraderMismatch, SignedQuotePoolMismatch, SignedQuoteSignerMismatch, SignedQuoteSignerMissing, SignedQuoteAmountLimitExceeded, SignedQuotePolicyViolation, SignedQuoteModeDisabled

Settlement Math

  • Signed settlement intent comes from SwapParams, not hookData:
    • size = abs(params.amountSpecified)
    • size > 0 and params.amountSpecified < 0 => mint
    • size > 0 and params.amountSpecified > 0 => redeem
    • pool BalanceDelta is ignored by CollateralManager for settle amount/action
    • non-signed hookData returns zero/no-op instead of deriving a settlement action
  • Mint path:
    • fee = amount * mintFeeBps / 10_000
    • mintAmount = amount - fee
    • debtBalance and totalDebt increase by mintAmount
  • Redeem path:
    • grossCollateralOut = stableAmount * 1e18 / oraclePriceE18
    • collateralFee = grossCollateralOut * redeemFeeBps / 10_000
    • user receives grossCollateralOut - collateralFee
  • vaultSettlementSpecifiedAbs(...), previewSwapExternal(...), settleSwapExternal(...), and consumeSignedQuoteForSwap(...) must be called by the hook; direct user calls revert via onlySettlementHook.

Source

On this page