Trading
Order Types
Limit, market, FOK, IOC, GTC, and GTD order behaviour
Order Types
The core order type is the limit order, which specifies an exact price and quantity, fills at the specified price or better, and partially fills by default with the remainder resting on the book. A market order is simulated by combining an aggressive limit price with fill_or_kill = true.
| Order Type | Behaviour | Implementation |
|---|---|---|
| Limit | Fills at specified price or better; remainder rests on book | limit_order_create_operation |
| Market (simulated) | Immediate fill or full rejection — no book resting | Aggressive limit price + fill_or_kill = true |
| Fill or Kill (FOK) | Entire quantity fills in one execution or rejected; no partial fills | fill_or_kill = true |
| Immediate or Cancel (IOC) | Fills as much as possible immediately; remainder cancelled | expiration = current block time + 1 block |
| Good Til Cancel (GTC) | Rests on book indefinitely until filled or manually cancelled | expiration = time_point_sec::maximum() |
| Good Til Date (GTD) | Rests until a specified expiration timestamp; auto-removed on expiry | expiration = future timestamp |