decentralized finance – Finematics https://finematics.com decentralized finance education Tue, 05 Jan 2021 13:31:04 +0000 en-GB hourly 1 https://wordpress.org/?v=5.8.1 https://finematics.com/wp-content/uploads/2017/09/cropped-favicon-32x32.png decentralized finance – Finematics https://finematics.com 32 32 History Of DeFi – From Inception To 2021 And Beyond https://finematics.com/history-of-defi-explained/?utm_source=rss&utm_medium=rss&utm_campaign=history-of-defi-explained&utm_source=rss&utm_medium=rss&utm_campaign=history-of-defi-explained https://finematics.com/history-of-defi-explained/#respond Mon, 04 Jan 2021 19:32:53 +0000 https://finematics.com/?p=1198

So what’s the story behind Decentralized Finance? How has all of this started? What happened in DeFi in 2020? And where are we going in the future? You’ll find answers to these questions in this article.  

Let’s start from the beginning. 

Although there is no one agreed-upon date when decentralized finance was born, there were a few important events that made DeFi possible. 

Bitcoin 

The first of them was the creation of Bitcoin in 2009 by Satoshi Nakamoto. 

Despite whether Bitcoin should be classified as DeFi or not, its inception was the key enabler for the whole cryptocurrency industry which decentralized finance is part of. 

Bitcoin also allows for sending payments around the world in a decentralized fashion and payments is one of the areas of finance – looks like DeFi to me. 

But most importantly, Bitcoin enabled the creation of Ethereum – a default blockchain for all top DeFi protocols. 

Ethereum

Although sending Bitcoin around the world is cool – finance doesn’t stop there. Every robust financial system needs a set of other important services such as lending, borrowing, trading, funding or derivatives. 

Bitcoin, with its simple and limited language called Script, was just not suitable for these kinds of applications. Script’s limitations were one of the most important factors that contributed to the creation of Ethereum by Vitalik Buterin. 

Ethereum launched in 2015 and quickly started attracting more and more developers who wanted to build all kinds of decentralized applications – ranging from games, such as CryptoKitties, to financial applications. 

Ethereum, with its Turing-complete programming language Solidity and the ERC20 standard for creating new tokens, quickly became a go-to smart contract platform to build on.

Maker

This leads us to one of the oldest DeFi projects on Ethereum – Maker.

Maker is a protocol that allows for creating a decentralized stable coin – DAI. The project was formed in 2014 by Rune Christensen who was inspired by another project BitShares – a blockchain created by Dan Larimer.

Development of Maker was funded by Venture Capital and was eventually launched at the end of 2017. The first iteration of the protocol – Single Collateral DAI – supported only ETH as collateral. This was later expanded to Multi Collateral DAI that was launched at the end of 2019. 

Maker remains one of the most important projects in DeFi and is clearly one of the early pioneers of the whole decentralized finance space. 

EtherDelta

Another project worth mentioning that was really popular in 2017 was EtherDelta. 

EtherDelta was one of the first decentralized exchanges built on Ethereum that allowed for a permissionless exchange of ERC20 tokens. 

The exchange was based on an order-book. As we know, building order-book exchanges on layer 1 is hard and usually results in poor user experience. Despite that, EtherDelta was one of the most popular exchanges for trading different ERC20 tokens, especially during the ICO era. 

Unfortunately, the exchange was hacked at the end of 2017. The hacker gained access to EtherDelta frontend and proxied the traffic to a phishing site – scamming the users for around $800k. 

On top of this, the founder of EtherDelta was charged by the SEC for running an unregulated security exchange in 2018. Which was pretty much a nail in the coffin.

ICOs

Also during 2017, one of the first big use cases for Ethereum – ICOs – became prevalent. 

New projects, instead of raising money using traditional methods, started offering their own tokens in exchange for ETH. Although the idea of decentralized fundraising was not bad in theory, it resulted in multiple overhyped projects raising way too much money without anything to show besides a few pages of a whitepaper. 

