Fundamentals: What is a DEX aggregator?

A quick explanation of how DEX aggregators help traders get the best prices.

April 19, 2023

Learn & Build

A DEX aggregator is a service that brings together liquidity from a number of different decentralized exchanges and market makers, helping users quickly find the best price for a given trade.

Since liquidity in DeFi is fragmented across dozens of different sources, ensuring you’re getting the best price means having to check out multiple trading venues. Some exchanges will offer better prices, but have high slippage, while others offer worse rates for lower slippage. Aggregators are a user-friendly way to bring all of this information and liquidity together to get users the best prices.

How does a DEX aggregator work?

There are a number of different types of DeFi aggregators – you can aggregate token prices on exchanges, or rates from lending services, and yield farming protocols. But they all work in a similar way: data is pulled from a variety of sources and is shown to the user to allow them to optimize their trades. It’s similar to how a website like Expedia pulls together all of the flight price data from various airlines.

Let’s take Matcha, the DEX aggregator built by 0x Labs, as an example. Matcha aggregates liquidity for user trades from dozens of sources, including Uniswap, Aave, and Sushiswap, across eight blockchains, such as Ethereum, Polygon and Binance Smart Chain. Matcha also taps into liquidity provided by professional market makers, and once the best price is identified, uses “smart order routing” to maximize the overall return on your trade.

What is smart order routing?

A typical aggregator will scan across multiple DEXes and present someone with the best overall exchange or liquidity source to make a trade with. But Matcha, using smart order routing, goes one step further by also splitting your trade up across different DEXes and liquidity sources. This ensures that you’re able to maximize the overall value of your trade.

For example, maybe the best price to trade 1,000 DAI for 1 ETH is 50% through Bancor, 25% through Uniswap, and 25% through Uniswap. 0x Swap API's smart order routing logic automatically calculates this and packages it into a single quote that's ready to be executed.

What is slippage protection?

0x's Swap API also has a pair of features that differentiate it from all other DEX aggregators. One of those is called slippage protection. When trading on DEXes, a variety of external market factors could cause the price of your trade to shift between you placing your trade, and your trade actually executing. This is referred to as slippage, and it’s something you wouldn't notice until the trade is settled.

Swap API's slippage protection works with the API’s smart order routing to forecast the amount of slippage a trade might incur, allowing the algorithm to deliver the optimal trade route. The slippage protection forecasts incorporate factors including trading pairs, liquidity and the size of your trade.

What is price impact protection?

Another key feature offered by Swap API is price impact protection. Similar to slippage, price impact occurs in between a trader placing a trade, and its actual execution.

Price impact isn’t caused by external factors, however, but instead by the influence that your trade itself has over the market price of a trading pair. This makes price impact directly related to the amount of liquidity in a trading pair, and price impact will be higher when placing large trades on illiquid assets.

Price impact protection is an optional feature of the API. But when enabled, it allows users to avoid getting rekt by trading illiquid tokens. When using the API, users will be notified when their trade faces a price impact over a certain threshold. The API will return an error of insufficient liquidity due to the price impact being higher than the defined limit, which is easily customizable.

Enable crypto trading in your app with Swap API

Swap API aggregates liquidity from 100+ AMMs and professional market makers on the most popular blockchains. With Swap API, you can easily power crypto trading in your application with a single integration that unlocks thousands of tokens. Learn how you can leverage Swap API to access deep liquidity without the infrastructure overhead.

Contents

Subscribe to newsletter

By submitting you're confirming that you agree with our Terms and Conditions.
Yay! You’re signed up.
Oops! Something went wrong, but it's not your fault.

Up next

Compliance made easy with 0x Address Screening

Sep 26, 2024

0x's next-gen pricing engine is now live

Sep 25, 2024

Introducing state-of-the-art Buy/Sell Tax support

Sep 4, 2024

Take control of your balance sheet with 0x v2

Aug 15, 2024

0x v2 bug bounty program

Jul 30, 2024

What does the "best price" in DeFi really mean?

Jul 23, 2024

Eliminate allowance risk with Permit2

Jul 17, 2024

Introducing 0x's next-gen pricing engine

Jul 15, 2024

0x Dev Digest: May 2024

May 31, 2024

Frame spotlight: Paycaster

May 21, 2024

Frame spotlight: Airstack

May 9, 2024

Power up your Farcaster Frames with 0x swaps

May 2, 2024

0x Dev Digest: April 2024

Apr 30, 2024

Introducing 0x Trade Analytics

Mar 12, 2024

Coinbase Case Study

Jan 30, 2024

Introducing gasless swaps and approvals with Gasless API

Jan 22, 2024

Bitcoin ETFs have arrived

Jan 12, 2024

Building in the open: 0x pricing update

Dec 11, 2023

Matcha leverages Gasless API to bring users the most frictionless trading experience in DeFi

Nov 30, 2023

0x Dev Digest: October 2023

Nov 2, 2023

Monetize crypto trading in your app with Swap API

Oct 26, 2023

0x Dev Digest: September 2023

