Order Types

  • Market: An order that executes immediately at the current mark price.
  • Limit: An order that executes at the selected limit price or better.
  • Stop Market: A market order that is only triggered when the price reaches the selected stop price.
  • Stop Limit: A limit order that is only triggered when the price reaches the selected stop price.
  • Time-Weighted Average Price (TWAP): An order that splits a large order into smaller order executed over time.

Order Execution Options

  • Reduce Only: An order that can only reduce an existing position instead of opening a new one in the opposite direction.
  • Post Only (ALO): An order that is added to the order book but doesn’t execute immediately, and instead is executed as a resting order.
  • Immediate or Cancel (IOC): An order that will be canceled if not immediately filled.
  • Take Profit: An order that automatically closes a position when the price reaches a user defined take profit (TP) price.
  • Stop Loss: An order that automatically closes a position when the price reaches a user defined stop loss (SL) price.

TWAP Details

When submitting a TWAP order, users can choose the order’s expiration time and an interval for the execution of each suborder. This interval is by default set to 30 seconds. Therefore, each suborder size will be placed with a size equal to the total order amount divided by the number of orders, which in turn is equivalent to the total execution duration divided by the chosen suborder interval. To ensure optimal execution, users can also configure a maximum slippage per suborder. By default, suborders are capped to have at most 3% slippage. To protect our users from getting hunted, TWAP orders are stored in a Merkle tree with each suborder having a valid time window for execution. Users sign the Merkle tree root, and each suborder is not known onchain until it is executed. This ensures that TWAP orders on GTE are safe from toxic flow hunting large orders.

Order Matching

GTE’s matching engine follows a price-time priority system to match orders fully onchain. When a taker places a new order, the GTE Matching Engine finds the order on the opposite side with the best price (highest priority). If there are multiple orders with equivalent best prices, the engine matches against the oldest order and executes the trade. This process continues until the taker’s order is fully filled or until there are no more crossing orders. If the taker submitted a limit order, it will get inserted into the book on the corresponding side.