Depth

Integration

Status of this work

The adapter contracts are not deployed. This page documents the interface they will expose; the live board already runs the classification rules against mainnet data.

Open the console

The interface

interface IStockOracleAdapter is AggregatorV3Interface {
  enum Status { NORMAL, OFF_HOURS, CORPORATE_ACTION, DESYNC, TOKEN_HALTED, SEQUENCER_DOWN, UNSAFE }

  function status()     external view returns (Status);
  function observedAt() external view returns (uint256);
  function valueOf(uint256 rawAmount)  external view returns (uint256);
  function valueOfUI(uint256 uiAmount) external view returns (uint256);
  function commit() external;
  function token() external view returns (address);
  function feed()  external view returns (address);
}

updatedAt means something different

Inside a protection window the adapter returns the current time in updatedAt, redefined as the moment the adapter confirmed the value is safe to use. Returning the underlying round time would trip your own staleness check and freeze your market, which is the failure the adapter exists to prevent. The honest market observation time is always available separately from observedAt(), and the reason is in status().

Optional: gate new borrows

Liquidation protection needs no code change. Preventing new risk from being taken on a held price does, and it is three lines.

require(
  IStockOracleAdapter(oracle).status() == IStockOracleAdapter.Status.NORMAL,
  "market not in normal state"
);

Contact

hello@example.com