In the plethora of ICOs, there were also a lot of projects that we’d today classify as DeFi. 

Some of the most notable DeFi projects from the ICO era were:

  • Aave – lending and borrowing 
  • Synthetix (previously known as Havven) – a liquidity protocol for derivatives 
  • REN (previously Republic Protocol) – a protocol for providing access to inter-blockchain liquidity 
  • Kyber Network – an on-chain liquidity protocol 
  • 0x – an open protocol that enables the peer-to-peer exchange of assets
  • Bancor – another on-chain liquidity protocol

It’s interesting to see that despite the bad reputation of 2017 ICO mania, some of the projects that emerged back then are now considered the top protocols in DeFi. 

One of the main breakthroughs at that time was the idea of users interacting with smart contracts containing pooled funds from multiple users, rather than interacting directly with other users. 

This basically created a new “user-to-contract” model that was more suitable for decentralized applications as it didn’t require as many interactions with the underlying blockchain as the user-to-user model. 

After the ICO mania was over and the bear market kicked in, DeFi experienced a relatively quiet period – at least this is how it looked from the outside. In reality, behind the scenes, major DeFi protocols were being built. 

I usually call this period of time “Before COMP”.

We’re going to learn later why Compound’s COMP token liquidity mining was a major breakthrough in DeFi. 

Before we get to this, let’s first explore a few other important protocols and events that happened during that seemingly quiet period of time. 

Before COMP

On the 2nd Nov 2018, the initial version of Uniswap was published to the Ethereum mainnet. This was the culmination of over a year’s worth of work by its creator Hayden Adams. 

Uniswap is clearly one of the most important projects in the DeFi space. In contrast to EtherDelta, Uniswap was built on the concept of liquidity pools and automated market makers. Leveraging again the previously discussed user-to-contract model. 

The first version of Uniswap was entirely funded by a grant from the Ethereum Foundation. 

In July 2019, another important event happened. Synthetix launched the first liquidity incentive program – a mechanism that later became one of the key catalysts for the DeFi Summer of 2020. 

Also, multiple other DeFi projects launched their protocols on the Ethereum mainnet between 2018 and 2019. These included Compound, REN, Kyber and 0x.

Black Thursday

On 12th March 2020, the price of ETH sharply dropped by more than 30% in less than 24 hours as a result of fears over the global pandemic. 

This was one of the biggest stress tests for the still-nascent DeFi industry. The Ethereum gas fees raised dramatically to over 200 gwei (which was really high at that time) as a result of multiple users trying to increase their collateral in various loans or trying to trade between different assets. 

One of the most affected protocols by this event was Maker. The wave of liquidations caused by users’ ETH collateral losing value resulted in the Keeper bots – external players responsible for liquidations – being able to bid 0 DAI for the auctioned ETH collateral. This led to a shortfall of around $4M worth of ETH that was later accommodated by creating and auctioning additional Maker’s MKR tokens. 

In the end, even though events like Black Thursday can be quite severe, they usually result in the strengthening of the whole DeFi ecosystem making it more and more antifragile. 

This brings us to the major period of DeFi growth also called the “DeFi Summer”. 

DeFi Summer

The main catalyst for DeFi Summer was the liquidity mining program of COMP tokens launched by Compound in May 2020. 

DeFi users started being rewarded for lending and borrowing on Compound. The extra incentives, in the form of COMP tokens, resulted in supply and borrow APYs for different tokens going up dramatically. This also enabled the development of yield farming as users were incentivised to keep switching between borrowing and lending different tokens to achieve the best yield possible. 

This event also initiated a wave of other protocols, distributing their tokens via liquidity mining and creating more and more yield farming opportunities. 

It also created Compound governance, where users with COMP tokens could vote on different proposed changes to the protocol. Compound’s governance model was later reused by multiple other DeFi projects. 

This brings us to another major DeFi protocol – Yearn Finance. 

Yearn, developed by Andre Cronje in early 2020, is a yield optimiser that focuses on maximising DeFi capabilities by automatically switching between different lending protocols.

