Decentralised exchanges (DEXs) like Uniswap and Curve have pretty much mastered the art of non-custodial trading. These trading protocols automatically weave together trades by sifting funds through user-funded liquidity pools. But they lack efficiency.
The problem is that the $18 billion DEX market is split across close to a thousand exchanges, each containing thousands of liquidity pools that impose their own set of rules and prices upon traders.
While DEX aggregation protocols like 1inch and ParaSwap promise to calculate the most efficient trades on behalf of investors, the DEX aggregation market is also fragmented across dozens of protocols, each of which has its own homebrew method for getting users the best prices on trades.
To simplify the ordeal of picking the right aggregator, DefiLlama created LlamaSwap, a free-to-use protocol that finds the best deal on a crypto trade across the top 10 DEX aggregators.
LlamaSwap taps popular exchange aggregators and finds the deal that saves the trader the most money. In an instant, LlamaSwap condenses that fragmented market of close to a thousand protocols into a single app.
How LlamaSwap works
LlamaSwap is the final stop in a set of DeFi transactions that help traders buy and sell tokens while incurring the lowest fees and the most stable prices.
At the bottom of the pile are DEXs. These exchange protocols do not hold funds in a centralised orderbook, a la Coinbase or Binance, but facilitate trades through vast reserves of tokens called liquidity pools. Other users park their funds in these pools to grease the wheels of the exchange and earn a cut of the transaction fees.
DEXs move funds in and out of these pools to process trades. Let’s say you want to swap some Ether for Circle’s USDC stablecoin. The exchange adds your Ether to a liquidity pool containing both tokens, then credits you with USDC from the pool. To account for the imbalance of tokens, the liquidity pool makes ETH a little cheaper to balance the value of the Ether and USDC in the pool.
Prices across liquidity pools can vary for smaller tokens that attract less liquidity, so it is often cheaper to reroute the trade through several liquidity pools. Consequently, a DEX that is short on USDC might first convert funds from other liquidity pools, or take funds from other protocols altogether.
Routing across several pools and protocols can quickly become complicated, and some DEXs are more efficient than others. Given the breadth of the market, choosing the cheapest route to swap coins is, obviously, impossible to do alone. Even if you tried, the price of the token you’re trying to buy could have dropped by the time you’d worked it out. High transaction fees can make wrong moves even more expensive.
That’s where DEX aggregators come in. DEX aggregators compile the best prices from hundreds of decentralised exchanges, much like how Expedia scrapes together a list of the cheapest flights and hotels. Some DEX aggregators also take so-called slippage into account, referring to the price difference between when you submit a transaction and when the transaction is confirmed on the blockchain.
Yet even DEX aggregators diverge in their efficiency. That’s where LlamaSwap comes in. LlamaSwap ranks the best prices across 20 blockchains from 10 popular DEX aggregators to work out which is the most efficient for a particular trade.
To do so, it orders the DEX aggregators by their quote and gas fees — how much you’ll have to pay the blockchain network to get your transaction through the door.
How to use LlamaSwap
To use LlamaSwap:
- Head to DefiLlama Swap via the sidebar on the DefiLlama landing page.
- Connect your cryptocurrency wallet to LlamaSwap by clicking the “Connect Wallet” button in the top right corner of the screen.
- Select the tokens you’d like to swap from the dropdown menus. So, to swap USDC to ETH, select “USDC” under the “You Sell” menu and ETH from the “You Buy” menu.
- Enter the amount you’d like to swap. The bottom field will automatically calculate what you will receive in the destination token.
- Select your slippage tolerance, or enter a custom amount. Slippage refers to the difference between the expected price of a trade and the actual price at which it is executed. The slippage tolerance is impacted by market volatility and liquidity conditions.
- Select your trade from the list of aggregators on the right side of the screen. If everything looks good, click “Approve” on your preferred trade route.
- Click “Swap via xxxx”, where “xxxx” will show the chosen aggregator.
- Review the transaction details inside your crypto wallet and, if it’s all as you expected, execute the trade.
A couple of notes:
First, airdrop eligibility. LlamaSwap users remain eligible for airdrops from DEX aggregators similar to an airdrop allocated to swaps executed directly from a DEX aggregator’s app. Historically DEXs have passed on airdrops to aggregators who in turn can choose to distribute.
Second, privacy. LlamaSwap gives users the ability to hide their IP address by redirecting requests through DefiLlama’s servers. This prevents aggregators from linking your wallet to your IP address. DefiLlama does not store IP address data.
And just like that, DeFi trading becomes a whole lot cheaper.