Market Maker Integration#
Overview#
OKX DEX’s RFQ system is built on-chain and designed for professional market makers to offer efficient, competitive pricing across supported chains. By leveraging off-chain quoting with on-chain settlement, we aim to deliver the best execution for traders in DeFi.
Market makers integrate with OKX DEX to continuously provide pricing data, which is then processed by our smart order router to help users achieve optimal trades.
Market Making on OKX DEX#
To operate as a market maker on OKX DEX, you must connect via our dedicated API suite and fulfill the following requirements:
- Able to stream live price levels once every 10 seconds
- Maintain a RFQ response time below 500 ms
- Return signature for the taker execution
Order Execution Modes#
OKX DEX only supports taker-executed orders. Users receive a firm and executable quote from the market maker. The taker signs and submits the transaction directly.
Taker-executed orders contain the following characteristics:
- The maker is not required to provide a gas fee estimation
- The quote and signature are submitted together
- The taker is responsible for the execution
Price Levels#
Makers are required to stream price levels to OKX DEX servers at least once every 10 seconds for each token pair. Any price level older than 10 seconds is considered a stale quote and will be ignored.
- Quotes must be non-cumulative and level-by-level
- Quotes must a cumulative value of over 200 USD. Otherwise, they will be ignored by the system
- OKX DEX will request price levels every second on each chain, so quotes must be updated frequently to ensure responsiveness and accuracy
Aggregation and Smart Routing#
OKX DEX aggregates liquidity across multiple makers, AMM pools and routes orders based on optimal price and fillability. Our router dynamically splits orders across sources to minimize cost and maximize execution quality.
- Unified order book across all makers
- Partial fills may be requested based on your streamed depth
Approvals#
OKX DEX enables asset transfers through user and market maker token allowances. We support two approval methods: approving via Permit2 or approving the OKX DEX settlement contract directly. Market makers must ensure they have granted sufficient approvals to the OKX DEX settlement contract or permit2 contract to cover the size of the levels they stream and the quotes they provide.
Signing#
OKX DEX on EVM supports 2 signature schemes:
- EIP-712
- EIP-1271
OKX DEX on Solana currently only supports Base58-encoded signatures.
Transaction expiry time#
We enforce a fixed transaction expiry timing: 60 seconds for EVM and 40 seconds for Solana. This simplifies integration by removing the need for market makers to specify custom expiry times in quote requests, providing consistent behavior across all quotes and transactions, and establishing clear timeout boundaries at different stages of the flow.
Performance Requirements#
- You must maintain a rate of 200 RPS in firm-order, and 50 RPS in pricing
- For the /pricing endpoint, market makers must update price quotes for each token pair within 10 seconds. We will ping your endpoint every second. If the 10-second window is exceeded, the quote for that token pair on the corresponding chain will be considered invalid.
- The firm-order response time is 200 ms, and the maximum response time is 500 ms. Any responses above this will be dropped and marked as a failed response.
- You must keep a successful response rate of over 90%, with at least 90% of orders successfully executed on-chain.
Settlement Contract Address#
const contractAddress = {
ETH: '0xf0bc45115dd1e609aef685f828f2ace209abd0c6'
ARB: '0x11939393f0cadfc06194ae983dafba2dcdf7308b'
Base: '0x52bb195bc89a660073d890ff9edc6726f97a981b'
Solana: 'RFQ1uATMXfRXemLnbYCF8JZhVfELp2K53jSEAGbsAKX'
};
Permit2 Contract Address#
const contractAddress = {
ETH: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
ARB: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
Base: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
};
RFQ API Schema#
To facilitate the integration into OKX DEX RFQ module, you will need to provide a endpoint for us to return the pricing and firm-order endpoints with the corresponding request and response format.
Endpoint | Method | URL | Description |
---|---|---|---|
Base URL | - | https://your-api-endpoint.com/OKXDEX/rfq | Example URL that we will register into our API. |
pricing | GET | https://your-api-endpoint.com/OKXDEX/rfq/pricing | The pricing endpoint get prices from market makers. Your levels will be used to determine if there is a path for a user order |
firm-order | POST | https://your-api-endpoint.com/OKXDEX/rfq/firm-order | Whenever a trader makes an quote request, the OKX DEX servers determine the best way to route that RFQ among the existing Market Makers. The winning Market Maker(s) receive messages and return the order and the signature. |
API Key#
We would require an API key to access your endpoints. Please provide it to us during the registration process. The API Key will be passed to the endpoint as a header X-API-KEY.