To further decentralize Yearn, Andre decided to distribute a governance token – YFI – to the Yearn community in July 2020.

The token was fully distributed via liquidity mining – no VCs, no funder rewards, no dev rewards. This model attracted a lot of support from the DeFi community, with money flowing into the incentivised liquidity pools topping $600M in locked value. 

The token price itself started its parabolic run from around $6 when it was first listed on Uniswap, to over $30,000 per token less than 2 months later. 

Like with pretty much all groundbreaking projects in DeFi, Yearn’s success was quickly followed by multiple other teams launching similar projects with a few minor alterations. 

Another project that started gaining more and more traction, thanks to its unique elastic supply model, was Ampleforth.

This model was very quickly borrowed and reiterated on by another DeFi protocol – Yam. 

Yam, after only 10 days of development, was launched on the 11th of August 2020.

YAM tokens were distributed in the spirit of YFI and the protocol quickly started attracting a lot of liquidity.

The protocol aimed at building interest in strong DeFi communities by rewarding holders of COMP, LEND, LINK, MKR, SNX and YFI for staking their tokens on the Yam platform.

Just one day after the launch, with $0.5B of total value locked in the protocol, a critical bug in the rebase mechanism was found. The bug affected only a portion of liquidity providers in one of the pools – yCRV-YAM – but this was enough for people to lose interest in Yam despite their later attempts to relaunch the protocol.

Then comes SushiSwap. Launched at the end of August 2020 by an anonymous team, the protocol introduced a new concept of a vampire attack that aimed at syphoning liquidity out of Uniswap. 

By incentivising liquidity providers of Uniswap with Sushi tokens, SushiSwap was able to attract as much as $1B of liquidity. 

After some drama with the main SushiSwap developer ChefNomi selling his entire stake of SUSHI tokens, the protocol was eventually able to migrate a lot of Uniswap’s liquidity onto their new platform. 

During the DeFi Summer, there were a lot of other projects of varying quality being launched. Most of them were just iterations of existing open-source projects trying to benefit from the over-exuberance in a completely new industry. 

Following Yam and Sushi, there was a bunch of other projects named after different kinds of foods being launched. We had Pasta, Spaghetti, Kimchi, HotDog and others – collectively named as food defi or food finance. Pretty much all of them failed after a day or two of interest. 

One of the last major events of DeFi Summer was the launch of the Uniswap token – UNI. All the previous users and liquidity providers of Uniswap were rewarded with a retrospective airdrop worth well over $1k. On top of that, Uniswap started its liquidity mining program across 4 different liquidity pools and attracted more than $2B in liquidity. Most of which was taken back from SushiSwap.

During DeFi Summer all of the key DeFi metrics improved dramatically. 

Uniswap’s monthly volume went from $169M in April 2020 to over $15B in September 2020. A massive increase of almost 100x.

Total value locked in DeFi went from $800M in April to $10B in September. An over 10x increase. 

The amount of Bitcoin moved to Ethereum went from 20,000 in April to almost 60,000 in September. A 3x increase. 

DeFi Winter

DeFi’s parabolic ascent was, of course, not sustainable long term. The market sentiment quickly changed at the beginning of September 2020. Major DeFi tokens started sharply losing their value. The yields from liquidity mining that are derived from the value of the distributed tokens also became lower and lower. The DeFi Winter has come.

The negative sentiment lasted throughout September and October despite the DeFi ecosystem still being very active with developers continuing to build new DeFi protocols. 

The DeFi market finally found its bottom in early November with some of the top DeFi protocols trading 70-90% lower than their all-time highs just a couple of months earlier.

After a quick rebound of more than 50% the DeFi market started trending up again. 

Interestingly, during the DeFi Winter, the Uniswap volume still remained much higher than it was in early 2020. Also, the total value locked in DeFi kept trending upwards topping $15B at the end of the year. 

