v1

latestOpenAPI 3.0.02026-07-223691143.2 KB
DLN

This endpoint returns the data for a transaction to place a cross-chain DLN order.

This endpoint returns the data for a transaction to place a cross-chain DLN order.

get/v1.0/dln/order/create-tx

Query parameters

srcChainId'1' | '10' | '56' | '137' | '8453' | '42161' | '43114' | '59144' | '7565164' | '100000001' | '100000002' | '100000008' | '100000009' | '100000013' | '100000014' | '100000017' | '100000019' | '100000020' | '100000021' | '100000022' | '100000023' | '100000025' | '100000026' | '100000027' | '100000028' | '100000029' | '100000030' | '100000031' required

An ID of a source chain, a chain where the cross-chain swap will start

srcChainTokenInstring required

An address (on a source chain) of an input token to swap

srcChainTokenInAmountstring required

An amount of input tokens to swap

dstChainId'1' | '10' | '56' | '137' | '8453' | '42161' | '43114' | '59144' | '7565164' | '100000001' | '100000002' | '100000008' | '100000009' | '100000013' | '100000014' | '100000017' | '100000019' | '100000020' | '100000021' | '100000022' | '100000023' | '100000025' | '100000026' | '100000027' | '100000028' | '100000029' | '100000030' | '100000031' required

An ID of a destination chain, a chain where the cross-chain swap will finish. Must differ from srcChainId!

dstChainTokenOutstring required

An address (on a destination chain) of a target token.

dstChainTokenOutAmountstring

Amount of the target asset the market maker expects to receive upon order fulfillment. This property can be set to "auto" so that the API will suggest the best possible outcome of the order based on current market conditions and the protocol fees, keeping the order in a reasonable-to-fullfill state

additionalTakerRewardBpsinteger

additionalTakerRewardBps is additionally laid in on top of default taker margin.

srcIntermediaryTokenAddressstring

An address (on a source chain) of an intermediary token a user's input funds should be swapped to prior order creation. This token must be publicly traded and listed on major DEX aggregators. Examples: USDC on Ethereum, DAI on Ethereum, USDC on Solana. This property can be either a Circle-issued USDC token or ETH, or an arbitrary token; setting an arbitrary token also requires you to specify dstIntermediaryTokenAddress, intermediaryTokenUSDPrice and dstIntermediaryTokenSpenderAddress properties as well.

dstIntermediaryTokenAddressstring

An address (on a destination chain) of an intermediary token whose value assumed to be equal to the value of srcIntermediaryTokenAddress . This token must be publicly traded and listed on major DEX aggregators. Examples: USDC on Ethereum, DAI on Ethereum, USDC on Solana. Setting this property also requires you to specify srcIntermediaryTokenAddress, intermediaryTokenUSDPrice and dstIntermediaryTokenSpenderAddress properties as well.

dstIntermediaryTokenSpenderAddressstring

Applicable to a EVM-compatible destination chain. An address (on a EVM-compatible destination chain) assumed as a spender of the intermediary token (set as dstIntermediaryTokenAddress) during order fulfillment. This address must hold a reasonable amount (of at least $100 in value for testing purposes, or at least 10% of the average order value) of the given intermediary token, and issue on-chain approvals to spent the given intermediary token by the two trusted DLN contracts (DlnDestination: {CURRENT_ENV[dstChain].pmmDst} and CrosschainForwarder: {CURRENT_ENV[dstChain].evm.forwarderContract}). This property is required when srcIntermediaryTokenAddress and dstIntermediaryTokenAddress are set.

intermediaryTokenUSDPricenumber

A value (a spot price) of the given intermediary token expressed in US dollars. Keep in mind this price is not used to calculate the spread of an order, but only as a reference price for operating expenses incurred by a taker during and after order fulfillment. The order spread is still calculated using the market price quoted from a major DEX.

dstChainTokenOutRecipientstring

Address (on the destination chain) where target tokens should be transferred to after the swap. Required for transaction construction, otherwise only the quote is returned!

senderAddressstring

Address (on the source chain) who submits input tokens for a cross-chain swap

srcChainOrderAuthorityAddressstring

