Exchange flow

Our order book design is comprised of two parts:

1) LayerAkira Smart Contract ("Smart Contract"):

  • The Smart Contract holds the user funds and performs necessary validation checks before any trading activity is executed, whether initiated by a user or by the Exchange on behalf of a user.

  • Allows users to perform certain activities (e.g. withdrawals) on-chain without direct interaction with the Exchange

  • Emits events to the blockchain for each trading activity.

2) LayerAkira Exchange ("Exchange"):

  • Provides endpoints through which users can perform trading activities in a CEX-like manner

  • Ensures that all trading activities are processed fairly and are valid.

fair" refers to when the trade arrives to the Exchange

"valid" refers to the execution semantic

  • Responsible for consuming emitted events by the Smart Contract to maintain a valid state of off-chain order book and off-chain user balances.

  • Responsible for batching all trading activities into the rollup and pushing it on-chain as soon as possible to keep the smart contract state updated with the off-chain state.

  • Responsible for maintaining the CLOB and providing access to it through endpoints for both users from our ecosystem and outside of our ecosystem through Routers.

Last updated