Comment on page
Decentralized Exchange (DEX)
Non-Custodial Token Swaps
Decentralised exchanges (DEXs) enables peer-to-peer trading of tokens without the custodial requirements of a middleman (i.e. a trusted third-party has to hold both assets to successfully facilitate a trade). DEXs allow users to trade directly with smart contract code with no intermediaries. The smart contract code will be viewable by anyone and all interactions with the contract will be viewable on a public blockchain (see KyberSwap Classic Contracts and KyberSwap Elastic Contracts as an example). Throughout this whole process, the user never loses custody of their own assets.
DEXs come in two flavors which are differentiated based on their order matching mechanisms which are further detailed in their respective pages:
For the purpose of this comparison, the table below summarizes the pros and cons of each according to three main convenience factors:
For traders, the choice of which DEX type to use boils down to two main factors:
Price assurance refers to the certainty surrounding the final price of a trade. For traders prioritizing price assurance, the order book model is the better choice as it allows users to predefine a price for the trade which will be completed as long as there is a corresponding matching order. The trade will be completed when there is sufficient quantity to match the trade order.
The trade off here is that the order can take an indefinite amount of time to complete. The larger the trade volume, the longer the waiting time. Users are able to set a validity period for their order whereupon hitting the specified deadline, the order becomes invalidated.
Trade immediacy refers to how quickly a trade can be executed. For traders prioritizing trade immediacy, AMM is the better choice as it allows for the trade to take place immediately without having to wait for a counter party. There are also less limits around the trade volume as the trade is against the pool's liquidity rather than an aggregation of multiple orders. Consequently, there is also less slippage risk (difference between the expected price of a trade and the price at which the trade is executed) as the price follows a smooth price curve.
The trade off here is that the trade must be executed around the current market price. The larger the trade volume relative to pool size, the further the execution price from the market price. Users are able to set a slippage tolerance but not a fixed price. The trade will be cancelled if its parameters falls outside these price boundaries.
For market makers, the decision can be broken down into the following two main factors:
As per its name, AMMs automates the whole market making process meaning that liquidity providers do not need to constantly monitor and readjust their positions. The liquidity provided to an AMM is constantly being utilized in the market making process according to the parameters set out in the pool. In the majority of cases, the trading fees are natively reinvested into the pool enabling yields to be compounded automatically.
The downside here is that liquidity providers have less fine tuned control over the prices which their assets are getting sold at. As long as their liquidity is supporting trades within a price range, their funds are actively being sold in incremental amounts based on the price curve.
As most AMMs (not KyberSwap Classic) implement static fees for trades, the market spread tends to be market neutral regardless of the market conditions. This could prove disadvantageous for liquidity providers during periods of extreme market volatility as they face even greater impermanent loss risks.
Limit orders enable users to manually set a price hence market spreads are implicitly accounted for at the point of creating the order. This facilitates more fine tuned control over the trading of funds as prices are guaranteed and limit orders are less affected by the need to time the market.
KyberSwap understands that market conditions can change rapidly and we want to provide our users with all the tools necessary to take advantage of the market. To this end, we have implemented multiple solutions that enable our users to trade and earn at the best rates.