DEX API
Introduction

Introduction#

Welcome to OKX DEX’s developer documentation. OKX DEX is an all-in-one trading aggregator used for making multi-chain and cross-chain transactions. Through the intelligent X Routing order-splitting algorithm which automatically calculates the optimal transaction path and splits the transaction volume, users can take advantage of better prices, lower slippages, and lower network costs in multi-chain and cross-chain scenarios.

Prerequisites#

Before using the wallet API, you need to create a project and generate an API key in the developer portal. The detailed steps and related resources are as follows:

Create a project and generate an API key#

  1. Log in to the developer management platform.
  2. Create a new project.
  3. Generate an API key in project settings. We’ve prepared a detailed guide to help you complete these steps. You can read Create Project and Generate API Key to get started faster.

REST request verification#

When sending a REST request, you need to authenticate. We provide a detailed REST Request Authentication Guide to help you understand and implement this process.

Get started#

Swap API#

The DEX swap API is a powerful interface provided by OKX that allows users to access liquidity from multiple decentralized exchanges. Learn to use the DEX swap API here. The API works by intelligently routing trades through different DEXs to find the best possible trading route and price, providing users with a seamless and efficient trading experience. This means that users can get the best possible price for their trade without having to manually check and compare prices across multiple DEXs.

Cross-chain API#

OKX’s DEX cross-chain aggregator API allows users to receive liquidity information from multiple cross-chain bridges. Learn to use the DEX cross-chain API here. With our self-developed quoting service, the API makes general calculations of the liquidity of various cross-chain bridges and mainstream decentralized exchanges, and offers our users the best cross-chain prices.

Limit order API#

The DEX limit order API is an interface in which a user specifies a target price to buy or sell tokens on a decentralized exchange. Learn to use the DEX limit order API here. If the current market price can meet the user’s specified target price, the DEX aggregator will automatically execute the order. Through the DEX limit order API, users can create and look up limit orders and aggregate liquidity into the DEX aggregator, enjoying the best price on OKX DEX.

PMM RFQ#

A Request for Quote (RFQ) is a process in which a user requests a quote from a market maker for token purchases. Private Market Makers (PMM) can access the OKX DEX aggregator through RFQ orders to provide liquidity for transactions. If you are a PMM with capabilities, you can click here to know more details.

Table of contents