On this article we will likely be discussing a brand new class of DeFi primitives which we’ve got outlined as Liquidity Bushes. These primitives function the core function behind the soon-to-be launched Pachira token supported by SYS Labs.
I’ve been eagerly ready a few yr to put in writing about this subject because it was first conceptualized (ie, June 2023). Previous to that, myself and cyotee (ie, Liquidity Tree co-inventor and former lead dev from OympusDAO) spent a few year-and-a-half prior doing a a lot exploratory work (ie, since early 2022). So in all, it’s been almost 2.5 years of research and growth.
In my ETHDenver 2024 speak, which might be thought of our first formal public debut of this primitive, I proclaimed that Liquidity Bushes will outline the subsequent epoch within the evolution of DeFi. I observed that a few others in the neighborhood picked this phrase out of the speak and ran with it in numerous tweets and on-line discussions. I discovered this considerably attention-grabbing, as a result of once I understand this concept, that’s the way in which I have a look at it. Therefore, as my first introductory article on Liquidity Tree primitives, I believed this is able to be enjoyable approach to pierce into this new and thrilling idea. I used to be cautioned by different members of my group at SYS Labs to maintain this text excessive stage, therefore this would be the intension as step one in chronicling this out.
The DeFi story actually begins with a 2016 Reddit publish by Vitalik Buterin (ie, the founding father of Ethereum), the place he proposed his uncooked thought of the automated market maker (AMM). A yr later, Hayden Adams started engaged on turning this concept right into a practical product and based Uniswap.
2.1 First Era AMMs: Fixed Product Market Maker
An AMM protocol is the mechanism utilized by decentralized exchanges (DEXs) and was first launched by Uniswap, which was launched on the Ethereum mainnet in November 2018. These DEXs include liquidity swimming pools (LPs) represented by numerous buying and selling pairs (eg. ETH/USDC, ETH/WBTC, and many others.) appearing because the AMM. Trading exercise inside these LPs are ruled by way of sensible contract via the fixed product buying and selling (CPT) system (ie, xy = ok).
2.3 First Era AMMs: Fixed Imply Market Maker
In Sept 2019, Balancer Labs revealed their whitepaper detailing the fixed imply market maker, and was launched in March 2020. This may be successfully seen as an extension of the fixed product market maker thought to incorporate liquidity swimming pools with N belongings (ie, (x0*x1* … *xN)^(1/N)=ok ) with arbitrary weights.
2.4 Second Era AMMs: Hybrid-CPMM
The primary wave of improvements introduced points reminiscent of slippage, impermanent loss, and capital effectivity. Therefore, with the appearance of crypto summer season of 2020 started a brand new era of AMMs with the introduction of Curve’s Stableswap. That is the place that they had the perception of mixing the fixed imply market maker (CMMM) and fixed sum market maker (CSMM) right into a Hybrid-CPMM. The CSMM has the attribute of manufacturing little slippage throughout trades, whereas the CMMM ensures that there’s sufficient depth out there to facilitate the commerce. Therefore, Stableswap’s resolution is most fascinating for buying and selling of steady tokens (eg, USDC, USDT) as supplies a extremely environment friendly mechanism to mitigate slippage whereas guaranteeing environment friendly liquidity provision.
2.4 Second Era AMMs: Digital Automated Market Maker
Impressed by first era AMMs like Uniswap coupled with the concept of making artificial belongings with Synthetix, Perpetual Protocol launched the Digital Automated Market Maker (vAMM) in December 2020. Slightly than swapping the precise asset, vAMMs are used to swap digital belongings reminiscent of spinoff contracts. By using digital belongings, vAMMs present extra capital effectivity and higher pricing than first era AMMs.
2.4 Second Era AMMs: Lesser identified primitives
There are different second era AMMs value honorable point out, all addressing points with impermanent loss and capital effectivity. Bancor launched automated token buying and selling and Single-Sided Staking. Sushiswap launched the idea of liquidity mining. Additionally throughout this era we’ve got the appearance DEX aggregators like 1Inch, Paraswap and OpenOcean.
2.4 Third Era AMMs: Concentrated Liquidity Market Maker
In Could 2021, Uniswap launched V3 as an improve to handle the lazy liquidity downside, thus introducing the concentrated liquidity market maker (CLMM) protocol. The principle thought behind this improve was to pay attention the liquidity inside the the lively buying and selling band, which nearly deepens the order e-book to make extra liquidity out there for buying and selling; see Fig 1 for extra element. This protocol was arguably the primary to handle market effectivity via the AMMs liquidity frequency distribution.
In our ETHDenver speak, we started discussing how the inactive capital inside Uniswap V2, generally known as Lazy Liquidity, which sits outdoors the lively buying and selling vary, doesn’t earn yield. That is what’s generally known as poor capital effectivity. Uniswap V3 addresses this difficulty by adjusting the liquidity frequency distribution by concentrating liquidity round its lively buying and selling area (Pa, Pb) as proven in Fig 1. By doing this, the order e-book inside the liquidity pool (LP) is deepened nearly, thus offering extra capital to make bigger trades. That is illustrated with the shifting price curve in Fig 2. In accordance with Uniswap, this design enhancement can present up to 4000x capital effectivity relative to Uniswap V2.
Within the earlier part we chronicled a short overview of the evolution of the AMM protocols. The unifying attribute that each one the aforementioned have is that they’re all single AMM protocols. On this part, we’re going to be speaking about Networks of AMMs, or AMM Nets for brief. When enshrined into contract code, AMM Nets open a pandoras field of alternatives, as all of the aforementioned protocols talked about inside the final part might be configured into an AMM Web. Liquidity Bushes might be thought of the only class of AMM Nets, and we will likely be highlighting some great benefits of such on this dialogue.
If we revisit concentrated liquidity distribution of Fig. 1, the query that we want to tackle is how does one make use of the capital outdoors the lively the lively buying and selling band in order that it’s concurrently incomes a return; see Fig 3. We name this inactive area, stagnant liquidity.
If we reference Fig 3, we tackle the problem of treating the remaining liquidity outdoors the lively buying and selling band because the stagnant liquidity downside. Not like addressing this difficulty utilizing a single LP, as referenced all through the evolution of the AMM, we tackle the issue utilizing networks of LPs, referred to as Liquidity Bushes.
3.1 Let’s embody a brand new dimension (essential for understanding)
I’ve been advised by many degens that greedy this idea might be tough. Nonetheless, I implore you to not skim over this significant step, and take the required pause and take into consideration what we’re doing right here. Should you can conceptually grasp this half, and (extra importantly) why we’re doing it, then extending the answer into extra common representations is merely step and repeat. So let’s take the widespread CPT xy price curve, proven in Fig 2, and lengthen by together with a brand new dimension as proven in Fig 4.
As a substitute of pondering when it comes to x and y, like we’d with the usual CPT system, we are actually pondering when it comes to x, y and listed x, in any other case generally known as ix. Once we say indexing, we use the financial definition, which is compiled financial knowledge right into a single metric or measurement. Within the case of Liquidity Bushes, our financial knowledge is a amount of LP tokens, measured when it comes to both one of many two belongings (x or y) as proven in Fig 5. For example, say we’ve got a USDC/ETH LP and take 10 LP tokens from that pool. We index these 10 LP tokens when it comes to USDC or ETH within the type of index tokens outlined as iUSDC or iETH. Subsequently, because the price of USDC/ETH modifications, the portions of iUSDC or iETH modifications as effectively!
Addressing the CPT indexing downside sometimes entails fixing a linear system of equations, and you may learn extra about that downside in a earlier article of mine titled: The Uniswap Indexing Drawback. On the time after we launched this text final yr, it was just about crickets from the group as a result of we hadn’t revealed the gravitas behind it, till now. With out defining and addressing that downside first, we can not implement a Liquidity Tree.
So let’s recap; to create a Liquidity Tree, we have to take the 2 LP belongings (eg, x and y) and a amount of LP tokens from its pool and index them into both ix and/or iy. These index tokens are derived from our LP tokens, that are frequently rebased into portions of x and/or y, which are referred to as continuous rebased index tokens (CRITs). These CRITs are positioned again available on the market to kind a baby LP, and are paired again with one of many unique belongings x or y from our father or mother LP; for instance see Fig 4.
Fig 4 depicts probably the most rudimentary of Liquidity Bushes referred to as a Easy Tree, which consists of 1 father or mother and one baby LP. If we index x as ix and pair with x, we are able to signify as curves on the x-y airplane for the father or mother LP and on the ix-x airplane for the kid LP. Likewise, we are able to additionally signify as a computational tree, the place nodes signify LP operations and arcs between the nodes signify listed liquidity transiting from the father or mother to the kid LP.
3.2 Why embody these new dimensions?
The quick reply as to why we embody these new dimensions is to earn increased yield from our funding. Once we make investments right into a LP, we obtain LP tokens and count on to earn a return from that funding by accumulating a share of the buying and selling charges that accrues over time. With a Liquidity Tree, we now have the choice of minting index tokens from our invested LP tokens and reinvesting them into the kid LP. With this method, our funding is now making a return each from the father or mother LP and from the kid LP, thus producing increased yield. We’re successfully investing into an LP, taking a completely collateralized mortgage from that funding and reinvesting it. Subsequently incomes yield from each our unique funding and the totally collateralized mortgage. For the instinct behind this concept, see Fig 6.
A few of chances are you’ll be questioning, isn’t the DeFi group doing this with DeFi yield farming? In a spherical about method, sure however technically no. With Liquidity Bushes, we’ve got formalized this course of and have enshrined it into contract code by using CRITs, that are made potential by way of fixing the indexing downside. Therefore finish customers don’t have to manually handle the positions, which in flip liberates liquidity suppliers to do extra subtle issues, and in addition permits designers to construct extra subtle merchandise. As we are going to present in later articles, with our soon-to-be launched Pachira token, this opens a pandoras field of DeFi merchandise that weren’t made potential earlier than as decentralized institutional know-how. Therefore, introducing new emergent results which have the potential to reshape real-world human sociological habits.
We will see that through the use of Liquidity Bushes, we’ve got addressed the stagnant liquidity downside, as outlined in Fig 3. With this course of now formalized, we enhance market effectivity. So in brief, as we outlined within the evolution of the AMM, as a substitute of addressing this downside utilizing single LPs, we tackle it utilizing networks of LPs referred to as Liquidity Bushes. Since we’re the primary to formalize this class of AMM Nets, we aren’t simply speaking a few single new DeFi primitive, however a new class of DeFi primitives which is able to outline the subsequent epoch of DeFi.
3.3 Full Tree
If we increase on the Easy Tree thought mentioned within the earlier part, Liquidity Bushes might be represented as computational graphs the place nodes denote LP operations and arcs signify listed capital transitioning between the father or mother node and the kid. Since there are numerous forms of LPs utilized in DeFi (eg, fixed weighted product, composable steady, and many others.), for the sake of scope, we are going to solely cowl the CPT LP.
For a LP of belongings x and y, the utmost mixtures of kid markets that may be fashioned are ix-y, ix-x, ix-iy, x-iy, and y-iy. A full Liquidity Tree is when all potential asset mixtures are utilized, forming the utmost variety of baby LPs beneath the father or mother; seek advice from Fig. 7 for a visible illustration.
Utilizing different asset mixtures, derivations of the complete tree from Fig 7 can be created into numerous sub-trees; see Fig 8. Simulations have proven us that every of those sub-trees have barely completely different nuanced properties which we are going to focus on in future articles.
On this part we present simulation output utilizing ETH/USDC price knowledge as our enter from Jan 2017-Nov 2023. We ran this on a Uniswap V2 Left-tree setup; see Fig 9.
The swap, deposit and withdraw quantities include random non-deterministic samples taken from a Gamma distribution, thus no two simulation runs will produce the identical output. To make sure robustness, we ran our simulation via 100 trials and took the medians of the outcomes as displayed in Desk 1.
You will need to be aware that there’s an higher sure to the variety of minted index tokens that may be deployed into the Liquidity Tree baby markets. For example, if the market cap of our father or mother pool is $1M USD, then we’ve got entry to a most of $1M USD that may be minted for index tokens. Nonetheless in actuality, it’s extremely inconceivable {that a} tree’s father or mother LP could have 100% of its capital deployed into index tokens, as as soon as capital is minted, then it’s not out there for buying and selling. At this stage, we’re presuming that it a father or mother LP could have 10–70% of its capital deployed into index tokens. Which is why we’ve got depicted the purple planes of the kid LPs in Fig 9 to be significantly smaller than the inexperienced airplane of the father or mother LP. Subsequently, after we ran these simulations, we conservatively assumed that solely 25% of the capital within the father or mother LP was deployed into the kid LPs, as indicated within the first row of Desk 1.
An attention-grabbing function worthy of debate is that APY inside the youngsters is at all times discovered to be constantly increased than APY of the father or mother. We discovered this to be the case, irrespective of what number of instances we ran the simulation, what price samples had been used, or tree configuration employed. This has to do with how the price of index tokens within the baby LPs reply to the price of the native tokens inside the father or mother LP. It is because the volatility of the asset costs within the baby LPs is extra exacerbated than the volatility of the asset costs within the father or mother LP. Thus increased volatility within the baby belongings costs presents arbitrage alternatives that get crammed by opportunistic brokers (eg. buying and selling bots).
One other attention-grabbing function value noting is as a result of we see increased volatility in baby LP asset costs, it’s not essential to mint a big portion of the capital as index tokens to comprehend a big efficiency increase. That is supported by the simulation outcomes offered in Desk 1. Right here we see that with solely 25% of father or mother capital deployed as index tokens, an 89.4% efficiency increase is obtained from the youngsters. Extra particularly, our outcomes present we obtain a 3.39% annual share yield (APY) from the father or mother, and a system-wide 6.05% APY from the tree as an entire.
We started this text with a preamble adopted by a abstract of the evolution of the AMM. We concluded that up up to now, the unifying attribute that each one these AMMs have is that they’re all single LP protocols. Subsequent, we discover the concept of the AMM Web which is a community of AMMs enshrined into contract code. Inside this new class of DeFi primitives, Liquidity Bushes might be thought of the only of such.
We outline the stagnant liquidity downside, and present how Liquidity Bushes addresses this difficulty as evidenced via simulation. Liquidity Bushes are a superb method to enhance market effectivity, thus incomes a better return on capital funding, as proven in Desk 1. Liquidity Bushes liberate liquidity suppliers and designers to deploy extra subtle DeFi methods and protocols, which we will likely be discussing with the soon-to-be launched Pachira token within the upcoming months. With this, we imagine this may also invoke emergent sociological habits on the institutional stage, which would be the topic of a lot research inside SYS Labs within the years to return.
As soon as the indexing downside is solved for a given AMM, it may be deployed right into a Liquidity Tree. At the moment, we’ve got solved the indexing issues for the Mooniswap, Uniswap V2 and V3 protocols. Thus far, we’ve got solely mentioned this brazenly with Uniswap V2 and will likely be delving deeper into this within the upcoming future. We plan on releasing the python code to the Liquidity Tree simulator inside the coming months. Within the meantime, readers may checkout DeFiPy which the suite of python instruments that our simulator will depend on.
In abstract, we’ve got offered a brand new class of DeFi primitives referred to as Liquidity Bushes which is able to outline the subsequent epoch of DeFi. It is a high-level introductory article, and we plan on discussing extra in-depth technical components of this subject in future articles to return. If you wish to keep up-to-date with this thrilling undertaking, you possibly can go to the Pachira undertaking web site, or comply with me on Twitter/X!