Dzap Aggregation API

Integrate our API directly into your DApp.

With our API, you can easily find the most optimal routes for conducting on-chain swaps. Our comprehensive solution empowers you to seamlessly swap multiple assets on multiple chains. Leveraging our strong partnerships with DEXs, and DEX aggregators, we ensure that you receive optimal quotes for your swapping operations.

Find the best qoute route to swap via DZap router

Endpoint: /swap/get-path

Description: Get Path - Find the best route to exchange tokens via the DZap router.

HTTP Method: PUT

Parameters:

  • body (Type: Object) - Get path parameters.

    Example Value:

    jsonCopy code{
      "chainId": 0,
      "requests": [
        {
          "amount": "string",
          "fromTokenAddress": "string",
          "toTokenAddress": "string",
          "slippage": 0
        }
      ]
    }

Request Content Type: application/json

Responses:

  • HTTP Status Code 200 - Successful operation

    Example Response:

    jsonCopy code[
      {
        "status": "string",
        "data": {
          "fromTokenAmount": "string",
          "toTokenAmount": "string",
          "estimatedGas": 0,
          "fromToken": {
            "symbol": "string",
            "address": "string",
            "decimals": 0
          },
          "toToken": {
            "symbol": "string",
            "address": "string",
            "decimals": 0
          }
        }
      }
    ]

This API allows you to find the best route for token exchange, providing details such as token amounts, estimated gas, and token information. The request is sent as JSON, and the response is also in JSON format.

Generate data for calling the DZap router for exchange.

Endpoint: /swap/get-params

Description: Generate data for calling the DZap router for exchange.

HTTP Method: POST

Parameters:

  • body (Type: Object) - Exchange parameters.

    Example Value:

    jsonCopy code{
      "chainId": 0,
      "swapParams": [
        {
          "amount": "string",
          "fromTokenAddress": "string",
          "toTokenAddress": "string",
          "slippage": 0
        }
      ]
    }

Request Content Type: application/json

Responses:

  • HTTP Status Code 200 - Successful operation

    Example Response:

    jsonCopy code{
      "ercSwapDetails": [
        {
          "executor": "string",
          "desc": {
            "srcToken": "string",
            "dstToken": "string",
            "srcReceiver": "string",
            "dstReceiver": "string",
            "amount": "string",
            "minReturnAmount": "string",
            "flags": 0,
            "permit": "string"
          },
          "routeData": "string",
          "permit": "string",
          "minReturnAmount": 0
        }
      ],
      "value": "string"
    }

This request initiates a token exchange with specified parameters like the amount, source token address, destination token address, and slippage. The response provides details about the exchange, including executor, token information, and route data.

Last updated