π± What is a DEX?
You may not be familiar with DEX trading, here you can read everything there is to know
Last updated
You may not be familiar with DEX trading, here you can read everything there is to know
Last updated
A DEX (Decentralized Exchange) is a cryptocurrency exchange that allows users to swap cryptocurrencies for other cryptocurrencies in a decentralized manner.
Since there is no central management of funds, users generally don't need to worry about their funds going missing or being unable to withdraw or deposit funds.
This is because everything happens on the blockchain in a predictable manner.
The DEX allows for token swapping by using 'Liquidity Pools', these are token contracts that hold a balance of two tokens in a pair, adding liquidity to the pool's balance will grant a user "LP Tokens". These tokens could be considered a 'share' of a liquidity pool, taking the liquidity out of the pool will require the user to "Burn" their LP Tokens.
When a user swaps one token ("A") for another ("B"), the DEX Router searches for the pair (or pairs) necessary to facilitate the trade, then calls a function in the contract to initiate the trade.
The smart contract calculates the ratio of tokens available in the Liquidity Pool (LP) and then takes the user's "A" token and sends the user the correct amount of "B" tokens, according to the ratio of tokens present in the LP.
The amount of "A" tokens in the LP has now increased, while the amount of "B" tokens in the LP has decreased. This means the value / price of the "B" token has gone up in relation to "A", and the value / price of the "A" token has gone down in relation to "B".
Here are some advantages of using a DEX:
Of course there are some disadvantages to using a DEX over a CEX, such as:
Can not trade fiat ($β¬Β£Β₯) currency
Less oversight on tokens being traded and their creators
In general the consensus is that both DEX and CEX trading can be useful for different things, and using both in harmony with each other is most common.
A DEX runs solely on '', this means the code being executed is always visible to users and will always behave in a predictable manner, since the smart contract is the entity managing funds, a DEX is far better protected against human error and malice than traditional centralized exchanges (CEX).