Introduction to DexAggregator

DEX Aggregator API - Optimal Swap Routes Powered by KyberSwap

DexAggregator is a powerful Go-based API service that integrates KyberSwap's intelligent routing algorithm with custom DexAggregator smart contracts. It provides developers with optimal token swap routes and ready-to-use encoded transaction data for seamless DeFi integration.

Why DexAggregator?

  • 🔄 Optimal Routes - Leverages KyberSwap's aggregator to find the best swap rates across 100+ DEXes

  • Ready-to-Use - Returns ABI-encoded calldata ready for direct smart contract execution

  • 🛡️ Slippage Protection - Built-in minAmountOut calculation with customizable tolerance

  • 🌐 Multi-Chain - Supports BSC, Ethereum, and easily extensible to any EVM chain

  • 🎯 Multiple Strategies - Simple, Batch, Multi-Hop, and Parallel Multi-Hop swaps

  • 🔍 Gas Estimation - On-chain gas estimation for accurate transaction costs

Features

Automatic Route Building

Query KyberSwap's aggregator API, filter to trusted adapters, and automatically encode the optimal route into smart contract calldata.

Custom Route Support

Manually define swap paths with specific adapters and token routes for advanced use cases and testing.

Four Swap Types

  • Simple Swap: Direct swap through a single DEX

  • Batch Swap: Split liquidity across multiple DEXes

  • Multi-Hop Swap: Sequential swaps through intermediate tokens

  • Parallel Multi-Hop: Complex parallel routing with internal hop chains

Smart Contract Integration

Pre-configured adapter contracts for:

  • UniswapV2 / V3 / V4

  • PancakeSwapV2 / V3

  • And more...

Quick Example

Response includes:

  • ✅ Optimal route details

  • ✅ Expected output amount

  • ✅ Minimum output with slippage protection

  • ✅ ABI-encoded executorData ready for contract call

  • ✅ Gas estimation

Use Cases

DeFi Applications

Integrate optimal swap rates directly into your dApp without building routing logic.

Trading Bots

Programmatically execute swaps at the best rates across multiple DEXes.

Portfolio Managers

Efficiently rebalance portfolios with minimal slippage and gas costs.

Cross-DEX Arbitrage

Identify and execute profitable arbitrage opportunities across different protocols.

Architecture

The service acts as a bridge between KyberSwap's powerful routing and your custom DexAggregator smart contracts, handling all the complex transformations and encoding automatically.

Getting Started

Ready to integrate? Jump to our Quickstart Guide to make your first API call in under 5 minutes.

For detailed API specifications, see the API Reference.


circle-check
circle-info

Need Help?

Last updated