Skip to main content
EquityOracle prices one stock token in USDG and reports the market regime that drives Stockline’s action table. It is stateless: every output comes from Chainlink feeds, the stock token’s corporate-action flags, the HolidayCalendar, and immutable parameters. regime() returns LIVE, DARK, HALTED, CA_WINDOW, or SEQ_DOWN. price() returns a 1e36-scaled price in LIVE, a haircut price in DARK, and reverts in the other regimes. EquityOracle lets you:
  • Read the current regime for a stock token
  • Read the collateral price in loan units, scaled by 1e36
  • Inspect every immutable parameter: staleness, haircut, windows, and feeds
This contract is not deployed on a listed network yet. Watch Addresses. The source code is src/oracles/EquityOracle.sol on GitHub. The ABI is /abis/EquityOracle.json.

Read methods

regime

Returns the current regime. Priority order: SEQ_DOWN if the sequencer feed reports down or is inside its grace period, CA_WINDOW if the token’s oraclePaused() is true or the timestamp is within caBoundaryWindow of effectiveAt, DARK on weekends, holidays, and their offsets, HALTED if a feed is non-positive or stale, otherwise LIVE.
If sequencerFeed is the zero address the oracle never returns SEQ_DOWN.
Return values

price

Returns the collateral price in loan-token units scaled by 1e36 (Morpho Blue convention). In LIVE it is stockAnswer * scale / loanAnswer. In DARK the same value is reduced by darkHaircutBps, and the call reverts with DarkDurationExceeded if the stock feed is older than maxDarkDuration. Reverts with PriceUnavailable in HALTED, CA_WINDOW, and SEQ_DOWN, and InvalidFeed if either answer is not positive.
Any view on Stockline or LiquidationModule that values collateral inherits these reverts. Check regime() first.
Return values

Errors

ZeroAddress

A required constructor address was zero. The sequencer feed may be zero.

InvalidConfig

A staleness or duration was 0, the haircut was 100% or more, an offset was a full day or more, or the scale exponent exceeded 54.

InvalidDecimals

A token or feed reports more than 18 decimals.

InvalidFeed

A feed answer was zero or negative.

PriceUnavailable

price() was called in HALTED, CA_WINDOW, or SEQ_DOWN.

DarkDurationExceeded

The stock feed is older than maxDarkDuration while DARK.