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
The source code is
src/oracles/EquityOracle.sol on GitHub. The ABI is /abis/EquityOracle.json.
Read methods
regime
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.price
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.
Return values
Errors
ZeroAddress
InvalidConfig
InvalidDecimals
InvalidFeed
PriceUnavailable
DarkDurationExceeded
maxDarkDuration while DARK.