-
Notifications
You must be signed in to change notification settings - Fork 72
2. Order
true if buy/bid, false if sale/ask
Unique number assigned to each order. uniquely identifies each order.
UserId of order. UserId is used for self match prevention.
Quantity user is willing to buy/sell. MatchingEngine will reduce OpenQuantity after each match.
Limit price of the order, in case of buy maximum price buyer willing to pay for one unit/quantity of the asset. In case of sale minimum price seller is willing to accept for one unit/quantity of the asset. In the case of market order it must be 0.
trigger price for stop order.
Seconds from 1 Jan 1970(UTC) after which order should be cancelled. This should be set for only good till date order. for good till cancel orders it must be set to 0.
Represents order condition, it could be one of the following
- Immediate or cancel - Order must be filled immediately, if order is not filled then cancel the remaining open order. it allows partial fills.
- Fill or kill - only fill order in full immediately or cancel the order.
- Book or cancel - Order must not be match with any open order while placing order. it must be added to order book. it can not be matched with resting orders in book. if order can be matched resting order in book then cancel the order.
SelfMatchAction represents action needs to be take when self match / self trade happens. There are 4 Options,
- Match - Allows match to happen.
- CanceNewest - Cancels incoming order or newer order. in the case of stop order, trigger time is used to indetify newer order.
- CancelOlder - Cancels resting order in the book or older oder. in the case of stop order, trigger is used to identify older order.
- Decrement - Canceles smaller order and decrement quantity of larger order. quantity of larger order is reduced by quantity of smaller order. Smaller order is cancelled fully.
Tip quantity for each tip added into order book. This must be set for iceberg orders. for other orders it must be set to 0.
Total quantity of iceberg order. This must be set for iceberg orders. for other orders it must be set to 0.
OrderAmount can be specified for market buy and stop market buy. instead of providing OpenQuantity we could provide amount. for example for market buy bitcoin worth of 2000 USD. it means buy any quantity of bitcoin at any price but amount should not exceed 2000 USD.
represents fee to be charged for this order.
for order matcher internal user. order matcher calculates fee on order.
for order matcher internal use. Sequence is used to find priority of order. Lower sequence has higher priority.
for order matcher internal use. order matcher tracks cost of the order. it is sum of matched quantity * match rate of all the matches.