Understanding the XYK model of pooled liquidity

Ryan Tian
Ryan Tian
Jan 2, 2020 · 3 min read

This article is mainly for the educational purpose for the FinNexus team as well as for the DeFiers to better understanding and discussing the liquidity pool model, and hopefully will intrigue some innovative ideas to be built upon.

Special thanks to the following articles for the inspiration. 1 2 3 4

Understanding the XYK model of pooled liquidity

This article is mainly for the DeFiers to better understanding and discussing the liquidity pool model, and hopefully will intrigue some innovative ideas to be built upon.

The XYK liquidity pool model, controlled by smart contracts in ETH, is becoming more popular among the DEX related projects, and it greatly enhances the liquidity of the transactions, representing by Bancor and Uniswap. Thorchain, as the so-called cross-chain Uniswap, is planning to launch the DEX early next year, with the unique Rune token model involved in the transaction mechanisms.

However, as shown by both Uniswap and Thorchain, the liquidity provider will suffer from something called the ‘impermanent loss’ phenomenon. The ‘impermanent loss’ isn’t the case that the ‘book loss’ occurs, when you buy a certain company’s listing shares from some stock exchanges and won’t sell it when the market price goes down while hoping it moves up again later. However, ‘impermanent loss’ is a phenomenon that happens to the liquidity provider in the XYK model when the price moves away from the one when the liquidity is provided in the pool.

Understanding the ‘impermanent loss’ in XYK Model

The XYK Model is also called the “x*y=k market maker”. The idea is that you have a contract that holds x coins of token X and y coins of token Y, and always maintains the invariant that x∗y=k for some constant k. Anyone can buy or sell coins by essentially shifting the market maker’s position on the x*y=k curve as below; if they shift the point to the right, then the amount by which they move it right is the amount of token X they have to put in, and the amount by which they shift the point down corresponds to how much of token Y they get out.

Phoenix Finance

Phoenix Finance