Module 2: Price band
The order price stays what the maker signed. The band adds a second condition: the feed the maker named must read between two signed values at the moment of the fill, and the reading must be fresh. If the market moves away, the order stops filling by itself.
Status
Ready
Signed
Feed + low + high + age
Code · OrbuSettlementDesk.sol
function _checkBand(Policy calldata p) private view {
if (p.feed == address(0)) return;
(bool ok, int256 answer, uint256 updatedAt) = _readFeed(p.feed);
if (!ok) revert ReferenceUnavailable();
if (block.timestamp - updatedAt > p.maxFeedAge) revert ReferenceStale();
if (answer < p.bandLow || answer > p.bandHigh) revert OutsideBand(answer);
}Tests that cover it
test_bandInsideFills test_bandOutsideReverts test_bandStaleReverts test_bandBrokenFeedReverts test_fork_priceBandAgainstARealFeed
What it does
A fill reverts when the feed the maker names reads outside the signed band or is older than the signed age.
On chain
- Desk
- Not deployed yet
- Enforced
- —
- Roster
- Opens after the token launches
- Reads
- the named feed
