ZaaS HTTP API

ZaaS HTTP API

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 dex-ids.md and zaps-supported-chains-dexes.md for list of supported DEXes for each chain and their corresponding IDs

API list

Zap in

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

Returns the best route to zap-in to the specified pool position.

codeinteger · int32Optional
messagestringOptional
requestIdstringOptional
get
/api/v1/in/route

Build Route

Zap Migrate

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

Returns the best route to zap-migrate from an existing position to the specified pool position.

codeinteger · int32Optional
messagestringOptional
requestIdstringOptional
get
/api/v1/migrate/route

Zap Out

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

Returns the best route to zap-out from an existing position to the specified pool position.

codeinteger · int32Optional
messagestringOptional
requestIdstringOptional
get
/api/v1/out/route

Last updated

Was this helpful?