GET
/
v1.0
/
chain
/
estimation
cURL
curl --request GET \
  --url https://dln.debridge.finance/v1.0/chain/estimation
{
  "estimation": {
    "tokenIn": {
      "address": "<string>",
      "name": "<string>",
      "symbol": "<string>",
      "decimals": 123,
      "amount": "<string>",
      "approximateUsdValue": 123
    },
    "tokenOut": {
      "address": "<string>",
      "name": "<string>",
      "symbol": "<string>",
      "decimals": 123,
      "amount": "<string>",
      "minAmount": "<string>",
      "approximateUsdValue": 123
    },
    "slippage": 123,
    "recommendedSlippage": 123,
    "protocolFee": "<string>",
    "estimatedTransactionFee": {
      "total": "<string>",
      "details": {
        "giveOrderState": "<string>",
        "giveOrderWallet": "<string>",
        "nonceMaster": "<string>",
        "txFee": "<string>",
        "priorityFee": "<string>",
        "gasLimit": "<string>",
        "gasPrice": "<string>",
        "baseFee": "<string>",
        "maxFeePerGas": "<string>",
        "maxPriorityFeePerGas": "<string>"
      },
      "approximateUsdValue": 123
    },
    "costsDetails": [
      {
        "chain": "<string>",
        "tokenIn": "<string>",
        "tokenOut": "<string>",
        "amountIn": "<string>",
        "amountOut": "<string>",
        "type": "<string>",
        "payload": {
          "feeAmount": "<string>",
          "feeBps": "<string>",
          "amountOutBeforeCorrection": "<string>",
          "estimatedVolatilityBps": "<string>",
          "actualFeeAmount": "<string>",
          "actualFeeBps": "<string>",
          "subsidyAmount": "<string>",
          "feeApproximateUsdValue": "<string>"
        }
      }
    ],
    "comparedAggregators": [
      {
        "name": "<string>",
        "amount": "<string>",
        "approximateUsdValue": 123,
        "priceDrop": 123,
        "imageUrl": "<string>"
      }
    ]
  }
}

Query Parameters

chainId
enum<string>
required

An ID of a chain, a chain where the swap must be performed

Available options:
1,
10,
56,
137,
8453,
42161,
43114,
59144,
7565164,
100000001,
100000002,
100000008,
100000009,
100000013,
100000014,
100000017,
100000020,
100000021,
100000022,
100000023,
100000025,
100000026,
100000027,
100000028
tokenIn
string
required

An address of an input token to swap

tokenInAmount
string
required

An amount of input tokens to swap

slippage
string
default:auto

A slippage constraint (in %) is a safeguard during swaps (on both source and destination chains, if applicable). It is also used to calculate the minimum possible outcome during estimation. This property can be set to "auto" so that the API will suggest the best possible slippage.

tokenOut
string
required

An address of a target token.

affiliateFeePercent
number

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.

affiliateFeeRecipient
string

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

Response

estimation
object
required