This was all despite multiple hacks that haunted the DeFi industry throughout 2020 – bZx, Harvest, Akropolis, Pickle, Cover to name just a few.

At the end of 2020 with Bitcoin breaking its previous 2017 all-time high, it looks like DeFi is preparing for another parabolic run. 

Future

Looking further into 2021 and beyond, the future of DeFi is bright. 

DeFi developers keep building new innovative projects. 

Much needed scaling is also coming in the form of Ethereum 2.0, layer 2 solutions and even other blockchains. This will allow for a new set of users to start participating in DeFi. It will also help with discovering new use cases that were previously just not possible due to high network fees. 

Bringing new, more traditional assets into DeFi by either tokenizing them or creating their synthetic versions will also open up completely new opportunities. 

Competition between DeFi on Layer 2, DeFi on Ethereum 2.0, DeFi on Bitcoin and DeFi on other chains will also play a big role. Interoperability protocols and cross-chain liquidity may become really important.

Other areas, such as credit delegation and undercollateralized or non-collateralized loans, are also being explored. 

This will all become clear in 2021 and beyond. 

So what is your favourite part in the history of decentralized finance? Where do you think this space is going in 2021? 

If you enjoyed reading this article you can also check out Finematics on Youtube and Twitter.

]]>
https://finematics.com/history-of-defi-explained/feed/ 0
How does Ampleforth work? AMPL Explained https://finematics.com/ampleforth-explained/?utm_source=rss&utm_medium=rss&utm_campaign=ampleforth-explained&utm_source=rss&utm_medium=rss&utm_campaign=ampleforth-explained https://finematics.com/ampleforth-explained/#respond Mon, 27 Jul 2020 13:41:15 +0000 https://finematics.com/?p=801

Intro

What is Ampleforth? How does it work under the hood and why do the number of my AMPL tokens keep changing every day? You’ll find answers to these questions in this article.

What is Ampleforth?

Okay, so what is Ampleforth all about?

Ampleforth, in essence, is a new cryptocurrency with a quite unique feature – its supply is elastic and can change every day while the ownership of the AMPL tokens is never diluted. Let’s explain what this actually means.

When it comes to money, having an elastic supply allows for printing new money or removing money from the circulation depending on the demand. Fiat currencies such as the US Dollar are good examples of money with an elastic supply as the FED can decide to print more money if there is more demand for it (they can actually also decide to print it without an increase in demand, but that’s another story).

Bitcoin is quite the opposite, its supply is fixed and the only way to accommodate the increase in demand is for the price to go up. Constant price changes can be quite problematic, especially when it comes to denominating things like services, contracts or debt.

So even though elastic money supply can be quite useful to achieve price stability it comes with a certain problem – dilution.

When the FED increases the supply of dollars by printing new money that money is put into the circulation, diluting everyone else’s proportion of the total supply of dollars basically making them poorer. Ampleforth is non-dilutive. This is achieved by applying supply adjustments proportionally across everyone’s balances.

Imagine the following situation: let’s say the FED prints an extra 5% of the total supply of US dollars to meet an increase in demand. This extra 5% would be proportionally distributed across all the accounts holding USD, so if you had $1000 in your bank account, after the supply change you would end up with $1050. That scenario would make the US Dollar non-dilutive as your proportion of the overall supply of dollars would remain the same after the adjustment.

So to summarise this part. Bitcoin is inelastic and non-dilutive. Fiat money such as USD is elastic but dilutive. Ampleforth is both elastic and non-dilutive, so even though the number of your AMPL tokens can change automatically, you’ll always own the same proportion of the overall supply.

By having this unique feature, Ampleforth tries to solve the following problems:

Inelasticity Problem. Fixed-supply cryptocurrencies are vulnerable to sudden shocks in demand that make denominating things harder.

Diversification Problem. Today’s cryptocurrencies are tightly correlated. AMPL’s unique incentives, in theory, allow it to decouple from Bitcoin’s price pattern.

Let’s see how this unique feature of Ampleforth can be achieved.

How does it work?

