Introduction to Limit Order API
The Limit Order API enables developers to create, manage, and execute decentralized exchange (DEX) limit orders programmatically. This guide covers key endpoints, use cases, and integration steps.
Key Features
- Chain Agnostic: Supports multiple blockchains.
- Non-Custodial: Users retain control of funds.
- Gas Optimization: Efficient transaction bundling.
Core Functionalities
1. Get Supported Chains
Purpose: Retrieve list of supported blockchain networks and their IDs.
Use Case: Verify compatibility before order creation.
👉 [Explore supported networks](https://www.okx.com/join/BLOCKSTAR)2. Token Management
- Get Allowance: Check approved token spending limits.
- Approve Transactions: Generate contract call data for token approvals.
3. Order Operations
| Endpoint | Description |
|---|---|
Create Limit Order | Submit new limit order |
Query Limit Order | Fetch order details by ID |
Cancel Order Calldata | Generate cancellation transaction data |
Integration Workflow
- Chain Selection
Use/chainsendpoint to confirm network support. - Token Approval
Approve tokens viaapprove-transactionif required. - Order Placement
Submit orders with price/amount parameters.
👉 [View full API parameters](https://www.okx.com/join/BLOCKSTAR)FAQ
Q1: What’s the maximum order expiration time?
A: Orders expire after 30 days by default.
Q2: How are fees calculated?
A: Fees vary by chain and are displayed during order preview.
Q3: Can I modify existing orders?
A: No—orders must be canceled and recreated.
Best Practices
- Monitor gas prices for cost-efficient cancellations.
- Use order batching to reduce network calls.
- Implement error handling for slippage tolerance.
For additional queries, refer to the Smart Contract Documentation.