ZaaS HTTP API

HTTP API doc for ZaaS API

OpenAPI YAML

Please refer to the following server configuration and openapi file for the http API.

Common Parameters

Configuration
Value

Base URL

  • https://zap-api.kyberswap.com/{chain} where chain is one of the supported chain. For example: https://zap-api.kyberswap.com/arbitrum

Header X-Client-Id

Some value to identify your client.

Please contact [email protected] to whitelist your client id with more rate limit quota

Please refer to Zap's DEX IDs and Zap's Supported Chains/Dexes for list of supported DEXes for each chain and their corresponding IDs

API list

Zap in

Get Route

Get the best zap-in route.

get
Query parameters
dexstring · enumRequiredExample: DEX_UNISWAPV3Possible values:
pool.idstringRequired

id of the pool to zap into.

Example: 0x2f5e87c9312fa29aed5c179e456625d79015299c
position.idstringOptional

id of the position to add liquidity to; omit to create a new uniswapV3 position. for uniswapV2 this is user address

position.tickLowerinteger · int32Optional

min tick of the position, required if creating a new uniswapV3 position.

Example: 120000
position.tickUpperinteger · int32Optional

max tick of the position, required if creating a new uniswapV3 position.

Example: 480000
tokensInstring[]Required

which token(s) to use as zap source. also accepts comma separated addresses

amountsInstring[]Required

amount(s) to zap including fee, corresponding to tokenIn. also accepts comma separated amounts.

tokenInstring[]Optional

which token(s) to use as zap source. also accepts comma separated addresses. deprecated: use tokens_in. if both fields are specified, they are combined

Example: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
amountInstring[]Optional

amount(s) to zap including fee, corresponding to tokenIn. also accepts comma separated amounts. deprecated: use amounts_in. if both fields are specified, they are combined

Example: 1000000000000000000
aggregatorOptions.disablebooleanOptional

whether to disable swapping with the aggregator

aggregatorOptions.includedSourcesstringOptional

comma-separated list of sources to use for aggregator

aggregatorOptions.excludedSourcesstringOptional

comma-separated list of sources to exclude for aggregator

aggregatorOptions.excludedPoolsstringOptional

comma-separated list of pools to exclude for aggregator

feeAddressstringOptional

the address of the fee recipient.

feePcminteger · int64Optional

fee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty. From 0 to 100,000 inclusively. Example: 1 for 0.001%.

slippageinteger · int64Optional

maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will revert) and pool swap during zap (for additional zapping and for refund). From 0 to 10,000 inclusively. Example: 1 for 0.01%.

Example: 100
Header parameters
X-Client-IdstringOptional

Client Id

Example: zap-docs
X-Request-IdstringOptional

Request Id