Oct 3, 2023

A comprehensive analysis of RFQ performance

Sep 26, 2023

Unlock optimal trades in Swap API with 0x RFQ liquidity

Sep 20, 2023

0x Dev Digest: August 2023

Aug 31, 2023

Portal launches swaps in its white label MPC wallet powered by 0x

Aug 16, 2023

0x Swap API is now live on Base

Aug 9, 2023

Introducing paid plans for Swap API

Jul 24, 2023

Decreasing Frictions in DeFi hackathon recap

Jul 12, 2023

0x's pricing principles

Jul 3, 2023

0x Dev Digest: June 2023

Jun 30, 2023

App spotlight: tastycrypto

Jun 27, 2023

App spotlight: 31Third

Jun 22, 2023

0x 101: Intro to gasless API

Jun 13, 2023

Inspiration for building with Swap API

Jun 8, 2023

0x Dev Digest: May 2023

May 31, 2023

Fundamentals: What are gas fees?

May 25, 2023

Decreasing Frictions in DeFi Hackathon

May 12, 2023

Swap API liquidity management

May 18, 2023

0x 101: Getting started with Swap API

May 16, 2023

0x 101: Intro to Swap API

May 9, 2023

0x 101: Intro to 0x Orders

May 4, 2023

0x 101: Intro to 0x Protocol

Apr 27, 2023

A new home for 0x Protocol

Apr 24, 2023

Say hi to the new 0x

Apr 20, 2023

0x Year in Review 2022

Jan 5, 2023

0x Swap API expands to Arbitrum

Sep 22, 2022

Managed liquidity

Apr 23, 2020

0x Smart Order Routing

May 19, 2020

App spotlight: Taho

Mar 8, 2022

Fundamentals: What is a Layer 2 chain?

Apr 19, 2023

Fundamentals: What is the difference between quoted, executed, and adjusted prices?

Apr 19, 2023

Fundamentals: What is price impact?

Apr 19, 2023

Fundamentals: What is slippage?

Apr 19, 2023

Fundamentals: What is an automated market maker (AMM)?

Apr 19, 2023

Fundamentals: What is market making?

Apr 19, 2023

Fundamentals: What is liquidity?

Apr 19, 2023

Fundamentals: What is a decentralized exchange (DEX)?

Apr 19, 2023

0x at ETHDenver 2023

Mar 21, 2023

The 0x Mission and Values

Jun 7, 2018

Announcing support for new testnets

Aug 10, 2022

0x Swap API expands to Binance Smart Chain

Mar 17, 2021

Scaling DeFi — Layer One

Sep 1, 2021

Introducing Slippage Protection

Jul 14, 2022

San Francisco Blockchain Week 2022 Recap

Nov 21, 2022

0x Swap API adds new liquidity sources

Jul 11, 2022

Review of slippage performance

Sep 14, 2022

Phuture case study

Oct 20, 2022

Measuring the impact of hidden DEX costs

Apr 14, 2022

Market making in DeFi

Aug 12, 2021

Introducing 0x Labs

Jun 22, 2020

Introducing 0x Explorer

Oct 26, 2022

Growing DeFi with professional market makers

Aug 26, 2020

0x 101: How to Access 0x Data

Apr 25, 2023

GameStop chooses 0x Swap API

Jul 8, 2022

Build on Base with 0x

Feb 23, 2023

A comprehensive analysis on DEX liquidity aggregators’ performance

Oct 1, 2020

Announcing 0x Swap API v1

Oct 1, 2020

Access all DEX liquidity through 0x Swap API

Jan 28, 2020

Announcing the 0xpo Summit 2022

Aug 24, 2022

0x Protocol, a preview of what’s to come

Mar 16, 2023

Update to our Privacy Policy

Mar 14, 2023

Price Impact Protection has arrived

Dec 14, 2022

0x Limit Orders Go Multi-Chain

Dec 23, 2021

0x Labs raises $70M Series B led by Greylock to continue expanding Web3’s core exchange infrastructure

Apr 26, 2022

0x launches Tx Relay API in beta, with Robinhood Wallet as first partner

Mar 1, 2023

0x Labs raises $15M Series A to bring decentralized exchange markets to a global audience

Feb 5, 2021

App spotlight: Zerion

Jun 22, 2022

App spotlight: Matcha

Nov 24, 2021

App spotlight: DexGuru

Jun 17, 2021

App spotlight: DEXTools

Sep 23, 2021

App spotlight: DODO

Aug 10, 2021

App spotlight: DappRadar

Dec 16, 2021

App spotlight: DeFi Saver

Jul 20, 2021

0x + Brave partner to make crypto and DeFi more accessible to everyone

Jul 7, 2021

0x Swap API now supports 0x Protocol v4

Mar 1, 2021

0x Swap API is now available on Fantom

Oct 26, 2021

0x Swap API is now live on Optimism

Jan 11, 2022

0x Swap API is now available on Polygon

May 31, 2021

0x Swap API is now available on Celo

Nov 18, 2022