LayerAkira documentation
  • about
    • Overview
    • Trading pairs
    • Fees
    • Glossary
    • FAQ
  • integration
    • Technical Overview
      • Fee types
      • Exchange flow
      • Trading pipeline
      • Trading accounts
      • Ecosystem Book
        • Direct user interactions
      • Router Book
      • Routers
        • Rewards and penalties
        • Router flow
      • Signature
    • Trading
      • Fees
      • Order
        • Order structure
        • Order status
        • Self trade prevention modes (STP modes)
        • Execution semantic
      • Deposit
      • Withdraw
      • Increase Nonce
      • Matching engine status
    • Endpoints
      • Common
      • Auth
      • Get endpoints
      • Post endpoints
      • Responses
      • Stream subscriptions
      • Withdraw money
      • Increase nonce
    • Smart Contact
      • Methods
      • Structures
      • Events
    • SDK
      • Python CLI
    • Testnet
  • Legal
    • Terms of Service
Powered by GitBook
On this page
  1. integration
  2. Technical Overview

Exchange flow

PreviousFee typesNextTrading pipeline

Last updated 5 months ago

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 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 for both users from our ecosystem and outside of our ecosystem through Routers.

endpoints
endpoints