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
  • Trading Engine
  • Order book
  • Advanced orders
  • Swap

Was this helpful?

  1. What is IDEX
  2. Components

High-performance Exchange

An off-chain system that manages all aspects of trading

PreviousComponentsNextHybrid Liquidity

Last updated 3 years ago

Was this helpful?

The exchange component is similar to that of top centralized exchanges. This design enables IDEX to match centralized exchanges in latency and throughput-- performance that is unavailable from other DEXs.

Trading Engine

IDEX utilizes an off-chain trading engine for trade execution bringing:

  • Extreme performance, processing tens-of-thousands of orders per second with millisecond latency.

  • Guaranteed sequencing, executing orders in the precise order that they are received by the server

This is in contrast to the majority of DEXs which execute trades on-chain, leading to:

  • Low throughput and high latency associated with blockchain transactions

  • Non-deterministic ordering with miners deciding which transactions are included and in what order

The IDEX trading engine leads to a responsive user experience and insulates users from the failed trades, front-running, and sandwich attacks which plague on-chain DEXs.

Order book

Paired with the trading engine is an off-chain order book. This combination both minimizes gas costs and maximizes the benefits of the trading engine.

Orders on IDEX are represented by signed transactions that include the price and amount (among other parameters. See ). These orders are passed through the trading engine where they are processed; orders are matched and executed as a trade when overlapping with existing liquidity, placed on the order book as a new limit order when not, etc.

When orders match a trade is executed. Both traders' balances update in real time, and they can continue trading immediately using the new balances. Simultaneously the completed trade is sent to the network for settlement.

On-chain transactions only occur during settlement of a matched trade. Users are free to place and cancel orders as frequently as they like, without incurring additional network costs. Order placements/cancelations are processed in real time, enabling more advanced market making and trading strategies.

Advanced orders

Swap

The use of a high-performance trading engine enables advanced order types typically only found on centralized exchanges. These include stop-loss, post-only, and fill-or-kill. Introducing these order types allows for more sophisticated strategies typically not possible on DEXs. A more comprehensive list of order types is found in the , while the detailed explanations are available in the

IDEX supports trading via a simple swap interface. The swap option can be used regardless of whether funds are already deposited into the platform (see ). If funds are already deposited, the swap will execute instantly. When swapping directly from a wallet, three steps (deposit, trade, and withdrawal) are executed sequentially.

IDEX API documentation.
smart contracts overview
orders
exchange smart contract guide