deBridge
  • Introduction
  • The deBridge Messaging Protocol
    • Protocol Overview
    • Fees and Supported Chains
    • 🟒Deployed Contracts
    • Development Guides
      • Building an EVM-based dApp
        • EVM smart contract interfaces
          • Interfaces
            • ICallProxy
            • IDeBridgeGate
            • IDeBridgeToken
            • IDeBridgeTokenDeployer
            • IOraclesManager
            • ISignatureVerifier
            • IWethGate
          • Libraries
            • Flags
          • Periphery
            • CallProxy
            • DeBridgeToken
            • DeBridgeTokenProxy
            • SimpleFeeProxy
          • Transfers
            • DeBridgeGate
            • DeBridgeTokenDeployer
            • OraclesManager
            • SignatureVerifier
            • WethGate
      • Sending cross-chain messages from Solana
        • On-Chain external call preparation for Solana
        • Off-chain external call preparation for Solana
      • Lifecycle of a cross-chain call
      • Gathering data for the claim
    • Development Tools
    • Security
    • Slashing and Delegated Staking
  • πŸ”DLN: The deBridge Liquidity Network Protocol
    • Introduction
    • Protocol Overview
    • deBridge Hooks
    • Fees and Supported Chains
    • 🟒Deployed Contracts
    • Market and Limit Orders
    • Interacting with smart contracts
      • Introduction
      • Placing orders
      • Filling orders
      • Withdrawing Affiliate Fees
    • Interacting with the API
      • Authentication
      • Creating an Order
        • Quick Start
        • Reserve Assets
        • Bridging Reserve Assets
        • Bridging non-reserve assets
        • API Parameters
          • Estimation-Only
          • prependOperatingExpenses
        • API Response
          • JSON Example
        • Refreshing Estimates
        • Fees and operating expenses
        • Order Fulfillment
          • Detecting the Order
          • Fulfilling the Order
            • Pre-Fill-Swap
          • Claiming the Order
      • Tracking Order Status
        • Order States
      • Integrating deBridge hooks
        • Creating Hook data for Solana
      • Submitting an Order Creation Transaction
      • Cancelling the Order
      • Affiliate fees
    • Interacting with the deBridge App
      • Custom Linking
    • deBridge Widget
    • Protocol specs
      • Deterministic order ID
      • Hook data
        • Anatomy of a Hook for the EVM-based chains
        • Anatomy of a Hook for Solana
  • πŸ’ΈdePort
    • Getting started
    • Transfers Flow
  • ⚑deBridge Points
    • Referrers Overview
    • Integrators Overview
  • 🌐deBridge IaaS
    • Getting started
  • 🌐Legal
    • SDK & API License Agreement
  • External Links
    • deBridge Use Cases
      • πŸ’‘Examples
    • Talks, Videos, and Articles
    • Website
    • Github
    • Twitter
    • Social channels
      • Discord
      • Facebook
      • LinkedIn
      • Medium
      • Telegram
      • YouTube
Powered by GitBook
On this page
  • Directional Parameters
  • Offer Parameters
  • Authorities and recipient address
  • Affiliate Fee parameters
  • Referral Code
  • Example Request

Was this helpful?

  1. DLN: The deBridge Liquidity Network Protocol
  2. Interacting with the API
  3. Creating an Order

API Parameters

PreviousBridging non-reserve assetsNextEstimation-Only

Last updated 1 day ago

Was this helpful?

Below is a succinct breakdown of the parameters used in the create-tx API endpoint. Detailed descriptions and usage examples are provided in dedicated subpages.

Directional Parameters

These parameters define the origin and destination of the transaction, including the assets being sold on the source chain and the assets being purchased on the destination chain.

Parameter
Example value
Description

srcChainId

56

srcChainTokenIn

0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d

Input asset address (what the user sells)

dstChainId

43114

dstChainTokenOut

0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7

Output asset address (what the user buys)

Offer Parameters

These parameters specify the amounts of tokens to be sold and received. The API can also be configured to automatically determine the output amount to ensure a reasonably profitable market order.

Parameter
Example value
Description

srcChainTokenInAmount

100000000000000000000

or

auto

The amount of input token the user is selling, with decimals. It can be set to auto as well, but make sure to set the amount of output token in that case.

dstChainTokenOutAmount

auto

or

100000000000000000000

prependOperatingExpense

true

Authorities and recipient address

These optional parameters define which entities are authorized to or modify the order, as well as the recipient of the funds upon fulfillment. Typically, user wallet addresses are used.

These parameters are optional, making it possible to use the create-tx endpoint even before a wallet address is availableβ€”e.g., before a user connects a wallet in a dApp. However, in such cases, the API will not return a transaction payload that can be signed and submitted to the blockchain.

Parameter
Example value
Description

srcChainOrderAuthorityAddress

0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

dstChainOrderAuthorityAddress

0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

Authorized to patch the order on the destination chain and cancel the order. Usually the user's address.

dstChainTokenOutRecipient

0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

Destination chain beneficiary address - receives the funds after the order is fulfilled. Usually the user's address.

Affiliate Fee parameters

Parameter
Example value
Description

affiliateFeePercent

0.1

Input asset amount percentage to cut off in favor of the affiliate fee recipient during order creation.

affiliateFeeRecipient

0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

Source chain address where the accrued affiliate fees will be transferred to when the order is fulfilled and unlocked.

Referral Code

Parameter
Example value
Description

referralCode

31805

Example Request

The following is a sample call to the create-tx endpoint, which generates a JSON-formatted response containing all required fields:

This request demonstrates how all core parameters are combined to generate a valid and executable cross-chain order.

The internal chainId of the .

The internal chainId of the .

The amount of output token the user is buying. It is recommended to let the API calculate the reasonable outcome by setting this parameter to auto, otherwise you are risking the created order being ignored by solvers and stuck until .

for better user experience. Moves the calculated amount of out of the spread and adds it on top the amount of input token.

Ensure that the address specified for dstChainOrderAuthorityAddress is accessible to the user. Otherwise, the order and its associated funds may become permanently inaccessible if the user cannot it.

Authorized to patch the order after it is created on source chain. Also receive the funds if the . Usually the user's address.

Affiliate fee-related settings can be included to specify a percentage of the trade value and the recipient address. More details are available .

An optional referral code can be included for tracking and rewards. More details are available .

Integrator's referral code. You can generate it .

πŸ”
cancel
cancel
here
here
https://dln.debridge.finance/v1.0/dln/order/create-tx?srcChainId=56&srcChainTokenIn=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&srcChainTokenInAmount=100000000000000000000&dstChainId=43114&dstChainTokenOut=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7&dstChainTokenOutAmount=auto&dstChainTokenOutRecipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&srcChainOrderAuthorityAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&dstChainOrderAuthorityAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&affiliateFeePercent=0.1&affiliateFeeRecipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
supported source chain
supported destination chain
cancelled
Recommended
operating expenses
order is cancelled
here