LogoLogo
  • Introduction to Kuma
  • Design Components
    • High-performance Exchange
    • Smart Contracts
    • XCHAIN - Arbitrum Orbit L2
  • User Benefits
  • Order Types
    • Market, Limit and Conditional Order
    • Time In Force Selections (GTC, GTX, IOC, FOK)
    • Post-Only Order
    • Reduce-Only Order
  • Markets and Market Details
  • Index Price Oracle and Weights
  • Fees
  • XCHAIN Network Details
  • KUMA Token (Formerly IDEX Token)
  • Rewards
    • Trade Rewards - BGT Emissions
    • Referrals
    • Market Maker Program
  • Session Keys
  • Kuma Connect
  • Liquidation Partner Program (LPP)
  • FAQ
    • Clock Sync
Powered by GitBook
On this page
  • Custody/escrow
  • Enforce system rules
Export as PDF
  1. Design Components

Smart Contracts

The Kuma smart contracts bring programatic guarantees to the platform.

Historically, high performance exchanges require users to custody funds with the exchange. Kuma utilizes a series of smart contracts to decentralize fund custody and trade settlement as well as introduce novel DeFi mechanisms.

Custody/escrow

The off-chain trading engine executes trades in real time before dispatching transactions to the network for settlement. This process creates a delay between when the user signs the order and final settlement. It’s critical that the funds for both the maker and taker do not move on-chain in the time between execution and settlement or else the settlement transaction will fail.

The smart contract solves this by acting as a form of escrow, restricting the movement of funds until all settlements have finished. All trades and withdrawals are sequenced to ensure that on-chain balances are updated in the correct order. Note: a special smart contract function, wallet exit, ensures that funds cannot be restricted indefinitely.

Enforce system rules

In centralized order book exchanges, users must trust that the exchange to properly match and settle trades. Even more critically, users trust the exchange to maintain custody and process valid withdrawals.

The Kuma smart contracts cryptographically enforce ownership and authorization. This ensures that all trades are authorized by owner and that withdrawals are legitimate and only sent to the account owner.

PreviousHigh-performance ExchangeNextXCHAIN - Arbitrum Orbit L2

Last updated 3 months ago