Steer Protocol
Module Deep DivesRisk and Pricing Layer

ChainlinkOracleAdapter

Effective price selection with explicit mode and reason-code output.

What It Does

ChainlinkOracleAdapter normalizes feed health into deterministic execution output:

  • priceE18
  • OracleMode
  • reasonCode

Execution modules consume this output so feed hygiene logic is not duplicated in hook or manager paths.

Core Responsibilities

  • validate primary feed answer freshness and bounds
  • optionally validate fallback feed and deviation thresholds
  • optionally gate by L2 sequencer status + grace period
  • return explicit mode transitions and reason codes

minAnswer and maxAnswer are shared 18-decimal price bounds applied after each feed is normalized. Zero independently disables either bound. Before replacing an existing adapter configured with nonzero raw-feed bounds, review the intended economic limits and configure their 18-decimal equivalents on the replacement.

Decision Output

Reason Codes

  • 0: NONE
  • 1: STALE_CHAINLINK
  • 2: INVALID_CHAINLINK_ANSWER
  • 3: OUT_OF_BOUNDS_CHAINLINK
  • 4: CHAINLINK_FEED_DEVIATION
  • 5: SEQUENCER_DOWN
  • 6: SEQUENCER_GRACE_PERIOD
  • 7: FALLBACK_UNAVAILABLE
  • 8: GLOBAL_PAUSED

Code 4 means current Chainlink feed prices disagree beyond the configured deviation limit.

Validation Notes

  • if both feeds are configured, redeemOnlyDeviationBps must be >= maxDeviationBps when both are non-zero.
  • when fallback is disabled, fallbackMaxAge must be zero; when configured, it must be non-zero.
  • a sequencer grace period is only valid with a sequencer feed configured.

Source

On this page