Skip to main content

Overview

Auto cancellation can be enabled for orders associated with a referral code. This mechanism improves user experience by automatically cancelling unfulfilled orders after a timeout period.
This feature is strictly available through an approval from deBridge. To enable this feature, deBridge must be contacted.

How it works

  • Timeout duration: 5 minutes for unprofitable orders, 15 minutes for other causes (e.g. compliance issues)
  • Condition: If an order is not fulfilled within this period, it is automatically cancelled, along with any external calls (hooks)
  • Benefit: Users do not need to manually cancel the order on the destination chain, greatly improving the UX
  • Cost: The cancellation fee is subsidized by deBridge
  • Market orders: Only market orders can be cancelled, not limit orders.

Returned funds and asset types

Upon cancellation, returned funds are generally not the same asset originally sent.
When orders are created, tokens are swapped for reserve assets to simplify solver book balancing.
Assets with sufficient on-chain liquidity remain tradable.
In most cases, USDC will be used. If the reserve asset on one chain is USDC, but on another it is ETH, wETH or USDC - USDC will be used on both the source and destination chains.
The refund asset and amount can be found in create-tx response payload by inspecting the srcChainTokenOut field. The entire input amount and all of the fees incurred by creating an order are returned to the user.
If the srcChainTokenOut is not present in the response payload, the refund asset is specified in srcChainTokenIn field.The reason for that is that pre-order-swap was not performed because the order input asset was a reserve asset.

Required integration parameters

When auto cancellation is enabled - dstChainOrderAuthorityAddress parameter will be overridden to a deBridge-controlled address to cancel orders on the destination chain. Cancellation costs will be subsidized by deBridge in this case.The srcAllowedCancelBeneficiary parameter must be set to the user’s wallet address. This address acts as the beneficiary of returned funds in the event of a cancellation. If not set correctly, funds may be lost. It is recommended for integrators to set the srcAllowedCancelBeneficiary parameter to a user-controlled address explicitly.

Fallbacks

The srcChainOrderAuthorityAddress parameter is deprecated. If srcChainOrderAuthorityAddress parameter is set in create-tx requests, the value of it will be used as srcAllowedCancelBeneficiary if srcAllowedCancelBeneficiary is not set explicitly.

Feature request steps

  • Integrator gives an explicit, unambiguous approval for the feature to be switched on
  • Integrator sets the create-tx request parameters correctly
  • Integrator confirms the parameter settings via an established communication channel
  • deBridge reviews several recent orders created by the integrator after the settings confirmation
  • deBridge switches the feature on and confirms it to the integrator