Skip to main content
The core already enforces the action table. Your UI should match it so users do not send a revert. Addresses: Addresses for the factory and each book’s oracle on Books.
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 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.
  • Cross-book accounts: each book has its own oracle. Gate per book, then AND for a multi-stock borrow.
  • borrowingEnabled is independent of regime. Both must be true to borrow.
The core already enforces the action table. Your UI should match it so users do not send a revert. Enum: LIVE=0, DARK=1, HALTED=2, CA_WINDOW=3, SEQ_DOWN=4. Only LIVE should enable borrow and withdraw. Repay and add stock always. Show a haircut banner in DARK. Show price paused when 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.