Core Contracts

The core consists of a single factory, an orderbook deployer, and the many orderbooks the factory will create.

A significant amount of care and attention has been given to gas optimization in the core contracts. The result is a substantial reduction in gas costs for all protocol interactions compared to Uniswap, at the cost of a reduction in code clarity.


Factory Reference

The factory in this context refers to the component responsible for defining the logic behind generating orderbooks. An orderbook, on the other hand, is comprised of two essential elements: the base token and the quote token, which together form the asset pair. Additionally, each orderbook is associated with a specific fee. It is important to note that it is possible to have two orderbooks with the same assets but different order configurations in terms of the base and quote tokens.


Orderbook Reference

Orderbooks are the storage of orders and custody for the paired assets for atomic swap. users' funds are segregated with extensive business logic with their orders, so hackers cannot access more than each user's deposited amount in his or her orders.


MatchingEngine Reference

MatchingEngine contract primarily serve as the automated market maker for all paired assets. It interacts with orderbooks to get orders and match with user's order. Additionally, they expose price oracle data and may be used as an asset source for flash transactions. There is no dark market as all operations are done on-chain environment. No brokerage nor external related device is involved, and the contract provides fair and clear disclosure on how the order is matched.

Last updated