April 9, 2019
How are orders matched? What is the execution price?
UfoDex matcher iterates orders from middle of orderbook to the edges. For concurrent orders with same prices older (earlier) order is evaluated in first place.
Matcher also validates a number of significant conditions before passing two matching orders to deal execution engine. This includes: online status, sufficient balance, penalties on previous failures and some others.
Due to the possible price overlapping (order #1 sells at 0.5, order #2 buys at 0.7) UfoDex gives price priority to the younger order. E.g.:
- younger order will get requested amount by spending less at better price.
- older order will get requested amount at requested price.
This is done to stimulate liquidity for existing orders.