Skip to main content

Layer 2 — Direction Pre-Filter

Before any oracle calls are made, the system checks whether the requested trade direction is currently permitted for the selected corridor. This check is performed early — oracle calls, volatility checks, and inventory lookups are all skipped if the direction is blocked.

How It Works

The Direction Pre-Filter reads the current State Flag for the specific corridor being requested. In RESTRICT state, the system operates in one-way mode — only the direction that reduces the protocol's inventory risk is permitted.

System StateDirection Behaviour
NORMALBoth BUY and SELL directions permitted for all corridors
PROTECTBoth directions permitted; spread and size limits tightened
RESTRICTOne-way only — only the direction that reduces inventory imbalance is permitted
HALTNo new quotes in any direction; settle and unwind only
Design Rationale

Placing the direction check before oracle calls is a deliberate performance and risk optimisation. Rejected requests consume no oracle quota, generate no inventory lock, and add no latency to the queue.