It can be the case that the given order remains unfulfilled for a prolonged period of time. The reason for this may be that the order became unprofitable, and no one is willing to fulfill it. In this case, the order must be cancelled to unlock the input amount of funds. Limit orders have a high potential of remaining unfulfilled for prolonged periods of time, until the market conditions are met. One example of such an order is a 0.01 SOL for 20.000 POL limit order which was created for demonstration purposes of this article. The only way to cancel the order is to initiate the cancellation procedure on the chain it was intended to be fulfilled on (theDocumentation Index
Fetch the complete documentation index at: https://docs.debridge.com/llms.txt
Use this file to discover all available pages before exploring further.
dstChainId parameter
from create-tx call payload). During the cancellation process, the order enters a OrderCancelled
state, which prevents fulfillment. A cross-chain
message is sent through the deBridge cross-chain messaging infrastructure to the DLN contract on the source chain to unlock the given funds. The
funds locked on the source chain are returned in full including affiliate and protocol fees.
The cancellation procedure can only be initiated by the dstChainOrderAuthorityAddress in a separate transaction on the destination chain. Such
transaction can be requested by calling the /v1.0/dln/order/:id/cancel-tx endpoint:
- the transaction can be submitted only to the chain where the order has been intended to be fulfilled on, designated with
chainIdfield in the response - the transaction call would be accepted only if made by the
dstChainOrderAuthorityAddressspecified during the given order creation, designated withfromfield in the response - the funds locked on the source chain upon order creation are returned to the
srcChainOrderAuthorityAddressspecified during the given order creation, designated with thecancelBeneficiaryresponse field - the
valuefor the transaction is always positive, needed to cover:- the deBridge cross-chain messaging protocol fee (measured in the blockchain native currency where the message is being sent from) to make a cancellation message accepted. Consider looking at the list of supported chains and fees and details on retrieving the deBridge protocol fee;
- a small amount to cover the gas on the source chain, which gives an incentive to keepers for the successful claim of the cross-chain message on the source chain. In other words, this is a prepayment for potential gas expenses, that will be transferred by the protocol.