Basic Order Types

Published on Jan 25, 2024Updated on Aug 14, 20244 min read

1. Limit Order

A limit order is one in which the user sets the order quantity and the highest acceptable bid or ask price, and when the market price meets the user's expectations, the system will execute at the best price within the limit range.

Scenario: Assuming the current BTC market price is 42,000 USDC and a user wishes to buy at 40,000 USDC. He/she can select Limit and set the buy price as 40,000 USDC. After the order is placed, the order will be filled automatically when the price drops to 40,000 USDC or below.

limit order

2. Market Order

A market order allows users to instantly buy or sell at the best available market price. It should be noted that different market orders may have different limits and the limits may be changed as the market fluctuates.

Scenario: Imagine the Last Traded Price of BTC is at 40,500 USDC. If a user wishes to buy BTC at the market price quickly, he/she may place a market order and set its total amount as 20,000 USDC. The order will be executed immediately (unless under extreme volatility) and it shall be filled around $40,500 after the order has been placed.

market order

3. Advanced limit order

While a regular limit order is Good till Canceled by default, an advanced limit order offers 3 order options — Post Only, Fill or Kill, and Immediate or Cancel.

Post Only

  • Post Only orders are guaranteed to enter the order book with the user being a market maker. If a Post Only order is able to match with an existing order instantly, it will be canceled.

Fill or Kill

  • A Fill or Kill order must be filled fully and immediately, otherwise the entire order will be canceled.

Immediate or Cancel

  • Immediate or Cancel orders must be filled immediately. Any unfilled portion of the order will be canceled

zkdex advanced limit 1

For example, if a user wants to buy BTC and the order book is shown as below:

zkdex advanced limit 2

Scenario 1

You would like to incur maker fees only and have selected Post Only. If you set the buy price as 30,000 USDT and there's no immediate matching sell order, your order won't be filled right away and will be placed on the order book, making you a market maker. If your buy price is 30,740 USDT and matches with a sell order instantly, your order will be canceled.


Scenario 2

You selected the Fill or Kill. If your buy price is 30,741 USDT and the order amount is 1 BTC, yet the total amount of available BTC on the order book is 0.882 BTC (0.855+0.026+0.001), your order will be canceled because it cannot be filled completely (1 - 0.882 = 0.118 BTC). In this example, if your order amount is 0.882 BTC or less, the order will be placed and filled.


Scenario 3

You selected the Immediate or Cancel. If your buy price is 30,741 USDT and the order amount is 1 BTC, and the total amount of available BTC on the order book is 0.882 BTC (0.855+0.026+0.001), part of your order will be filled and the rest will be canceled. 0.882 BTC will be filled while the remaining 0.118 BTC will be canceled.