Oracles

Order Execution Assurance through Oracles

Evo Exchange uses several API3 airnode oracles to confirm trade data between the smart contract and the matching engine.

After the user places an order and the matching engine matches that order, the trade is then moved to a trades database in the orderbook. When the user signs the transaction with his wallet, along with the order details, the user sends a trade confirmation generated by the back-end to the Exchange smart contract. When the trade is processing in the smart contract, the smart contract calls the oracle which confirms that the trade confirmation number matches with the back end's trade confirmation number. If the trade confirmation matches the back-end trade confirmation details, the order is allowed to execute in the smart contract. Otherwise, the smart contract takes note of the fraudulent transaction and does not allow the order to execute.

This is done to ensure that a user is not able to place a malicious trade directly with the smart contract and must go through not only the smart contract security measures, but also the matching engine's security measures.

When an order is sent from the matching engine to the smart contract the smart contract requests matching trade details from the orderbook via the oracles. We say "several" because we are continuously launching additional airnodes to improve the speed and efficiency of the exchange.

Last updated