Uniswap Token Swap Guide

Jay
7 min readSep 7, 2020

--

What is Uniswap?

Uniswap is a decentralized exchange which offers the service for users to swap their ERC20 tokens. An example of such a swap is swapping ETH ( ethereum ) for BTC ( Bitcoin), or swapping your ETH for ALBT. Unlike Centralized exchanges, uniswap is designed to trade tokens without a middlemen / platform fees. The only fees that you do pay, are the fees of the transactions costs.

Swapping ( buying ) tokens through Uniswap

Swapping tokens on Uniswap can be done using the following link: https://app.uniswap.org/#/swap
The interface looks as following:

The interface is pretty self-explanatory. The From field are the tokens that you want to trade and the To field are the tokens you want to receive.

By clicking on the Select a token field, you will get a list that looks like this:

In here we can select a token. The above shows a list with tokens that are already on the market for a while. Since ALBT is new, it won’t be shown in this list yet.

To swap to ALBT, we need to enter the ALBT token contract address in the Select a token field.
The token address will only be published in the official AllianceBlock telegram channel (https://t.me/allianceblock ). Entering any other address will cause you to swap to the incorrect tokens and might end in permanent loss of funds

Once you have filled out the field, the interface will look like this ( except that the To token will be ALBT ):

Based on the amount of ETH we want to spent ( 1 in this case ) the amount of tokens that we receive is calculated. The other fields that we see are:

- Price. This is calculated in ETH per token that we swap to.

- Slippage Tolerance. This is a setting which can be adjusted to user preferences. See the Slippage part for more information

- Minimum received. This is the minimum amount of tokens that you will get based on the slippage. In this case the slippage is 3%. As you can see in the To field, we are expected to receive 338,073 USDT. With a slippage of 3%, this is a minimum of 338,073 * 0,97 = 328,2

- Price Impact. This is percentage that the price will either go up or down. See the Price Action part for more information.

- Liquidity Provider Fee. This is the fee that you will pay to Uniswap for doing the transaction through their platform

If we are fine with the outcomes, we can press swap to initiate the transfer through our wallet. It will show us a confirmation screen with a summary of all the above information. The continue we press Confirm Swap.

In this guide we will assume the user uses Metamask.
Once we pressed Confirm swap, our metamask wallet will open.
This screen looks as follows:

It shows us the amount of ETH that we are spending and the Gas Fee that we are paying.
For more detailed information about the Gas Fee, see the Gas Fee part.

The total is the amount of ETH that we are spending + the gas fee. If we are oke with these settings, we hit Confirm ( “Bevestigen” in the above image — this is the Dutch variant ).
Once we hit Confirm the transaction will be sent to the Ethereum network. You can follow the transaction by clicking on View on etherscan to follow the transaction. When the transaction is successfully mined, the tokens will be in your wallet. You are now the owner of ALBT.

Connecting wallet to Uniswap

To interact with Uniswap you need to connect a wallet. In the picture below you can see the wallets that can be used:

The most commonly used wallet is Metamask. Hardware wallets such as a Ledger Nano S can be connected to metamask. For more guidance on this topic, read: https://metamask.zendesk.com/hc/en-us/articles/360020394612-How-to-connect-a-Trezor-or-Ledger-Hardware-Wallet

Slippage

Slippage occurs when the price of the token has moved since you have made the transaction. As the transaction takes time to get mined on the network, other transactions might have come through and changed the price. As a user we can adjust the maximum slippage percentage to our preference. If the price has moved more percentage than our maximum slippage, the transaction will fail and you won’t be getting the desired tokens ( funds that you invested will be returned ). The more liquidity there is provided, the less the slippage will be.

Slippage refers to the maximum amount of difference between the tokens you are expected to get and the amount of tokens that you are actually receiving. These are two examples of slippage:

- 10% Slippage. We are expected to receive 100 tokens, but the price has moved 10% since our transaction is mined. Since we have 10% slippage, we will receive 90 tokens.

- 1% Slippage. We are expected to receive 100 tokens, but the price has moved 1%. As our slippage is 1%, we will get 99 tokens.

- 1% Slippage( Failed transaction ). We are expected to receive 100 tokens. The price has moved 2%. Since our slippage is 1%, the transaction will fail and we didn’t get any tokens.

To adjust the amount of slippage, hit the settings button in the right upper corner.

The following screen will popup:

In the Slippage tolerance section we can set our maximum slippage.

How does price action work on Uniswap

In this example we will make use of two tokens, ETH and Token XXX.
In this example, the liquidity proved is 1000 ETH and 1000 Token XXX.

Since the provided liquidity is 1000 ETH and 1000 Token XXX, the price of 1 Token XXX is 1 ETH.
One user has just bought 100 ETH worth of Token XXX. The liquidity pool now has 1100 ETH and 900 Token XXX. This means that the price of 1 Token XXX is now: 1100 ETH / 900 XXX = 1,2 ETH. The price has risen so that 1 Token XXX now costs 1,2 ETH.

Gas Fees

To make a transaction, a user pays gas fees. Depending on the congestion of the network, you will have to set a gas fee that makes sure the transaction gets mined. The higher the gas fee, that faster the transaction. You can follow the congestion of the network and the preferred amount of Gas used for a transaction at: https://ethgasstation.info/

Metamask will automatically use the gas fees that are needed to get the transaction mined within a few minutes, but when the network activity starts rising this might not be enough.

To adjust the gas fee to an amount that we want to use, we click on the EDIT button in metamask:

In the next screen we have 2 options:

Basic

In the basic screen we can choose 3 options. The preferred one to get the transaciotn through the quickest is “Fast”

Advanced

Here we can put in the amount of GWEI that we want to use ourselves.

Disclaimer

Swapping tokens through uniswap by entering an incorrect contract address, might result in a loss of funds.
The token contract address will be published in the official AllianceBlock Telegram group only. (
https://t.me/allianceblock ). It will not be published through any other official or unnoficial AllianceBlock outlets.

For a visual representation of how uniswap works checkout:
https://www.youtube.com/watch?v=ovbs8LT8wIg

For more information regarding metamask, checkout:

--

--