How Does Trading Aggregation Work on Zerion?
If you’ve spent any time trading on decentralized exchanges then you know that prices can differ widely. Coupled with unpredictable gas costs, this lack of clear prices means that you often don’t know which exchange will give you the best offer.
Luckily, trading aggregators like Zerion can help make sure you get the best deal and even save on gas.
In this post we’ll review how trading aggregation works on Zerion, which liquidity sources we use, and how you can use this to manage your crypto portfolio more efficiently.
First, let’s quickly review how decentralized exchanges function and why their prices are different.
Why decentralized exchanges have different prices
Traditional, centralized crypto exchanges are based on order books.
Order books are lists of buy and sell orders. Some traders post orders to sell an asset at different prices. Other places buy orders, also with specific prices.
Decentralized exchanges have moved away from this approach.
Instead, a decentralized exchange (DEX) quotes a price based on an algorithm specified in a smart contract.
The best-known example is Uniswap’s automated market maker (AMM). It pools assets from crypto holders who act as liquidity providers. For each trading pair, the value of assets in the pool should be equal.
Other DEXes might have different formulas in their smart contract. Yet the idea is the same:
the price is determined algorithmically based on the supply of liquidity.
Even though Uniswap is the largest DEX in terms of total trading volume, it might not necessarily always give you the best price. Another exchange might have even more liquidity for the specific token that you want to swap. Or it might be cheaper to first transform into another token (e.g. DAI to USDT) and then to your target token.
Gas costs add another variable to the mix.
During periods of high gas prices, prices might diverge on different exchanges because it's more expensive to arbitrage away the differences. Also, swaps on different exchanges might have different gas costs.
Finally, DEX trading fees might vary from pool to pool. At Uniswap, for example, liquidity providers can set three fee tiers: 0.05%, 0.30%, and 1%.
To sum up, prices on decentralized exchanges vary because:
- Different DEXes use different algorithms in their smart contracts,
- Each liquidity pool is balanced independently and the volume of available liquidity determines the price,
- Gas costs might prevent arbitrage that would remove the price differences,
- Different pools might have higher or lower DEX trading fees.
Yet this doesn’t mean that you have to manually check prices on all the DEXes and pools out there.
How Zerion finds the best price
Zerion automatically scans every major decentralized exchange to find the best price for you every time you trade with our DeFi SDK, an open open-source library of smart contracts we built to integrate leading DeFi protocols.
These smart contracts were audited by Trail of Bits and Peck Shield. Over $1.2 billion in transactions have already been processed through these contracts on Zerion.
Here’s how Zerion trade aggregation works at a high level:
- You select assets that you want to sell and that you want to buy,
- Zerion checks the current prices for this pair across every DEX,
- Zerion recommends the best deal.
Zerion currently supports Uniswap, Sushi, 1inch, Balancer, Bancor, Curve, 0x, DODO, and other leading decentralized exchanges.
At any given moment, Zerion will route the trade through whichever exchange offers the best price for the requested token, taking into account DEX fees, gas costs, and potential slippage.
Now let’s review what exactly you need to do to trade on Zerion.
How to trade on Zerion
Here are the steps to trade on Zerion:
- Connect your non-custodial wallet to the Zerion app by clicking the button in the upper right corner. You’ll be asked to sign a transaction.
- Select the network on which you want to trade and the tokens you want to swap.
- Zerion will offer you the best price available. You’ll get a warning if there is not enough liquidity and your trade would move the price too much.
- If you’re happy with the price, you’ll need to sign the approval for this specific DEX and asset (This happens once per asset on each DEX).
- Confirm the transaction and Zerion will process the transaction.
Here is a video that shows how trading aggregation on Zerion works:
Note: If you swap the same token in several trades you might need to sign approvals again if the price changes and the next trade is routed through a different exchange.
Make your first trade — on any chain
Even with Zerion’s help, gas fees on Ethereum can make DEX trading too expensive for people who aren’t crypto whales or are just learning how to DeFi.
Luckily with Zerion, you can also trade on Layer 1 and Layer 2 scaling solutions that have much lower fees: Arbitrum, Aurora, Avalanche, BSC, Fantom, Gnosis Chain, Optimism, Polygon.
On any of those networks, Zerion will help you find the best prices across all supported DEXes.