Short-term orders
A short-term order lives for at most 20 blocks (~17 s) and expires on its own. Market makers use them: quotes are refreshed often, and old ones need no cancelling.
How they differ from regular orders
| Regular order | Short-term order | |
|---|---|---|
| Message | MsgPlaceOrder | MsgPlaceShortTermOrder |
| Duration | No expiry or until a set block | Good-til-block is required, at most 20 blocks ahead |
| Placements per address per block | 30 | 500, counted separately |
| Replacement | MsgReplaceOrder | A new order with the same client_id |
| Cancellation | MsgCancelOrder by number | MsgCancelShortTermOrder by client_id |
Everything else works as for regular orders: matching, prices, fees, margin, the post-only and reduce-only flags.
Replacement by client_id
A new short-term order with the same client_id in the same subaccount replaces the active one:
- What happens. The old order is removed; the new one rests with the new price and quantity.
- When it is not allowed. Only an order from a previous block can be replaced. Two orders with one client_id in the same block are not accepted.
- Expiry. The new order cannot expire earlier than the old one.
Limits
- Gas. A transaction with short-term orders uses at most 3,000,000 gas.
- Replay. The same signed transaction is not accepted again until it expires.
- Storage. The order is kept in network state until it is filled, cancelled or expires.
- Collateral. An opening short-term order is checked for collateral like a regular one. If the collateral is short, the transaction lands in the block and fails there, at no fee.