DEX API

FAQ#

Common reasons for cross-chain failures#

There are three categories of unsuccessful cross-chain swaps: unsuccessful source-chain swaps, unsuccessful destination-chain swaps, and unsuccessful cross-bridge transactions.

  1. The source-chain swaps and the destination-chain swaps may fail for the following reasons:
  • Broadcast failure
  • Insufficient gas
  • Exceeded slippage setting
  • Insufficient approved crypto amount
  • Third-party DEX contract execution error
  • The transaction was sped up or canceled
  • Tokens traded were safeMoon or honeypot tokens
  1. Cross-bridge transactions may fail for the following reasons:
  • Exceeded the third-party bridge’s slippage
  • Triggered the third-party bridge’s blocklist
  • The minimum/maximum cross-chain amount required by the bridge wasn’t met
  • Insufficient liquidity on the bridge
  • The cross-bridge transaction timed out

Transaction time is too long#

NO, The transaction of source-chain swaps usually takes less than one minute. The official bridges have long transaction times because of their own cross-chain mechanisms. If the other third-party bridge doesn’t return the final status for a long time, you can check the transaction status on the chain or contact third-party customer service for confirmation.

Are speed-ups and transaction cancellation supported?#

No, speed-ups and transaction cancellation aren’t supported.

Cross-chain refund#

There are two types of cross-chain refunds at the moment. The first is a refund initiated by a third-party bridge. The second is a refund initiated by OKX DEX.

  1. Refund initiated by a third-party bridge
  • The main reason for this type of refund is that the bridge refund rules have been triggered when the funds have entered the bridge, but the bridge transaction is unable to proceed normally.
  • Refunds are initiated generally because there is insufficient liquidity due to changes in the bridge’s pool, or the user’s cross-chain amount is below the minimum required by the bridge, or some other rules have been triggered, such as the third-party bridge’s blocklists.
  • The third-party bridge will initiate the refund. The refund token is generally USDT, USDC, DAI, WETH, and ETH. The refund is returned from the third-party bridge, and the final amount received by the user will have the gas fee deducted.
  • Common third-party bridges for cross-chain refunds include SWFT etc.
  1. Refunds initiated by OKX DEX
  • There are two main reasons for refunds. The first is that when OKX pre-executes a swap on the destination chain, if the pre-executed transaction returns an error, a refund will be automatically triggered. The second is an actual unsuccessful swap on the destination chain.
  • If pre-execution transactions return errors, it’s usually because the set slippage has been exceeded, or errors have occurred during third-party DEX contract executions, or the traded tokens are safeMoon tokens or honeypot tokens, etc.
  • Failed transactions on the destination chain will also trigger automatic refunds. Common reasons for such failures can be found in the above-mentioned cross-chain scenarios.
  • OKX DEX will initiate the refund. The refund token is USDT, USDC, DAI, WETH, or ETH. The refund is returned from OKX DEX, and the final amount received by the user will have the gas fee deducted.