Responses
200
A successful response.
application/json
get
GET /arbitrum/api/v1/in/route HTTP/1.1
Host: zap-api.kyberswap.com
Accept: */*
{
  "message": "OK",
  "data": {
    "poolDetails": {
      "category": "common_pair",
      "uniswapV3": {
        "tick": 259661,
        "newTick": 259661,
        "sqrtP": "34441043722219267846042009462652656",
        "newSqrtP": "34441043737601305531684264539945030"
      }
    },
    "positionDetails": {
      "addedLiquidity": "1149974764979",
      "addedAmountUsd": "3670.40949860"
    },
    "zapDetails": {
      "initialAmountUsd": "3673.00201650",
      "actions": [
        {
          "type": "ACTION_TYPE_PROTOCOL_FEE",
          "protocolFee": {
            "pcm": 50,
            "tokens": [
              {
                "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
                "amount": "500000000000000",
                "amountUsd": "1.83650101"
              }
            ]
          }
        },
        {
          "type": "ACTION_TYPE_AGGREGATOR_SWAP",
          "aggregatorSwap": {
            "swaps": [
              {
                "tokenIn": {
                  "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
                  "amount": "499958741353837836",
                  "amountUsd": "1836.34946516"
                },
                "tokenOut": {
                  "address": "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
                  "amount": "2644815",
                  "amountUsd": "1835.59443695"
                }
              }
            ]
          }
        },
        {
          "type": "ACTION_TYPE_POOL_SWAP",
          "poolSwap": {
            "swaps": [
              {
                "tokenIn": {
                  "address": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
                  "amount": "102872182233841",
                  "amountUsd": "0.37784973"
                },
                "tokenOut": {
                  "address": "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
                  "amount": "544",
                  "amountUsd": "0.37755509"
                }
              }
            ]
          }
        },
        {
          "type": "ACTION_TYPE_ADD_LIQUIDITY",
          "addLiquidity": {
            "token0": {
              "address": "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
              "amount": "2645358",
              "amountUsd": "1835.97129800"
            },
            "token1": {
              "address": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
              "amount": "499438386463928322",
              "amountUsd": "1834.43820060"
            }
          }
        }
      ],
      "finalAmountUsd": "3670.40949860",
      "priceImpact": 0.070583075
    },
    "route": "KLUv/WAdB00bAOY5nCNAj3JMrqhs1F7Rx8ZtyeIRkgGqIXfgSOampMyhZleOYZgzAYgAigChAM2d3Nn7iLnY66vzVWYuXVS7q9ecpZ+zuUgxlxgVb4CvKk5c764QuTno0imHOZAmq01WqNmBDoff4WhbyNyxdn8hlq4uHYQOP1BjCDWHV0uHsQX9crda1svR5WSJl+75T1b4y8HZzdt+qYcdjX0yKJX+s7wxlBi85iCX0RzlUjbnuKRa5Tb3XEbqyqp2Of//RpLLhIJJCiRtYlJRk0uHGLyGI0Dr/+ek+tNxrUdW3G9EDMDECqAxIvZvK0xEXR2gEM1dLrFL1zB4KVM9X3vb1XX/1/nXb69d/6uUL4VyQUzVXKVZTCIREw9Ecimj1lUzXeXyRNWcxaVVVsuo//zJzUVQkfdfeTvXWykzqsJeinEpk7nPJOIMUC4aIpOJRPSQtIN0WgHQJtgjYZSHhEk8709hFpZLksolagwRhAISwdd1/NluW+wXS/XMIaXQYo5lmQ/kbGQyoVwGBERzLbpMKpcyJ9Aa1BoBq0SYdulScxc+sie3wgC0sIeFPXjZI7oocGLv6/pSVr7bGV0UmiXCoOZaxGERCKsQaA+kshC1iQpDSMe+u1hx768GtLq65hwWh1ZfARm1VPGq5h6XMo1GJtPIVuqpmz/Vql6ZjPnoqlZTPS3icqW+WN2bIVLDPT0pXPxk76WsnZSHSw1MvnA961prlx+iOTS4hwRyEak0h+RySWGaQ1LQUAGJWIKloEEfEoBJRLmoPJBKBNAqKpdHU9FVcXnbs/+3ZT/sdW0/ns63cyvmUGYqZ6OyQrg6PTUymeZQXBImAmEgQAJCDDOmHZLEGJj0Yxm1rG2f2YZ071vZSmuTEYMc7ksXKTyQndCnyoI34X93YwbNI3xyLUJ6AY9LrS6IJcMwm/eSsBsVqAI2PFuTKUizGWTHhcFXrKvsl7iawsClp6xyNDBUSxoFdUsqRanhffuMrI+Aa2sqmbkA6Xgu21EIhh/cypg4W7hogNnGFhyT24o1cAeaZ5ILOW7cAQIfQCmJ49N52JNgQ7O7L1gWAkKhheQ60Elw0AKCCulGAVUHGJgaPIElWIKKTLpC06UHnCVX7TvCAMNuc2ogLKuyTnCUAPqFS2x0VeyCy+qwbowuW746oVmIAg==",
    "routerAddress": "0x6960f99e6F9A9A5EFcd44C5BaA3245aC2b145287",
    "gas": "1451371",
    "gasUsd": "0.05330889"
  },
  "requestId": "45fa8a6175f45233678b10fc2a72c4b9"
}
curl -X GET "https://zap-api.kyberswap.com/polygon/api/v1/in/route?dex=DEX_UNISWAPV3&pool.id=0xb46388f104ff88aac68626a316aaf3a924f32055&position.tickLower=-24800&position.tickUpper=32400&tokensIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&amountsIn=1000000000000000000&slippage=100" \
 -H "accept: application/json"\
 -H "x-client-id: zap-docs"

Build Route

Build encoded data for the specified zap-in route.

post
Header parameters
X-Client-IdstringOptional

Client Id

Example: zap-docs
X-Request-IdstringOptional

Request Id

Body

Build encoded data for zap-in transaction from the specified route.

senderstringOptional

the wallet sending the transaction, and thus, the tokens.

recipientstringOptional

the wallet receiving the new position. default to sender if empty.

routestring · byteOptional

the route as returned from get-route endpoint.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
deadlineinteger · int64Optional

deadline for the swap transaction to execute.

sourcestringOptional

the source of the zap-in transaction.

Responses
200
A successful response.
application/json
post
POST /arbitrum/api/v1/in/route/build HTTP/1.1
Host: zap-api.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 1345

{
  "sender": "0xa2DFeb674d997b68ec5adB0A6fb9136BD45C2D2d",
  "recipient": "0xa2DFeb674d997b68ec5adB0A6fb9136BD45C2D2d",
  "route": "KLUv/WAdB00bAOY5nCNAj3JMrqhs1F7Rx8ZtyeIRkgGqIXfgSOampMyhZleOYZgzAYgAigChAM2d3Nn7iLnY66vzVWYuXVS7q9ecpZ+zuUgxlxgVb4CvKk5c764QuTno0imHOZAmq01WqNmBDoff4WhbyNyxdn8hlq4uHYQOP1BjCDWHV0uHsQX9crda1svR5WSJl+75T1b4y8HZzdt+qYcdjX0yKJX+s7wxlBi85iCX0RzlUjbnuKRa5Tb3XEbqyqp2Of//RpLLhIJJCiRtYlJRk0uHGLyGI0Dr/+ek+tNxrUdW3G9EDMDECqAxIvZvK0xEXR2gEM1dLrFL1zB4KVM9X3vb1XX/1/nXb69d/6uUL4VyQUzVXKVZTCIREw9Ecimj1lUzXeXyRNWcxaVVVsuo//zJzUVQkfdfeTvXWykzqsJeinEpk7nPJOIMUC4aIpOJRPSQtIN0WgHQJtgjYZSHhEk8709hFpZLksolagwRhAISwdd1/NluW+wXS/XMIaXQYo5lmQ/kbGQyoVwGBERzLbpMKpcyJ9Aa1BoBq0SYdulScxc+sie3wgC0sIeFPXjZI7oocGLv6/pSVr7bGV0UmiXCoOZaxGERCKsQaA+kshC1iQpDSMe+u1hx768GtLq65hwWh1ZfARm1VPGq5h6XMo1GJtPIVuqpmz/Vql6ZjPnoqlZTPS3icqW+WN2bIVLDPT0pXPxk76WsnZSHSw1MvnA961prlx+iOTS4hwRyEak0h+RySWGaQ1LQUAGJWIKloEEfEoBJRLmoPJBKBNAqKpdHU9FVcXnbs/+3ZT/sdW0/ns63cyvmUGYqZ6OyQrg6PTUymeZQXBImAmEgQAJCDDOmHZLEGJj0Yxm1rG2f2YZ071vZSmuTEYMc7ksXKTyQndCnyoI34X93YwbNI3xyLUJ6AY9LrS6IJcMwm/eSsBsVqAI2PFuTKUizGWTHhcFXrKvsl7iawsClp6xyNDBUSxoFdUsqRanhffuMrI+Aa2sqmbkA6Xgu21EIhh/cypg4W7hogNnGFhyT24o1cAeaZ5ILOW7cAQIfQCmJ49N52JNgQ7O7L1gWAkKhheQ60Elw0AKCCulGAVUHGJgaPIElWIKKTLpC06UHnCVX7TvCAMNuc2ogLKuyTnCUAPqFS2x0VeyCy+qwbowuW746oVmIAg==",
  "deadline": 1800000000,
  "source": "zap-docs"
}
{
  "code": 0,
  "message": "OK",
  "data": {
    "routerAddress": "0x6960f99e6F9A9A5EFcd44C5BaA3245aC2b145287",
    "callData": "0x0779b145000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000600000000000000000000000002f5e87c9312fa29aed5c179e456625d79015299c000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000a2dfeb674d997b68ec5adb0a6fb9136bd45c2d2d000000000000000000000000000000000000000000000000000000000001d4c000000000000000000000000000000000000000000000000000000000000753000000000000000000000000000000000000000000000000000000010912662471000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022ad1a118075557c20d42f2de3feedb8d16a8ee6000000000000000000000000bde6709804b89497f378c7123d5362f8a24cb7f6000000000000000000000000000000000000000000000000000000006b49d20000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000ca00000000000000000000000000000000000000000000000000000000000000be00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000088000000000000000000000000000000000000000000000000000000000000000800000000000000000000000008aec70a335b4cb0c3c0866065d9c04c26cd749fa0000000000000000000000000000000000000000000000000001c6bf5263400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006131b5fae19ea4f9d964eac0408e4408b66337b500000000000000000000000000000000000000000000000006f035d38cbf350c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000644e21fd0e9000000000000000000000000000000000000000000000000000000000000002000000000000000000000000011ddd59c33c73c44733b4123a86ea5ce57f6e854000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000f1020100000029020000004bfc22a4da7f31f8a912a79a7e44a822398b4390000000000000000000b19efb8e131ef6010a010000002b0100000082670f35306253222f8a165869b28c64739ac62e010000000000000000063e96d7feac161600010982af49447d8a07e3bd95bd0d56f35241523fbab12f2a2543b76a4166549f7aab2e75bef0aefc5b0fbde6709804b89497f378c7123d5362f8a24cb7f60000000000000000000000006b49d2000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000285b4f00000000000000000000000000000000000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000bde6709804b89497f378c7123d5362f8a24cb7f600000000000000000000000000000000000000000000000006f035d38cbf350c000000000000000000000000000000000000000000000000000000000027f3fe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000100000000000000000000000011ddd59c33c73c44733b4123a86ea5ce57f6e854000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f035d38cbf350c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f97b22536f75726365223a227a61702d646f6373222c22416d6f756e74496e555344223a22313833352e38373838323235313139313031222c22416d6f756e744f7574555344223a22313833352e35303836363830393034393637222c22526566657272616c223a22222c22466c616773223a302c22496e74656772697479496e666f223a7b224b65794944223a2231222c225369676e6174757265223a224943644253394c714132676248584f6c557a3349626d75637a4679657755392f49796f70636d6875476a466e596b42377044773547585347592b2f5a4f4c664c4158795958346c4c797937384f525462307667714a695632677243706c36304a52796e4338443078724d73786e44446f764f646d592b6a6e71456d615670374b664b4b45526348744f30784f4f7472776f38537a73757a4c3672384a6b716f416558335a744f6b705a4a7a4e65694843612f4971384d6938345a792b597044726e7769766b714a524a535464665950787745704b62757a6c484a6165717a445276554f4f4d5556727344643276426b45377771536b6a6e69437a784665365076374c65366c49474c784c36314b4156484e4a3343667675702f54464c386f4c6a36417a547535415a3958533034377a56574266484a4a4379326d536e7236475778536e6635536157724c734f78776b7a344a665752513d3d227d7d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe880000000000000000000000002f5e87c9312fa29aed5c179e456625d79015299c0000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a2dfeb674d997b68ec5adb0a6fb9136bd45c2d2d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000900000000000000000000000000000000100000000000000000000000000000001000000000000000000000000000000000000000000000000000000000001d4c000000000000000000000000000000000000000000000000000000000000753000000000000000000000000000000000000069118042346bcd79b11b76147d0ab000000000000000000000000000000000006b33a11557d53e337f572e1d50a4b0000000000000000000000000000000000000000000000000000010912662471000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000005d8fcbe11af100000000000000000000000000285a4600000000000000000000000000285c57000000000000000006ee8cb1ee542c44000000000000000006eee790cbf67b7c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006a213163b1c66b70364a5f1403ef0000000000000000000000000000000000000000000000000000000000003f64d000000000000000000000000000000000000000000000000075982b768bcece70000000000000000000000000000000000000000000000000000000000000000",
    "value": "1000000000000000000"
  },
  "requestId": "b8c105304e178953e36021af9b26f3da"
}
curl -X POST "https://zap-api.kyberswap.com/polygon/api/v1/in/route/build" \
 -H "accept: application/json"\
 -H "content-type: application/json"\
 -H "x-client-id: zap-docs" \
 -d '{"sender":"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270","recipient":"0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D","route":"KLUv/WALBWUVAKavgSFAb9qflX03+n9Wj9hEtiy3sD717uBIcklIUtb9UBVFASZwAG8AewCseGGDZz+f91M98txGAZqZqQsXPJhqdXGMHUIosW9O3X9D9ykvz587bZntFA+ybObckq051tD33d6immunvvu1fJ584ZaJB7tzeUH7jBfGkjJLmzw1GHNfFpS6uHNC7SJxoQMzFkbw7EKHR7EubGBGFDwMD76LRM+krFq9qkyNUC9kEi1HIhRHC7BQ8iwgDMREw9E88FRyoQUe3d1X1WmZdd13nzPVJkbpFzKe9ImUFau7UkkdoU7rrkob/cLF8yr1lzvRdntKumohg+d/c1MyvypzJ3ZnVvmqUP/CCZ4MFRR4b3mPgEmai5fykypW/M+uUGc6UqjV+vaERXQuLpywCFTMSWW+a2rki1JyJv301E6EuKEkvAnDloWPaYxxsAqB13BIFJo3IWEHB3k7n1FCrqvSKw5wk4ZUrp6p7OnTanbzoEAo2KPg8SYgEsWHb+4OUMcV4GmAOiwMlcrDQ6WC3tilpdQOpUrWinl/I8SaO19ljaGwCjy58OK5R0HTdAWK0Cu13SgoCBMNCNMGIhgMvlCiiXg8g4PuNRIRjmcBsBUAktd4MIa1iAeTaFy8CLOY4HlIKM1baBwUDqZ/XfvWqSrba5ma77q5X5V6i/o178ZAIBHMcHBY+BoKRIInQCBAAkOIkfEBRAi1htoyA+Fh2bFWvRh8hvz97PowAKx1qdsQ5xjp2pgs22UIOyQAShdlhjfwZzCdB+z1ohnGvFnSTTKxnORd4epZFuIeA+w2wAw7LgAorNLwQsqNf+xgg82V4vgsD37S9QzcQQb7FtadgPK3lKx7U4HBskxWQGuCP0HydKwMJ+YSsBBVIoM2YptDA0F2jZS8pJQuID3loJeJAg==","deadline":1800000000,"source":"zap-docs"}' 

Zap Migrate

Get Route

Get the best zap-migrate route.

get
Query parameters
dexFromstring · enumRequiredExample: DEX_UNISWAPV3Possible values:
dexTostring · enumRequiredExample: DEX_UNISWAPV3Possible values:
poolFrom.idstringRequired

id of the pool to zap into.

poolTo.idstringRequired

id of the pool to zap into.

positionFrom.idstringRequired

id of the position to withdraw from

positionTo.idstringOptional

id of the position to add liquidity to; omit to create a new uniswapV3 position. for uniswapV2 this is user address

positionTo.tickLowerinteger · int32Optional

min tick of the position, required if creating a new uniswapV3 position.

positionTo.tickUpperinteger · int32Optional

max tick of the position, required if creating a new uniswapV3 position.

liquidityOutstringOptional

liquidity amount to withdraw, or empty or 0 to withdraw all

aggregatorOptions.disablebooleanOptional

whether to disable swapping with the aggregator

aggregatorOptions.includedSourcesstringOptional

comma-separated list of sources to use for aggregator

aggregatorOptions.excludedSourcesstringOptional

comma-separated list of sources to exclude for aggregator

aggregatorOptions.excludedPoolsstringOptional

comma-separated list of pools to exclude for aggregator

feeAddressstringOptional

options for getting aggregator routes the address of the fee recipient.

feePcminteger · int64Optional

fee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty. From 0 to 100,000 inclusively. Example: 1 for 0.001%.

slippageinteger · int64Optional

maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will revert) and pool swap during zap (for additional zapping and for refund). From 0 to 10,000 inclusively. Example: 1 for 0.01%.

Example: 100
Header parameters
X-Client-IdstringOptional

Client Id

Example: zap-docs
X-Request-IdstringOptional

Request Id

Responses
200
OK
application/json
get
GET /arbitrum/api/v1/migrate/route HTTP/1.1
Host: zap-api.kyberswap.com
Accept: */*
{
  "code": 0,
  "data": {}
}

