What is a coin swap?


Maybe you've ever bought crypto tokens on a decentralised crypto exchange (DEX). If so, you've probably noticed that "swapping" is mentioned here. You'll also see the term "token swap" coming up more and more in other places, as the number of applications running on the blockchain (dApps) grows.

In this article we explain what a token swap is, and in what forms it can take place.

What is a token swap?


By a token swap, we mean exchanging two tokens. However, there can be a way in how this happens. This ensures that two different things can be meant by a token swap.

A token swap occurs when users exchange tokens against other tokens that come from a liquidity pool. Token swaps also take place when tokens are exchanged between two different blockchains.

Exchange of tokens between user and pool


In many cases, token swapping refers to the exchange of tokens between a user and pool. This is becoming more common due to the increasing number of DeFi applications. These are applications that run on the blockchain, and in which users can make a transaction to use the application.

To make a transaction in such an application, of course, requires tokens. Just as a cash register must contain money to provide customers with change. Because a DeFi application runs decentralised, there is no central party that provides the tokens. The users will have to provide these tokens themselves, which is called providing liquidity.

Liquidity pool


People can lend tokens to a liquidity pool. This is a wallet in which all tokens are kept. The wallet remembers who sent tokens to the liquidity pool, and how many tokens they sent. A person who does this is called a liquidity provider (LP).

The tokens stored in the liquidity pool can be used by different applications. Let's take a decentralised exchange (DEX) as an example. This is a platform where you can buy crypto tokens, just like on a central exchange like Coinmerce. However, a DEX differs from a central exchange because it runs on a blockchain, and thus operates in a decentralised manner.

Swapping tokens on a DEX


When someone wants to buy tokens on a DEX, he will have to swap tokens. This means that the tokens he wants to buy another token with, will be exchanged for each other, in order to realise a sale.

Suppose Lotte is in possession of 100 AAVE tokens, and she would like to buy UNI tokens from them on the Uniswap DEX. Lotte indicates that she wants to buy UNI tokens, and indicates that she wants to do so with 100 AAVE tokens. Next, the DEX calculates how many UNI tokens Lotte will get for this. These are 200.

When Lotte agrees to the price, the token swap will begin. Uniswap ensures that the 100 AAVE tokens are moved to the liquidity pool, and then 200 UNI tokens are taken from the liquidity pool and moved to Lotte's wallet. So this is a so-called token swap: tokens are exchanged for each other.

Exchange of tokens between two different blockchains


A token swap can also take place when tokens are exchanged between two different blockchains. This is not possible with every blockchain. However, the blockchains between which tokens are exchanged must support the token standards they use.

A token standard is a set of rules that a token must meet in order to be considered a token. For example, the tokens must be developed in the same programming language so that any system can read the tokens.

For example, a token swap between the Bitcoin and Ethereum blockchain is not possible. Bitcoin does not support the ERC20 token standard, and Bitcoins cannot run on Ethereum either.

Ethereum does offer support for NEO and QTUM, among others, and both tokens can run on Ethereum's blockchain without problems. Thus, it is possible to swap QTUM tokens from the Quantum blockchain to the Ethereum blockchain. Ether tokens will then be able to run on Quantum's blockchain.

Why swap tokens between blockchains?


The main reason for swapping tokens between different blockchains is that it allows one to use multiple applications and protocols. For example, an application on Quantum might want to use a protocol running on Ethereum. This is then possible because users can swap tokens between these two blockchains.

Conclusion


A token swap involves exchanging two tokens for each other. The way this happens can vary. In most cases, it happens when a user exchanges tokens with a liquidity pool. Another way a token swap can take place is by exchanging tokens between two different blockchains. This can be useful when applications and protocols want to make use of an application or protocol running on a different blockchain.