There are 3 states that the Ampleforth protocol can be in, these are expansion, contraction or equilibrium. Before we explain how they work let’s introduce one more concept – price oracles.

Price oracles are used to provide external prices to smart contracts. There are two main functions of price oracles in Ampleforth. The first one is to provide a current exchange rate of AMPL/USD. The second one is to provide a Consumer Price Index value. The CPI is used to establish a “target price” which is a price of 1 AMPL that the Ampleforth protocol tries to aim for. The target price is currently at $1.009 and it represents the 2019 purchasing power of the US dollar as represented by CPI. The target price plays a very important part of the protocol as it is used in conjunction with the current price to determine if there should be a change in the total supply of AMPL.

Now, let’s get back to the Ampleforth states.

Expansion. In this state, the supply of AMPL tokens is proportionally increased across all the wallets holding AMPL tokens. Let’s go through a quick example.

Imagine Alice buys 1 AMPL for $1. As demand for AMPL suddenly increases, 1 AMPL is now worth $2 which is above our target price of $1.009. In this case, the Ampleforth protocol will seek a price-supply equilibrium by increasing the supply of AMPL, so Alice ends up with 2 AMPL each worth $1.

Contraction. As expected, this is the exact opposite of the expansion state. When the system is in the contraction state the supply of AMPL tokens is proportionally decreased across all the wallets holding AMPL tokens.

So if Alice buys 1 AMPL for $1 and due to a decrease in demand, the price of AMPL drops to $0.5, the system will reduce the supply of AMPL. Alice ends up with 0.5 AMPL worth $0.5 as the price of 1 AMPL reverts back to $1.

One important thing to add here is that the algorithm can only affect the supply of AMPL. It cannot, of course, dictate the price directly. It’s up to external players to notice the supply change and this should, in theory, drive the price in the correct direction.

The last state which is equilibrium is the only state where the algorithm doesn’t seek to increase or decrease the supply of AMPL. This is basically a state where there is no need to do anything as the current price is within range of the target price.

Expansion and contraction are achieved automatically by a rebase function in the protocol. Every day at approximately 2 AM UTC time the rebase function can be called. The function makes use of price oracles to get the target price and the current price of AMPL or to be precise a 24h volume-weighted average price. If the current price of AMPL is within 5% of the target price the algorithm classifies the state as equilibrium and doesn’t change the supply of AMPL. If the current price is above the target price + 5%*target price the supply expands and if the current price is below the target price – 5%*target price the supply contracts.

As an example, if the current price of AMPL is $1.10 and the price target is $1.009 the system is in the expansion state as $1.009+$1.009*5%=1.05945, and $1.10 is higher than the max price that can still qualify as equilibrium.

The percentage that is used in the rebase function is also called the equilibrium threshold and it’s one of the 2 main parameters in the Ampleforth protocol. The second parameter represents a smoothing factor also called a dampening factor.

The dampening factor is used to avoid sharp supply changes. Currently, the protocol spreads the supply change over a period of 10 days. This means that if, for example, the rebase function results in a 50% expansion that 50% would be spread over 10 days, so it would result in a 5% supply increase on the day when the rebase function is called.

The rebase function is executed no more than once every 24 hours. This operation is also stateless, meaning that the protocol has no memory of the previous day’s supply change, so it has to recompute the potential supply change every day based on the latest information.

Technology behind Ampleforth

The Ampleforth protocol is implemented as a set of smart contracts deployed to the Ethereum blockchain. The AMPL token implements the ERC-20 interface and can be easily exchanged on decentralized exchanges such as Uniswap.

According to the documentation, the protocol is chain-agnostic and AMPL tokens can exist simultaneously on multiple platforms, so there is also a chance of seeing AMPL tokens on other blockchains in the future.

Use cases

Ampleforth, in the short term, aims at diversifying cryptocurrency portfolios by being less correlated to the price of Bitcoin compared to other cryptocurrencies. In the medium term, it aims at being used as collateral in DeFi protocols. The long term goal for Ampleforth is to create an alternative to central-bank money that is adaptable to shocks.

