DZap Documentation
  • 🌐Overview
  • Features
    • Aggregation
      • Usecases
      • Fee Structure
      • Chains, Bridge and Liquidity
      • Different Transaction Status
      • Price Imapct Handling
      • Technical Details
    • DCA
      • Creating Positions
      • Additional Actions
      • Swap properties
      • Fees
      • Supported Tokens
    • Zapping (Coming soon)
      • Use Cases
      • Liquidity Migration
      • Supported Routes
  • Protocol
    • Contract address
    • Dzap Aggregation API
    • Uniswap Permit V2
    • Backend API
  • Terms & Security
    • Troubleshooting & Self Serve Guide
    • Terms
    • Audit Reports
    • Privacy
    • Security
  • Tutorial
    • Batch Swap via DEX Aggregator
    • Batch swap via Bridge Aggregator
    • Minting LST from Any Chain
  • Socials
    • 🌐Website
    • 🐦Twitter
    • 👾Discord
    • Ⓜ️Medium
  • DZap SDK
    • Dollar Cost Averaging (DCA)
      • Overview
      • Installation
      • Quick Start
      • Usage Guide
      • Methods
      • Data Types
Powered by GitBook
On this page
  • Find the best qoute route to swap via DZap router
  • Generate data for calling the DZap router for exchange.
  1. Protocol

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.

PreviousContract addressNextUniswap Permit V2

Last updated 10 months ago