Build Route

Build encoded data for the specified zap-migrate route.

post
Body

Build encoded data for zap-migrate transaction from the specified route.

senderstringOptional

the wallet sending the transaction, and thus, the tokens.

recipientstringOptional

the wallet receiving the new position. default to sender if empty.

routestring · byteOptional

the route as returned from get-route endpoint.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
deadlineinteger · int64Optional

deadline for the swap transaction to execute.

sourcestringOptional

the source of the zap-migrate transaction.

burnNftbooleanOptional

whether to throw away the position NFT or keep it.

Responses
200
A successful response.
application/json
post
POST /arbitrum/api/v1/migrate/route/build HTTP/1.1
Host: zap-api.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "sender": "text",
  "recipient": "text",
  "route": "Ynl0ZXM=",
  "deadline": 1,
  "source": "text",
  "burnNft": true
}
{
  "code": 1,
  "message": "text",
  "data": {
    "routerAddress": "text",
    "callData": "text",
    "value": "text"
  },
  "requestId": "text"
}

Zap Out

Get Route

Get the best zap-out route.

get
Query parameters
dexFromstring · enumRequiredExample: DEX_UNISWAPV3Possible values:
poolFrom.idstringRequired

id of the pool to withdraw from.

positionFrom.idstringRequired

id of the position to withdraw from