Summary

To incentivise more on-chain liquidity, Ampleforth created an incentive program called Geyser where the liquidity providers of the Uniswap AMPL/ETH pool can stake their LP tokens on Geyser and be rewarded with extra AMPL tokens. If you’re not sure what it all means you can check out my article on liquidity pools and a link to the Ampleforth Geyser website.

When it comes to the AMPL tokens the main thing to remember is to always look at the number of tokens in addition to the price to see the full picture of your portfolio.

Ampleforth is clearly one of the most interesting projects in the cryptocurrency space right now, but we have to remember that it is still pretty much a monetary experiment that may or may not work.

So what do you think about Ampleforth? Do you think it has a chance to be used as the money of the future?

If you enjoyed this article you can check out my other articles on decentralized finance and subscribe to Finematics on Youtube.

]]>
https://finematics.com/ampleforth-explained/feed/ 0
How Do Liquidity Pools Work? DeFi Explained https://finematics.com/liquidity-pools-explained/?utm_source=rss&utm_medium=rss&utm_campaign=liquidity-pools-explained&utm_source=rss&utm_medium=rss&utm_campaign=liquidity-pools-explained https://finematics.com/liquidity-pools-explained/#respond Mon, 20 Jul 2020 11:41:54 +0000 https://finematics.com/?p=771

Intro

What are Liquidity Pools? How do they work? And why do we even need them in decentralized finance? Also, what are the differences between liquidity pools across different protocols such as Uniswap, Balancer or Curve? We’ll be going through all of this in this article.

Before we start, if you’re new to DeFi you may want to read my introduction to decentralized finance article first. Also, you may want to subscribe to Finematics on Youtube.

Liquidity Pools

Liquidity pools, in essence, are pools of tokens that are locked in a smart contract. They are used to facilitate trading by providing liquidity and are extensively used by some of the decentralized exchanges a.k.a DEXes.

One of the first projects that introduced liquidity pools was Bancor, but they became widely popularised by Uniswap.

Before we explain how liquidity pools work under the hood and what automated market making is, let’s try to understand why we even need them in the first place.

Why Do We Need Liquidity Pools?

If you’re familiar with any standard crypto exchanges like Coinbase or Binance you may have seen that their trading is based on the order book model. This is also the way traditional stock exchanges such as NYSE or Nasdaq work.

In this order book model buyers and sellers come together and place their orders. Buyers a.k.a. “bidders” try to buy a certain asset for the lowest price possible whereas sellers try to sell the same asset for as high as possible.

For trades to happen, both buyers and sellers have to converge on the price. This can happen by either a buyer bidding higher or a seller lowering their price.

But what if there is no one willing to place their orders at a fair price level? What if there are not enough coins that you want to buy? This is where market makers come to play.

In essence, market makers are entities that facilitate trading by always willing to buy or sell a particular asset. By doing that they provide liquidity, so the users can always trade and they don’t have to wait for another counterparty to show up.

Okay, so why can’t we just reproduce something like this in decentralized finance?

The answer is – we can! It would just be really slow, expensive and pretty much always result in poor user experience.

The main reason for this is the fact that the order book model relies heavily on having a market maker or multiple market makers willing to always “make the market” in a certain asset. Without market makers, an exchange becomes instantly illiquid and it’s pretty much unusable for normal users. On top of that, market makers usually track the current price of an asset by constantly changing their prices which results in a huge number of orders and order cancellations that are being sent to an exchange.

Ethereum with a current throughput of around 12-15 transactions per second and a block time between 10-19 seconds is not really a viable option for an order book exchange. On top of that, every interaction with a smart contract cost a gas fee, so market makers would go bankrupt by just updating their orders.

How about the 2nd layer scaling then? Some of the 2nd layer scaling projects like Loopring look promising, but even they are still dependant on market makers and they can face liquidity issues. On top of that, if a user wants to make only a single trade they would have to move their funds in and out of the 2nd layer which adds 2 extra steps to their process.

