In order to avoid cross-chain attacks and ensure the security of our users’ funds, OKX DEX requires all iFrame integrator domains to be allowlisted.
Please contact dex@okx.com if you would like to get your domain whitelisted. We will contact you in 1~3 work days.
Swap ETH for USDT on the Ethereum chain
<iframe
src="https://www.okx.com/web3/dex-swap#inputChain=1&inputCurrency=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&outputChain=1&outputCurrency=0xdac17f958d2ee523a2206206994597c13d831ec7"
/>
Swap ETH for USDT on the Ethereum chain with a fee setting. In this example, 1% of the ETH amount will be sent to referrerAddress and 99% of the ETH amount will be used to execute the swap.
<iframe
src="https://www.okx.com/web3/dex-swap?inputChain=1&inputCurrency=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&outputChain=1&outputCurrency=0xdac17f958d2ee523a2206206994597c13d831ec7&referrerAddress=0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9&feePercent=1"
/>
Swap USDT on the Ethereum chain for USDT on the Arbitrum chain.
<iframe
src="https://www.okx.com/web3/dex-swap#inputChain=1&inputCurrency=0xdac17f958d2ee523a2206206994597c13d831ec7&outputChain=42161&outputCurrency=0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"
/>
Place a limit order to swap WETH for USDC on the Ethereum chain.
<iframe
src="https://www.okx.com/web3/dex-swap/limit#inputLimitChain=1&inputLimitCurrency=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&outputLimitChain=1&outputLimitCurrency=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
/>
Parameter | Description |
---|---|
inputChain | The source chain ID that inputCurrency belongs to (e.g., 1 : Ethereum. See appendix for a full list of supported chains with the corresponding chain IDs.) |
inputCurrency | The contract address of a token to be sold. (e.g., 0xdac17f958d2ee523a2206206994597c13d831ec7 ) If the inputCurrency is a blockchain’s native token, check the appendix to get the contract address. |
outputChain | The destination chain ID that outputCurrency belongs to. (e.g., 1. See appendix for a full list of supported chains with the corresponding chain IDs.) |
outputCurrency | The contract address of a token to be bought. (e.g., 0xa892e1fef8b31acc44ce78e7db0a2dc610f92d00 ) If the outputCurrency is a blockchain’s native token, check the appendix to get the contract address. |
referrerAddress | The wallet address to which the fees will be sent. (e.g., 0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9 ) (optional) |
feePercent | The percentage of inputCurrency amount will be sent to the referrer’s address. The rest will be set as the input amount to be sold (optional). Min percentage: 0 Max percentage: 3 (Note: cross-chain swap and limit order can’t set referrerAddress and feePercent) |
inputLimitChain | The chain ID that inputLimitCurrency belongs to (e.g., 1 . Limit order can support transactions on Ethereum, BNB Chain, OKTC, Polygon, Avalanche C, Fantom, Arbitrum, Optimism chains. See appendix for a full list of chain IDs) |
inputLimitCurrency | The contract address of a token to be sold for the limit order (e.g., 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 ) Native token transactions aren’t supported |
outputLimitChain | The chain ID that outputLimitCurrency belongs to (e.g., 1 : Ethereum. Limit orders support transactions on Ethereum, BNB Chain, OKTC, Polygon, Avalanche C, Fantom, Arbitrum, and Optimism chains. See appendix for a full list of chain IDs) |
outputLimitCurrency | The contract address of a token to be bought for the limit order (e.g., 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 ) Native token transactions aren’t supported |
Chain | Chain ID | Native contract address |
---|---|---|
Ethereum | 1 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
zkSync Era | 324 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Optimism | 10 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Polygon | 137 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
OKTC | 66 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Avalanche C | 43114 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Fantom | 250 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Arbitrum | 42161 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Linea | 59144 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Conflux eSpace | 1030 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Base | 8453 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Mantle | 5000 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Scroll | 534352 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Polygon zkEVM | 1101 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Ethereum PoW | 10001 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Stacks | 5757 | STX |
Solana | 501 | 11111111111111111111111111111111 |
Cronos | 25 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Tron | 195 | T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb |
SUI | 784 | 0x2::sui::SUI |
Starknet | 9004 | 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 |
Aptos | 637 | 0x1::aptos_coin::AptosCoin |
Metis | 1088 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |