Skip to main content
Version: V2

Overview

Introduction

KyberSwap Aggregator allows users to swap tokens easily at the best rates by aggregating liquidity from different DEXs on the network. Developers integrating KyberSwap also have the option of customising fees, as well as which token they would like to accept the fees in.

In order to integrate KyberSwap's DEX Aggregator Swap into your website, you will be using the @kyberswap/aggregator-sdk. The goal of the SDK is to help you get the data you need to supply to KyberSwap smart contract's Swap function, which is invoked when users swap on your website.

Installation

Create and initialize a node directory or use an existing one, then install KyberSwap Aggregator SDK by running yarn add @kyberswap/aggregator-sdk or npm install @kyberswap/aggregator-sdk.

Pre-requisites

Before getting the data from KyberSwap Aggregator SDK, you need to give it parameters like the amount of input token, the minimal amount of output token, and the trade route. To get these parameters, you would need to make a request to KyberSwaps Aggregator API.

To understand how to use the Aggregator API, please visit the following link: https://docs.kyberswap.com/developer-guides/aggregator-api/overview

⚠️ If your site charges the fee in input currency, please call the API with the amount after subtracting fee. eg: If a user wants to swap 0.1 BNB, and your site wants to charge a fee of 0.8% in input currency, then your site should make a request to Aggregator API with an amount that equals 0.1 * (1 - 0.8%) = 0.0992 BNB.

Exchanges aggregated on each Network

Ethereum

  • KyberSwap
  • uniswap (v2)
  • uniswap (v3)
  • sushiswap
  • curve (3pool, aave, saave, hbtc, ren, sbtc, eurs, link)
  • balancer
  • synapse
  • shibaswap
  • defiswap

Arbitrum

  • Kyberswap
  • swapr
  • balancer
  • curve
  • sushiswap
  • synapse
  • saddle

Polygon

  • sushiswap
  • quickswap
  • uniswap (v3)
  • jetswap
  • wault
  • polycat
  • dfyn
  • polydex
  • KyberSwap
  • firebird
  • oneswap
  • iron-stable
  • curve
  • synapse
  • balancer
  • gravity
  • cometh
  • apeswap
  • dinoswap

Avalanche

  • KyberSwap
  • iron-stable
  • pangolin
  • traderjoe
  • curve
  • synapse
  • axial
  • lydia
  • yetiswap

BSC

  • KyberSwap
  • sushiswap
  • firebird
  • oneswap
  • ellipsis
  • nerve
  • apeswap
  • jetswap
  • mdex
  • pancake
  • wault
  • biswap
  • pancake-legacy
  • synapse
  • pantherswap

Fantom

  • spookyswap
  • spiritswap
  • curve
  • jetswap
  • paintswap
  • sushiswap
  • KyberSwap
  • synapse
  • morpheus
  • beethovenx
  • saddle

Cronos

  • KyberSwap
  • vvs finance
  • cronaswap
  • crodex
  • mmf
  • kryptodex
  • empiredex
  • photonswap

Aurora

  • KyberSwap
  • trisolaris
  • wannaswap
  • nearpad

Velas

  • KyberSwap
  • astroswap
  • waguswap

Oasis

  • KyberSwap
  • lizard
  • valleyswap
  • valleyswap (v2)
  • yuzuswap
  • gemkeeper

BitTorrent Chain

  • KyberSwap