This is exactly why there was a need to invent something new that can work well in the decentralized world and this is where liquidity pools come to play.

How Do Liquidity Pools Work?

Ok, so now that we understand why we need liquidity pools in decentralized finance, let’s see how they actually work.

In its basic form, a single liquidity pool holds 2 tokens and each pool creates a new market for that particular pair of tokens. DAI/ETH can be a good example of a popular liquidity pool on Uniswap.

When a new pool is created, the first liquidity provider is the one that sets the initial price of the assets in the pool. The liquidity provider is incentivised to supply an equal value of both tokens to the pool. If the initial price of the tokens in the pool diverges from the current global market price, it creates an instant arbitrage opportunity that can result in lost capital for the liquidity provider. This concept of supplying tokens in a correct ratio remains the same for all the other liquidity providers that are willing to add more funds to the pool later.

When liquidity is supplied to a pool, the liquidity provider (LP) receives special tokens called LP tokens in proportion to how much liquidity they supplied to the pool. When a trade is facilitated by the pool a 0.3% fee is proportionally distributed amongst all the LP token holders. If the liquidity provider wants to get their underlying liquidity back, plus any accrued fees, they must burn their LP tokens.

Each token swap that a liquidity pool facilitates results in a price adjustment according to a deterministic pricing algorithm. This mechanism is also called an automated market maker (AMM) and liquidity pools across different protocols may use a slightly different algorithm.

Basic liquidity pools such as those used by Uniswap use a constant product market maker algorithm that makes sure that the product of the quantities of the 2 supplied tokens always remains the same. On top of that, because of the algorithm, a pool can always provide liquidity, no matter how large a trade is. The main reason for this is that the algorithm asymptotically increases the price of the token as the desired quantity increases. The math behind the constant product market maker is pretty interesting, but to make sure this article is not too long, I’ll save it for another time.

The main takeaway here is that the ratio of the tokens in the pool dictates the price, so if someone, let’s say, buys ETH from a DAI/ETH pool they reduce the supply of ETH and add the supply of DAI which results in an increase in the price of ETH and a decrease in the price of DAI. How much the price moves depends on the size of the trade, in proportion to the size of the pool. The bigger the pool is in comparison to a trade, the lesser the price impact a.k.a slippage occurs, so large pools can accommodate bigger trades without moving the price too much.

Because larger liquidity pools create less slippage and result in a better trading experience, some protocols like Balancer started incentivising liquidity providers with extra tokens for supplying liquidity to certain pools. This process is called liquidity mining and we talked about it in our Yield Farming article.

The concepts behind liquidity pools and automated market making are quite simple yet extremely powerful as we don’t have to have a centralized order book anymore and we don’t have to rely on external market makers to constantly keep providing liquidity to an exchange.

Different Types of Liquidity Pools

The liquidity pools that we just described are used by Uniswap and they are the most basic forms of liquidity pools. Other projects iterated on this concept and came up with a few interesting ideas.

Curve, for example, realised that the automated market making mechanism behind Uniswap doesn’t work very well for assets that should have a very similar price, such as stable coins or different flavours of the same coin, like wETH and sETH. Curve pools, by implementing a slightly different algorithm, are able to offer lower fees and lower slippage when exchanging these tokens.

The other idea for different liquidity pools came from Balancer that realised that we don’t have to limit ourselves to having only 2 assets in a pool and in fact Balancer allows for as many as 8 tokens in a single liquidity pool.

Risks

And of course, like with everything in DeFi we have to remember about potential risks. Besides our standard DeFi risks like smart contract bugs, admin keys and systemic risks, we have to add 2 new ones – impermanent loss and liquidity pool hacks – more on these in the next articles.

Summary

So what do you think about liquidity pools? And as always, don’t forget to subscribe to Finematics on Youtube for more DeFi content.

]]>
https://finematics.com/liquidity-pools-explained/feed/ 0