My DeFi diary — day 6: diving into liquidity pools

Richard Jamieson
6 min readJun 4, 2021

This series is a look back at the last few months as I’ve made my way into the crypto space, and particularly into the DEFI space, as a complete newbie. I aim to catalogue the moves I’ve made, the tech I’ve experimented with, and the mistakes I’ve made along the way. I include some details around fees and logistics, hopefully to be useful to others wanting to follow in my footsteps.

29 April 2021 04:56 ETH @ $2,758.46 Gas Price: 45 Gwei

Notice firstly the ghastly hour at which I was making this set of transactions — before 5AM in the morning! I was doing this in a deliberate (desperate?) attempt to avoid high gas fees on the Ethereum network. Things seem to have stabilised since then, but 5AM South African time seemed to be a good time to get in before the network got congested with all of the Europeans waking up.

I found this quite a useful chart at the time:

Gas Price by Time of Day — from https://ethereumprice.org/gas/

Even at 5AM in the morning, you’ll see later that my total gas fees for this set of transactions (essentially the transactions involved in entering a liquidity pool on Uniswap) came to just over $90!

But let’s back up a step. What are these things called liquidity pools? As mentioned in a previous post, by putting my money into a pool, I am providing liquidity that makes it possible for others to trade (or swap) one cryptocurrency for another, and in return for providing that liquidity I earn a small percentage fee on every trade that gets made in the pool.

But we have to back up even a step further, and ask where this is happening? And the answer to that is — on Decentralized Exchanges (DEX’s) that are Automated Market Makers (AMM’s). Let’s unpack that a little bit. An exchange is something fairly easy to exchange — it’s somewhere you can go to exchange one thing for another, in this case different cryptocurrencies.

A decentralized exchange is one where a smart contract sits in between the two parties, rather than a company or an individual. So if I want to understand the dynamics by which my exchange is taking place, the fees being charged by the DEX and so on, I can look at the code of the smart contract, which sits on the Ethereum blockchain and is publicly accessible to anyone.

An AMM is a specific kind of exchange — it is an innovation made possible by smart contracts, and it differs quite radically from the order book exchange model used in most traditional exchanges. We won’t go into order book mechanics in any detail here, but google should be able to help you if you’re curious.

The mechanics of the AMM are where liquidity pools come into play. In order for someone to swap, say, ETH for DOGE on an exchange, there must be some DOGE for them already on the exchange, and somewhere for their ETH to go. A liquidity pool is that place — it’s a pool made up of ETH and DOGE, in more or less equal quantities, of sufficient volume to allow people to trade freely back and forth without massive price swings.

So each of these AMM DEX’s has a whole bunch of these pools for the different cryptocurrencies out there. The most popular such DEX on the Ethereum network at the moment is Uniswap, and you can see their list of liquidity pools below or here.

Liquidity pools on Uniswap V2

Uniswap charges a small trading fee (usually 0.3%) every time you use their exchange to swap one crypto for another, and a portion of this fee gets paid to all of the liquidity providers in the relevant pool. So the incentive for providing liquidity to a pool is the fee you can earn by doing so.

However, there is also a risk attached! If you provide liquidity to a pool with two volatile cryptocurrencies, say DOGE and ETH, then the value of your investment can go up or down as the relative value of the two coins changes. And (this is the important part) it can go up or down by more than just the change in the prices of the two respective coins. This is called ‘impermanent loss’, and it works like this: if the price of DOGE were suddenly to spike up relative to ETH, then that would almost always coincide with a spike in demand for DOGE. So traders would be taking DOGE out of the pool and putting ETH in. So as a provider of liquidity, you’re now part owner of a pool that has more ETH and less DOGE, at a time when DOGE is increasing in value. This is what we mean when we say you’re ‘on the wrong side of the trade’!

A great place to track the relative performance of different liquidity pools is apy.vision. They show the overall performance, taking into account price movements, fees earned, and impermanent loss.

APY.vision — great for analysing the performance of liquidity pools

If you’re new to liquidity pools and relatively new to crypto, one way to avoid (most) impermanent loss is to invest in stablecoin liquidity pools. In other words, you provide liquidity to a pool which contains two stablecoins, both of which are pegged to the USD. You might have to accept lower fees, but you’ll sleep easier at night.

So, how did I initially go about this? As mentioned in my last post, I’d pulled some money out of my unexpected Numeraire windfall, and I was now looking for a place to put it to earn some form of yield. I was pretty gung-ho at the time (plus the high gas fees were driving me to avoid making lots of different small transactions), so I put almost the entire amount into one liquidity pool on Uniswap (let me be clear, I am NOT recommending this!).

I first looked on zapper.fi (a great defi dashboard where you can both track your different defi investments, and also transact directly into third party protocols). I used their ‘Pools’ tab to identify that the ETH-MATIC pool on Uniswap had both a good return and a decent amount of volume in it (the relatively high volume reassured me that MATIC wasn’t some kind of strange and completely untested coin).

Zapper.fi — gives you an overview of your DeFi investments and ways to transact directly with protocols

I then used Zapper itself to invest directly into the pool. The advantage of this is that Zapper looks to minimize the number of transactions that you have to perform to get into a pool. In my case there were just two transactions needed — firstly to approve Zapper to spend my Numeraire (this cost $6.44), and then a second transaction to swap my Numeraire into 50% ETH and 50% MATIC, and then deposit those amounts into the pool (this one cost $84.33!).

So there you go, I was invested in an ETH-MATIC liquidity pool on Uniswap, earning fees but also quite exposed to price movements in these two relatively volatile cryptocurrencies. But there was one more thing I could do to earn further yield on my invested crypto, and that involves something called liquidity mining, which is what we will discuss in my next post — follow me to stay tuned!

Got any questions or comments? Pls post below — keen for this to be a two way conversation!

--

--

Richard Jamieson

I’m an Electrical Engineer with a wide-ranging career as an investment banker, leadership consultant, entrepreneur and developer.