FOREVER MARKETS
Orders & execution
Atomic best execution across the onchain order book and inventory-skewed LP curve.
Hybrid best execution
Every taker order compares the best resting price with the LP curve’s next marginal price. The router consumes whichever source is better, then compares again. A single order can therefore fill partially from the book and partially from the curve.
All queue mutations, collateral classification, position updates and risk checks occur in one non-reentrant transaction. If a fill-or-kill order cannot finish or a post-fill risk check fails, the complete route reverts.
- 01Read both sources
Find the best opposite FIFO order and current LP marginal quote.
- 02Apply the trader limit
Ignore any source outside the maximum NVIDIA price or minimum AMD price.
- 03Take the better source
On equal prices, the resting order wins.
- 04Recheck risk after every segment
Funding, reserve, leverage and endpoint solvency are validated before continuing.
Price-time-priority order book
One-basis-point D ticks from 0.01 to 0.99
FIFO within every price level
Partial fills preserve queue priority
Cancel-and-replace loses priority
Up to 32 active resting orders per maker
Up to 16 book steps per router transaction
Time in force
| Type | Behavior |
|---|---|
| FOK | Fill every requested unit within the limit or revert everything |
| IOC | Fill what is immediately available; cancel the remainder |
| GTC | Fill marketable units, then rest the remainder |
| Post-only | Revert if any part would execute immediately; otherwise rest all units |
LP pricing curve
The PMM curve starts from the conservative oracle bound and moves against trades that worsen protocol inventory. Trades that reduce imbalance can receive price improvement.
The curve is path-independent: splitting the same trade does not avoid the quadratic inventory impact. It also has hard net-unit and post-trade reserve caps.