IDEX
  • Introduction to IDEX
  • What is IDEX
    • Components
      • High-performance Exchange
      • Hybrid Liquidity
        • HL Mechanics
        • IDEX HL and LPs
      • Smart Contracts
    • User Benefits
    • Liquidity Mining
    • Staking
    • Referral Program
    • Hummingbot
    • Markets
    • Fees
    • Live Help
  • Code
    • API
    • Smart Contracts
      • Custodian
      • Exchange
      • Governance
    • Resources
  • User Guides
    • Getting Started
      • Connect Your Ledger Hardware Wallet to IDEX
      • Connect Your Metamask Account to IDEX
      • Connect You Private Key/Keystore on IDEX
    • Trading
      • Deposit tokens
      • Withdraw tokens
      • Buy and sell
      • View and cancel open orders
      • View trade, deposit, and withdraw history
    • LP and Farms
      • Add liquidity (LP)
      • Remove liquidity (LP)
      • Add LP tokens to farms
      • Remove LP tokens from farms
    • Staking
      • Operate your own staking node
        • Host a public staking node
      • Delegate to an existing node
    • Polygon Confirmations
    • Hummingbot Setup
      • Pure Market Making
      • Arbitrage
    • AURA Swap Instructions
    • Withdraw Directly on Chain
      • Farm ID List
  • FAQ
    • Polygon Bridge
    • Escape Hatch
    • Adding Polygon To Metamask
    • Clock Sync
Powered by GitBook
On this page
  • Custody/escrow
  • Enforce system rules

Was this helpful?

  1. What is IDEX
  2. Components

Smart Contracts

The IDEX smart contracts bring programatic guarantees to the platform.

PreviousIDEX HL and LPsNextUser Benefits

Last updated 3 years ago

Was this helpful?

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

Custody/escrow

The 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 (see ).

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 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.

The smart contracts are also responsible for enforcing the rules of the AMM liquidity pools, allowing users to market make without a third party or any additional infrastructure.

IDEX smart contracts
smart contract code
off-chain trading engine