After you create an order, XREX processes your buy or sell request through an order matching mechanism. When you click Buy or Sell on the app or web interface, it is equivalent to submitting an order to XREX. At this point, the order will be recorded in the order database and immediately scheduled for processing by the Match Engine. A trade is successfully executed when the system matches buy and sell orders that meet each other's price requirements.
XREX platform operates on a continuous trading matching basis to identify appropriate orders:
Unmatched orders are kept in the "buy" or "sell" order books within the database. In the main product display, the central section shows the market price of the selected cryptocurrency. The red text reflects the selling price and amount, while the green text indicates the buying price and amount.
For limit orders (which specify a buying or selling price), the following procedures are followed:
First, an attempt will be made to match these with corresponding opposite orders in the order book.
If immediate matching is not feasible, the order will be entered into the order book and organized by price first and then time, awaiting future matching.
For market orders (which do not specify a price), the following procedures are applied:
Orders will be sought in the opposite order book based on price first, then time. This means the closest price will be prioritized; if several orders have the same price, those submitted earlier will be chosen.
If the total amount of matched orders falls short of the quantity needed for the market order, the completed amount will be deducted, and the system will continue searching for higher-priced or later orders until all remaining quantities are matched.
The final transaction price will be calculated as the average price, specifically average transaction value ÷ total transaction volume.
For example, if Bitcoin's current market price is 60,000 USDT, and limit order A aims to sell 1 BTC at 62,000 USDT, it will be placed in the sell order book as there are no buy orders matching this price. Later, if Bitcoin's price increases to 61,000 USDT, market order B wishes to buy 1 BTC. The matching system finds a corresponding order in the sell order book (0.4 BTC at 61,000 USDT). Once this transaction is complete, the remaining 0.6 BTC will match with limit order A (0.6 BTC at 62,000 USDT), leaving 0.4 BTC of limit order A unsold. Therefore, the transaction price for market order B will be calculated as (0.4 x 61,000 + 0.6 x 62,000) ÷ 1 = 61,600 USDT.