What are short-term orders?
As part of the default settings of the v4 open source software (”dYdX Chain”), short-term orders are short-lived orders (expires in a short amount of time) that are meant to be placed immediately and belongs in the same block the order was received. These orders stay in-memory up to 20 blocks, with only their fill amount and expiry block height being committed to state. Short-term orders are mainly intended for use by market makers with high throughput or for market orders.
More information on short-term orders on dYdX Chain is available here.
What are long-term orders?
As part of the default settings of the v4 open source software, long-term orders are “stateful orders” that are committed to the blockchain. Long-term orders encompass any order that lives on the orderbook for longer than the short block window. The short block window represents the maximum number of blocks past the current block height that a short-term
MsgCancelOrder message will be considered valid by a validator. Currently the default short block window is 20 blocks on the v4 open source software.
How are short-term orders different from long term orders?
Short-term orders are different than long-term orders on the v4 open source software because short-term orders only stay in-memory up to 20 blocks. Short-term orders are only in state until after Good-Till-Block (aka expiry, even if fully-filled or cancelled). Meanwhile, long-term orders are stateful orders that live in the in-memory orderbook.
Why can short-term orders only be Good-Till-Block (GTB)?
Short term orders can only be GTB because in the interest of being resilient to chain halts or slowdowns. Short-term orders have a maximum GTB of current block height + short block window. The default value is 20 blocks, or about 30 seconds on the v4 open source software.
Why can stateful orders only be Good-Till-Block-Time (GTBT)?
Stateful orders have a maximum GTBT of current block time + Stateful Order Time Window. The maximum default value is 90 days on the front end and 95 days on the protocol for v4 open source software. GTBT is used instead of GTB to give a more meaningful expiration time for stateful orders.
Disclaimer and Terms