BTB Finance for agents

Protocols / DEX Aggregator

KyberSwap Aggregator

DEX aggregator that splits a swap across many on-chain liquidity sources (plus RFQ). An agent gets the best route from the Aggregator API (GET /routes), has the API encode it (POST /route/build), approves the returned routerAddress for the input token, and sends the encoded calldata to the MetaAggregationRouterV2 router, which is deployed at the same address on every supported chain.

On-chain + APIEVM14 contractsWebsite · Docs

get_protocol({ "protocol": "kyberswap-aggregator" })

Risks an agent should know

What an agent can do

swap (ERC-20 input)Swap an exact amount of one token for another at the best aggregated rate
1) GET https://aggregator-api.kyberswap.com/{chain}/api/v1/routes?tokenIn=..&tokenOut=..&amountIn=.. with header x-client-id. 2) POST .../{chain}/api/v1/route/build with {routeSummary, sender: wallet, recipient: wallet, slippageTolerance: 50} and the same header. 3) If allowance(wallet, routerAddress) < amountIn, send tokenIn.approve(routerAddress, amountIn). 4) Send a tx {to: routerAddress, data: data, value: 0} (use the API's gas estimate plus a margin). Check that routerAddress is one of the official router addresses in this file before approving or sending.
swap (native token input)Sell ETH/BNB/POL/etc. directly
Use tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE in /routes. No approval needed. After /route/build send {to: routerAddress, data: data, value: transactionValue}.
swap without a separate approval (permit)For EIP-2612 tokens, skip the approve tx
Sign an EIP-2612 permit with spender = routerAddress and pass the encoded permit in the `permit` field of POST /route/build; then send the returned calldata as usual.
quote onlyGet expected output, price impact and gas cost without trading
GET /{chain}/api/v1/routes and read data.routeSummary.amountOut, amountOutUsd and gasUsd. There is no on-chain quoter; quotes come only from the API.
charge an integrator feeTake a fee on the swap for your app
Add feeAmount, chargeFeeBy (currency_in or currency_out), isInBps=true and feeReceiver to GET /routes; the fee is carried in routeSummary.extraFee and enforced by the router.

Contracts

ethereum · chain id 1

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI
KSAggregationRouterV3
router
0x6868D319c8c9A78F7d39DC3602C5c917315132D7
source
writeswap((address[],uint256[],(bytes,address[],uint256[],address[],uint256[])[],address[],(uint256,address[],uint256[])[],bytes,address,bytes,address,uint256,bytes))
readPERMIT2()
readpaused()
readowner()
Full ABI

bsc · chain id 56

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI
KSAggregationRouterV3
router
0x6868D319c8c9A78F7d39DC3602C5c917315132D7
source
writeswap((address[],uint256[],(bytes,address[],uint256[],address[],uint256[])[],address[],(uint256,address[],uint256[])[],bytes,address,bytes,address,uint256,bytes))
readPERMIT2()
readpaused()
readowner()
Full ABI

arbitrum · chain id 42161

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI

polygon · chain id 137

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI

optimism · chain id 10

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI

avalanche · chain id 43114

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI

base · chain id 8453

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI
KSAggregationRouterV3
router
0x6868D319c8c9A78F7d39DC3602C5c917315132D7
source
writeswap((address[],uint256[],(bytes,address[],uint256[],address[],uint256[])[],address[],(uint256,address[],uint256[])[],bytes,address,bytes,address,uint256,bytes))
readPERMIT2()
readpaused()
readowner()
Full ABI

linea · chain id 59144

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI

sonic · chain id 146

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI

unichain · chain id 130

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI

hyperevm · chain id 999

ContractAddressKey functionsTry
MetaAggregationRouterV2
router
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
source
writeswap((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
writeswapSimpleMode(address,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes,bytes)
writeswapGeneric((address,address,bytes,(address,address,address[],uint256[],address[],uint256[],address,uint256,uint256,uint256,bytes),bytes))
readWETH()
readisWhitelist(address)
readowner()
Full ABI

APIs

Aggregator API: [V1] Get Swap Route
auth: none
https://aggregator-api.kyberswap.com/{chain}/api/v1/routes
GET with query tokenIn, tokenOut, amountIn (base units; native token = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE). Optional: includedSources, excludedSources, gasInclude, origin (user wallet), feeAmount/chargeFeeBy/isInBps/feeReceiver for integrator fees. Send header `x-client-id: <your app name>` on every request (requests without it get stricter limits; public limit ~3 rps). Response: data.routeSummary (pass unchanged to /route/build) and data.routerAddress. {chain} is a slug: ethereum, bsc, arbitrum, polygon, optimism, avalanche, base, linea, mantle, sonic, berachain, ronin, unichain, hyperevm, plasma, etherlink, monad, megaeth, robinhood, arc. Do not cache routes for more than ~5-10 s.
Aggregator API: [V1] Post Swap Route For Encoded Data
auth: none
https://aggregator-api.kyberswap.com/{chain}/api/v1/route/build
POST JSON {routeSummary, sender, recipient, slippageTolerance (bps, 0-2000; 50 = 0.5%), deadline?, origin?, permit?, enableGasEstimation?, source?} with header `x-client-id`. Response data: data (calldata), routerAddress (tx `to`), transactionValue (tx value in wei, non-zero only for native-token input), amountOut, gas, gasUsd. Set enableGasEstimation=true to have the API eth_estimateGas and catch reverts before sending.
Aggregator API gateway (keyed)
auth: api-key
https://api.kyberswap.com/swap/
Same /routes and /route/build endpoints behind KyberSwap's API gateway, with an `X-Api-Key` header for higher rate limits. Key is issued by KyberSwap business development ([email protected]). The public base URL above stays available but is rate limited.

Notes

Kyber's contracts page states all aggregator contracts share the same address on every supported chain. MetaAggregationRouterV2 (0x6131B5fae19EA4f9D964eAc0408E4408b66337b5) is listed for Ethereum, BSC, Arbitrum, Polygon, Optimism, Avalanche, Base, Linea, Sonic, Berachain, Ronin, Unichain, HyperEVM, Plasma, Etherlink, Monad, MegaETH, Robinhood Chain, Rise and Arc; this file covers the 11 major chains (bytecode spot-checked on each) and the full list is at https://docs.kyberswap.com/developer-guide/aggregator-api/contracts.md. KSAggregationRouterV3 (0x6868D319c8c9A78F7d39DC3602C5c917315132D7) is listed only for Ethereum, BSC, Base and Robinhood Chain; the API still returned MetaAggregationRouterV2 as routerAddress in a Nov 2026 spot check, so always use the routerAddress the API returns (and check it against this list). AggregationExecutorProxy (0x8F10B468b06c6FD214B65F87778827F7D113f996) and InputScalingHelperV2 (0x2f577A41BeC1BE1152AeEA12e73b7391d15f655D, used to rescale API calldata on-chain by at most +/-5%) are also on the official page but are left out as contracts because agents do not call them directly. Function signatures come from the source verified on Sourcify (chain 1). The API is EVM-only. The non-versioned GET /{chain}/route/encode endpoint is legacy; use the [V1] routes + route/build pair (or GET /{chain}/api/v1/swap for a single request).

Sources

Researched 2026-11-25. Addresses are copied from the official sources above; check them before moving large amounts.