liquidityOutstringOptional

liquidity amount to withdraw, or empty or 0 to withdraw all

tokenOutstringRequired
aggregatorOptions.disablebooleanOptional

whether to disable swapping with the aggregator

aggregatorOptions.includedSourcesstringOptional

comma-separated list of sources to use for aggregator

aggregatorOptions.excludedSourcesstringOptional

comma-separated list of sources to exclude for aggregator

aggregatorOptions.excludedPoolsstringOptional

comma-separated list of pools to exclude for aggregator

feeAddressstringOptional

fee recipient

feePcminteger · int64Optional

fee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty. From 0 to 100,000 inclusively. Example: 1 for 0.001%.

slippageinteger · int64Optional

maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will revert) and pool swap during zap (for additional zapping and for refund). From 0 to 10,000 inclusively. Example: 1 for 0.01%.

Example: 100
Header parameters
X-Client-IdstringOptional

Client Id

Example: zap-docs
X-Request-IdstringOptional

Request Id

Responses
200
OK
application/json
get
GET /arbitrum/api/v1/out/route HTTP/1.1
Host: zap-api.kyberswap.com
Accept: */*
{
  "code": 0,
  "data": {}
}

Build Route

Build encoded data for the specified zap-out route.

post
Body

Build encoded data for zap-out transaction from the specified route.

senderstringOptional

the wallet sending the transaction, and thus, the tokens.

recipientstringOptional

the wallet receiving the new position. default to sender if empty.

routestring · byteOptional

the route as returned from get-route endpoint.

Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
deadlineinteger · int64Optional

deadline for the swap transaction to execute.

sourcestringOptional

the source of the zap-out transaction.

burnNftbooleanOptional

whether to throw away the position NFT or keep it.

Responses
200
A successful response.
application/json
post
POST /arbitrum/api/v1/out/route/build HTTP/1.1
Host: zap-api.kyberswap.com
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "sender": "text",
  "recipient": "text",
  "route": "Ynl0ZXM=",
  "deadline": 1,
  "source": "text",
  "burnNft": true
}
{
  "code": 1,
  "message": "text",
  "data": {
    "routerAddress": "text",
    "callData": "text",
    "value": "text"
  },
  "requestId": "text"
}

Last updated

Was this helpful?