1
Resolve the book's oracle
2
Read regime and price
Enum:
LIVE=0, DARK=1, HALTED=2, CA_WINDOW=3, SEQ_DOWN=4.3
Gate the UI
Match the app copy. Market closed: disable the borrow slider, keep repay and add stock.
What can go wrong
price()reverts withPriceUnavailable(regime)orDarkDurationExceeded. Catch it. Do not retry-spam.- A zero
sequencerFeednever yieldsSEQ_DOWN. Check the oracle immutables before you build a sequencer banner. - Cross-book accounts: each book has its own oracle. Gate per book, then AND for a multi-stock borrow.
borrowingEnabledis independent of regime. Both must be true to borrow.
price() reverts.
price() reverts with PriceUnavailable(regime) or DarkDurationExceeded. Catch it. Do not retry-spam.
A zero sequencerFeed never yields SEQ_DOWN. Check the oracle immutables before you build a sequencer banner. ARCHITECTURE.md lists sequencer as required. The code makes it optional.
Regime table
Next: Oracle, Market hours for users.