Address (on the source chain) who submits input tokens for a cross-chain swap. Required for transaction construction, otherwise only the quote is returned!

srcAllowedCancelBeneficiarystring

Fixed recipient of the funds of an order in case it is being cancelled. If not set, the recipient could be set later upon order cancellation.

referralCodenumber

Make sure you pass your referral code which can be generated here: https://app.debridge.finance/refer With your referral code, your address will earn an additional 25% of deBridge points (https://debridge.finance/blog/introducing-debridge-points/), on top of the points generated by users who engage in activity on deBridge through your referral.

affiliateFeePercentnumber

The share of the input amount to be distributed to the affiliateFeeRecipient (if given) address as an affiliate fee.

If you are building on top of deSwap, you might want to take a small fee relative to the amount of a token a user provides for a swap. To achieve this, set this parameter to a desired % (e.g. 0.1 stands for 0.1%; the max value is 10 which stands for 10% of srcAmountInParam) and specify your wallet address in the affiliateFeeRecipient parameter.

For example, setting this parameter to 0.1 means that when the user gives 5000 USDT then you will receive 5 USDT immediately after transaction is being confirmed.

affiliateFeeRecipientstring

An address (on an origin chain) that will receive affiliate fees according to the affiliateFeePercent parameter.

srcChainTokenInSenderPermitstring

Typically, a sender is required to approve token transfer to deBridge forwarder for further transfer and swap. For gas-less cases, a sender-signed permit message may be provided to be executed by deBridge forwarder before actual transfer.

dstChainOrderAuthorityAddressstring

Address on the destination chain whom should be granted the privileges to manage the order (patch, cancel, etc). Required for transaction construction, otherwise only the quote is returned!

enableEstimateboolean

This flag forces deSwap API to validate the resulting transaction and estimate its gas consumption. You will find the estimation at tx.gasLimit field of the resulting object.

Important: to estimate a transaction, you are required to fill the senderAddress property with the address that will be used to execute this transaction. It should have enough assets on its balance to cover the amount specified in the srcChainTokenInAmount property, and enough ether to cover the protocol global fixed fee.

Caution: if the input token (srcChainTokenIn) is not a native blockchain currency but an ERC-20 token, it is necessary to provide an approve to spend this token by the tx.allowanceTarget contract prior to such estimation. This can be done either by executing increaseAllowance() on-chain or by providing the permit envelope via the srcChainTokenInSenderPermit property. Failing to provide a correct approve to spend will result an error during transaction.

allowedTakerstring

An address (on a destination chain) of a allowed taker.

externalCallstring

A stringified versioned JSON with data fields that form an encoded transaction call to be attached to a DLN order and would be executed upon order fulfillment on the destination chain. The following schemas are currently supported:

  • for Solana as a destination chain: { "version": "solana_1", "fields": { "calldata": "0x..." } }

  • for EVM-compatible chains (gas optional): { "version": "evm_1", "fields": { "to": "0x...", "data": "0x...", "gas": 0 } }

dlnHookstring

JSON representing a DLN Hook to be attached to an order. Depending on the destination chain, the following templates are available:

  • for Solana as a destination chain: { "type": "solana_serialized_instructions", "data": { "instructions": "0x..." } }

  • for EVM-based destination chains to make an arbitrary transaction call via the universal DLN hook: { "type": "evm_transaction_call", "data": { "to": "0x...", " calldata": "0x...", "gas": 0 } }

  • for EVM-based destination chains to attach an arbitrary hook: { "type": "evm_hook_data_v1", "data": { "fallbackAddress": "0x...", "target": "0x...", "reward": "0", "isNonAtomic": false, "isSuccessRequired": false, "targetPayload": "0x" } }

prependOperatingExpensesboolean

Tells API server to prepend operating expenses to the input amount

metadatastring
otcboolean

Forces a P2P order where input and output tokens are left intact(renamed to ptp)

ptpboolean

Forces a P2P order where input and output tokens are left intact

skipSolanaRecipientValidationboolean

Skip system address validation dstChainTokenOutRecipient in Solana

srcChainPriorityLevel'normal' | 'aggressive'

Configures the priority level for transaction fee estimation.

Response

The request has succeeded

OR
All 36 operations