Exchange
NevDEX employs the Order Book trade execution model just as opposed to AMM as a complementary liquidity pool facilitator.
The order book based infrastructure unlocks the opportunity to change various types of assets with different levels of complexity in the DeFi space.
NevDEX favors the off-chain matching on-chain settlement model, under this model the orders get matched instantly off-chain while at the same time verified and settled by the Godwoken EVM smart contract on-chain brings the speed and convenience of centralized exchanges to DeFi while remaining fully trustless and transparent.
NevDEX Matching Engine
The NevDEX Matching Engine is generally responsible for determining if a set of two or more orders "match" and thus should be submitted to the blockchain for verification and settlement. In order to do this it is also responsible for a number of other tasks related to orders.
First, the engine is responsible for maintaining a valid orderbook for each market (base/quote token pair) in which it accepts orders. It does this by receiving new order data, cancelled order data, and transaction success/failure events from the exchange contract, and using that data to mutate the orderbook as necessary.
Next, with a valid orderbook, the engine is responsible for taking incoming order data and determining if it is necessary to submit a match to the exchange contract. It does this by looking for any current orders which are capable of filling the incoming order in a valid way, either fully or partially. If an incoming order is capable of being matched by multiple orders, the engine will prioritize the matching orders first by price, then by time submitted. This means that a matching order offering a better price to a trader will always be prioritized, no matter when it was submitted to the orderbook. If two matching orders have an identical price, the one that was submitted to the orderbook first will always be prioritized over the one submitted at a later time.
Then, once all valid matching orders have been discovered and prioritized, the engine will generate data for a transaction to be submitted to the exchange contract.Once the transaction is successful, the orderbook will be updated as appropriate.
Last updated