v1

latestOpenAPI 3.1.02026-07-24223580832.9 KB
bridge

Aggregate Bridge Swap

Aggregates swap quotes from all bridges supporting a specified token pair. It allows users to customize their query to prioritize either the best output or the lowest gas costs. The response provides detailed transaction data including bridge identifiers, output amounts, swap routing parameters (such as call data), gas estimates, and a reference, enabling traders to compare and select the most efficient swap route for their needs.

💡 Compute Unit Value: 95 (Fixed)

post/defi/v1/bridge/swaps

Request body

srcChainIdstring

The unique chain ID to specify the source chain. Find more here.

dstChainIdstring required

The unique chain ID to specify the destination chain. Find more here.

srcChainSymbolstring

Symbol of the source chain.

srcTokenSymbolstring

Symbol of the token to swap.

dstTokenSymbolstring

Symbol of the token to be received after the swap.

amountInstring required

Amount of the token to be swapped.

srcTokenAddressstring

Address of the source token.

dstTokenAddressstring

Address of the destination token.

fromstring required

Address of the sender of the token.

gasstring

Maximum gas to be approved for the transaction.

tostring required

Address of the recipient of the token.

excludedBridgesstring

Comma-separated values of bridges to exclude.

bestNetPriceboolean

If true, sorts prepared transactions by net value (amountsOut minus gas) in descending order. If multiple sort parameters are true, bestNetPrice takes precedence.

bestQuoteboolean

If true, sorts prepared transactions by amountsOut in descending order. If multiple sort parameters are true, bestNetPrice takes precedence.

lowestGasboolean

If true, sorts prepared transactions by gas cost in ascending order. If multiple sort parameters are true, bestNetPrice takes precedence.

gasPrioritystring

Specifies the priority level for gas fees (e.g., 'low', 'medium', or 'high'), which influences the transaction speed and cost.

enableFeeboolean

Flag to include a basis points fee transaction alongside the main transaction when set to true.

batchOption'EIP-5792' | 'EIP-7702'

undefined

batcherContractstring

The EOA address of the batcher that will be used to execute the transaction when using EIP-7702 batching. If not provided, the default batcher contract for the chain will be used.

Example request

{
  "srcChainId": "1",
  "dstChainId": "1",
  "srcChainSymbol": "ETH",
  "srcTokenSymbol": "usdt",
  "dstTokenSymbol": "ETH",
  "amountIn": "10000",
  "srcTokenAddress": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "dstTokenAddress": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "gas": "100000",
  "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "excludedBridges": "200",
  "bestNetPrice": false,
  "bestQuote": false,
  "lowestGas": false,
  "gasPriority": "low",
  "enableFee": false,
  "batchOption": "EIP-5792",
  "batcherContract": "0x9c933f9d2efd76ce25b0d3dde84d3f94e78a50ca"
}

Response

Successful response

statusnumber

Numeric status code indicating success or failure of the API call

msgstring

Human-readable message describing the API result or error

Example response

{
  "status": 200,
  "msg": "success",
  "data": [
    {
      "bridgeId": "500",
      "bridgeName": "StargateV2",
      "chainId": "1",
      "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
      "to": "0xc026395860Db2d07ee33e05fE50ed7bD583189C7",
      "value": "9696507066771",
      "gas": "920000",
      "data": "0xc7c7f5b30000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000008d1a4dbf9930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000000000000000000000000000000000000000075e8000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e59940000000000000000000000000000000000000000000000000000000000989680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000",
      "amountsOut": "9999499",
      "estimationCheck": "Returned error: failed with 35894639 gas: insufficient funds for gas * price + value: address 0xa67E9B68c41b0f26184D64C26e0b2B81466E5994 have 0 want 9696507066771",
      "referenceId": "8a401db3386b4b389c655d4fe8b4589b"
    },
    {
      "bridgeId": "600",
      "bridgeName": "SquidRouterV2",
      "chainId": "1",
      "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
      "to": "0xdf4ffda22270c12d0b5b3788f1669d709476111e",
      "value": "0",
      "gas": "920000",
      "data": "0x0d77797c000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000ade3867e7e2dace6fa60f21db2cc89f8fb624452000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000681c9c160000000000000000000000000000000000000000000000000000000000989680000000000000000000000000000000000000000000000000000000000098778900000000000000000000000000000000000000000000000000000000000002bd000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000021050000000000000000000000000000000000000000000000000000000000000000",
      "amountsOut": "9992073",
      "estimationCheck": "Returned error: execution reverted: ERC20: transfer amount exceeds allowance",
      "referenceId": "8a401db3386b4b389c655d4fe8b4589b"
    },
    {
      "bridgeId": "400",
      "bridgeName": "AllbridgeCore",
      "chainId": "1",
      "gas": "920000",
      "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
      "to": "0xC51397b75B783E31469bFaADE79913F3f82210d6",
      "value": "107462908551964",
      "data": "0x7dfb08f10000000000000000000000000000000000000000000000000000000000989680000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000000",
      "amountsOut": "9990000",
      "estimationCheck": "Returned error: failed with 35894639 gas: insufficient funds for gas * price + value: address 0xa67E9B68c41b0f26184D64C26e0b2B81466E5994 have 0 want 107462908551964",
      "referenceId": "8a401db3386b4b389c655d4fe8b4589b"
    }
  ]
}