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 State | Direction Behaviour |
|---|---|
| NORMAL | Both BUY and SELL directions permitted for all corridors |
| PROTECT | Both directions permitted; spread and size limits tightened |
| RESTRICT | One-way only — only the direction that reduces inventory imbalance is permitted |
| HALT | No 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.