If you've bought or sold a token on Solana in the past year, it's likely that you've already interacted with Lifinity.
Lifinity is a decentralised exchange (DEX) on Solana with a very unique take on AMMs. This is a deep-dive into its working where I will attempt to explain what they do, how they do it and why you should take notice.
The essay assumes minimal prior knowledge about crypto and I’ll try to build all understanding from the ground up with plenty of links sprinkled throughout.
But, what’s special about Lifinity?
Protocol Owned Liquidity
Usage of oracles
Concentrating liquidity
Rebalancing Mechanism
What does Lifinity do?
Lifinity is a market maker. It creates and maintains trading pools for pairs of tokens. Other users can buy tokens from this pool or sell tokens to Lifinity, at the current market price for a small fee.
SOL-USDC is an example of a trading pool which allows users to purchase Sol with USDC or sell Sol for USDC.
Why is there a need for such pools
These type of pools form core DeFi infrastructure. They are sources of liquidity available 24 x 7, which are necessary for any healthy market and they act as reliable intermediaries between buyers and sellers.
In a world without such pools, if you wanted to sell your SOL for USDC. You would have had to wait until someone was ready to purchase the exact amount off you. But by then, the price might have moved. Instead with the availability of such pools, you can instantly sell your SOL to it at the current price and get USDC right away.
For providing this service and taking on the risk of holding these assets, these pools charge a fee.
The SOL-USDC pool pictured above charges a fee of 0.08% per $ of volume traded. So in the last 24 hours, it has earned 741,781*0.08% ~ $593
in trading fees.
Lifinity currently provides pools for 17 different combinations of tokens and has done over $2B in volume since inception.
Don’t trust, verify. Link to Solscan. Link to Defillama. Link to Lifinity.
If you’re already familiar with the concept of DEXs, nothing in the section above really stands out. You might be wondering —
But, what’s special about Lifinity?
So. Many. Things. But since your attention is precious, I will focus on 4 key innovations that set it apart.
Protocol Owned Liquidity to avoid needing LP deposits
Usage of oracles to reduce impermanent loss
Concentrating liquidity for higher capital efficiency
Rebalancing Mechanism for market-making profit
Protocol Owned Liquidity to avoid needing LP deposits
Traditionally, DEXs would only build out the the base program (smart contracts and a UI interface) for a trading pool and open it up to the public for deposits.
A trading pool is only as useful as the amount of trading volume it can facilitate and that is proportional to the amount of liquidity that users have deposited to the pool. Those who deposit to these pools are called Liquidity Providers (LPs).
DEXs began competing with each others to attract these LPs to their own DEX since their revenue comes from keeping a portion of the trading fees generated. The most common way to achieve this has been to offer token emissions as additional rewards for the LPs depositing.
This took the form —
Deposit your SOL and USDC into this pool to get ORCA/MNDE/RAY in addition to the trading fees you generate!
However, this was simply not sustainable.
This style of incentives resulted in mercenary-like behavior where Liquidity Providers would only offer liquidity as long as these token emissions lasted. As soon as the incentives ran out, they would move their liquidity to a pool on another DEX that offered better incentives.
Additionally, these LP providers would immediately sell the emissions they received on the market resulted in a consistent sell-pressure on the token being offered as an incentive.
This was obviously a problem but there were no solutions in sight.
Enter Lifinity.
Lifinity solved this problem by using fundraising as a way to own the liquidity that is provided to these pools. The term they use for this is POL, Protocol Owned Liquidity. This was genius because now Lifinity is no longer subject to the whims and fancies of mercenary LPs who might leave at any moment. And they also don’t need to hurt the price of their own token with token emissions. It was a one-time sale only. This has the added benefit of Lifinity being the sole provider of liquidity to its pools and earning 100% of the trading fees.
I’m leaving out a lot of detail there and you might rightly have many questions. How much did Lifinity raise? Why did people participate in the fundraise? What was Lifinity providing in lieu of token emissions? How does it all tie together?
They raised money for this protocol owned liquidity in two phases —
An NFT Collection called Lifinity Flares Raising $2.6M from a sale of 10,000 NFTs for 1.5 Sol each back in Dec 2021
An IDO for their token, LFNTY Raising $9.6M in Jul 2022
The liquidity raised from the NFT Collection is called FOL — Flare Owned Liquidity
The liquidity raised from the IDO is called POL — Protocol Owned Liquidity
But, why did people participate in this fundraise?
These fundraises were successful because of the unique revenue accrual mechanism and the fact that they were the only way to get exposure to Lifinity’s high APR pools.
For the NFT Collection, it was the perpetual buyback mechanism. The entire raise amount seeded liquidity for Lifinity’s original trading pools and 50% of the revenue that is generated, is used to purchase Flares off the market. In the last year, this has resulted in over 7% of the NFT supply being bought back creating a deflationary collection.
For the IDO, it was the promise of pereptual revenue share for holding the locked version of the token.
I’ll go into more depth on each above in a future section. But for now, lets try to understand how Lifinity extracts maximum value from the funds they raised.
Usage of oracles to reduce impermanent loss
The next key innovation was Lifinity’s usage of oracles to reduce impermanent loss. To help explain what oracles and impermanent loss are and how Lifinity uses them, I need to introduce the concept of AMMs.
Feel free to skip the following section if you already know what an AMM and its price-curve equation is.
What is an Automated Market Maker (AMM)?
AMMs are simply another name for the trading pools I mentioned at the very start of this deep-dive. They allow users to trade against the pool for a fee.
Original AMMs used x*y = k
as the price-curve equation where x is amount of token A and y is amount of token B
The equation you see above is what the AMM uses to determine the price it is willing to offer for either of its assets.
Example
Let’s say a pool contains 100 $SOL and 1000 $USDC.
According to the price-curve equation,
Imagine you want to sell 1 SOL to this pool. After you have sold it to the pool, the pool will contain 101 Sol and some amount 1000 - p USDC where p is the money that the pool gave you for the 1 Sol you gave it.
According to the price curve equation, the product of this still has to remain constant
which gives us
Which means that the price the pool offered you for your 1 Sol was 9.9009 USDC
If instead you had sold the pool 0.1 sol it would’ve offered you price equivalent to 9.99001 USDC. I will leave this as an exercise for the reader.
In the interest of the length of this deep-dive, I’ve kept this explanation brief. If this intrigues you, please visit this article with more detailed exampels — https://research.paradigm.xyz/amm-price-impact
Takeaway
This equation is how AMMs encapsulate price. They only need the amounts of tokens available in the pool and don’t require any outside information to determine what price to offer.
This concept was revolutionary when introduced. Since their introduction in 2018, AMMs are now a core piece of infrastructure in DeFi because of their simplicity. Anybody can start a trading pool between two tokens that others can trade against to generate a price for the token. You no longer needed dedicated marketmakers.
Problems with traditional AMMs
Unfortunately, providing Liquidity to AMMs is not profitable in itself because of impermanent loss.
To understand what impermanent loss is, lets continue the example from above.
Imagine you were the liquidity provider who provided the initial 100 Sol and 1000 USDC for the pool to get started.
At 100 SOL and 1000 USDC in the pool, the implied price of SOL is 10 USDC/SOL
So you put in an equivalent sum of of 2000 USDC (100SOL*10USDC + 1000 USDC)
Lets say enough trades have happened that the now only 50 SOL is left in the pool. According to the price-curve equation, there should be 2000 USDC and the implied price of SOL is 40 SOL/USDC
The pool now contains 50 SOL (=2000 USDC) and 2000 USDC for a total of 4000 USDC
Your money is now worth 4000 USDC but if instead of providing liquidity, you had just held onto your SOL and USDC, you could’ve had 5000 USDC (100 Sol * 40 USDC+ 1000 USDC )
Do you see how providing liquidity is actually a bad deal for the liquidity provider? This is called impermanent loss (or divergent loss). And it’s equally applicable even when price decreases.
To learn more, check out this medium article or this one
To counteract this, AMMs charge fees. So that even if a lot of trading happens back and forth and the price ends up where it started, the pool will have accrued fees from all the trading.
In practice, outside of a few popular pools with a lot of trading volume, the fees generated simply do not result in enough APR for liquidity providers to justify providing liquidity.
This results in an increase of fees until the pools can attract liquidity but at that point, users are better off just using a Centralised Exchange with lower fees.
Enter Lifinity.
Lifinity’s key insight was the usage of oracles to reduce impermanent loss
An oracle tells you the price of an asset at a given time. Whenever a trade is routed through lifinity, it fetches the price from the oracle at that point in time and uses that as the price-to-offer-the-trade at as compared to a CPMM which would use pool’s quantities to determine the price of the trade.
Why is this better?
For tokens with high trading volumes like SOL, BTC, ETH, the price discovery does not happen on AMMs. It happens off-chain on centralised exchanges like Binance.
What this implies is that the price-encapsulating nature of AMMs is actually a negative.
Following up on the original example, lets say the pool contained 100 SOL and 1000 USDC implying a price of 10 USDC/SOL
But lets say that the price shot up to 20 USDC/SOL on a centralised exchange, the AMM pool is actually STILL offering the price of 10 USDC/Sol and waiting for someone to come in and arbitrage the difference to move it up.
The arbitrageur is happy but as the AMM, you’re not.
On Solana, Pyth publishes the price of a token on every slot. Lifinity’s pool use this price as the one they are willing to offer to anybody selling/buying tokens from it. This means that Lifinity’s pool could still contain 100 SOL and 1000 USDC but it would be offering a price of $20 USDC/Sol instead.
This has the effect of reducing or even negating impermanent loss making providing liquidity to Lifinity’s pools actually profitable.
Concentrating Liquidity for higher capital efficiency
Another issue with traditional AMMs is high price slippage. Meaning that when you trade large sizes against an AMM, you move the price by a lot because of the price-curve equation. To move the price less, the pool needs to have a lot of liquidity but remember, providing liquidity is not inherently profitable and therefore is a hard sell.
Traditionally, the larger your TVL (total value locked/liquidity in your pool), the more volume you get because you offer better prices.
Lifinity gets around this by concentrating liquidity around the current price by modifying the price curve equation. (You can find the math in their litepaper)
This allows them to have a high volume to TVL ratio, sometimes resulting in crazy amounts of capital efficiency.
Rebalancing Mechanism for market-making profit
Concentrating liquidity comes with its own set of risks and because Lifinity owns its liquidity, it needs to be even more careful than other AMMs about leaving its pools unbalanced for long.
To minimize this risk, the protocol employs a rebalancing mechanism to keep the pool balanced. It does this by adjusting its liquidity whenever a trade occurs or a change in oracle price happens.
If token x in a pool is worth more than 50% of the pool, the algorithm decreases the available liquidity for it and increases it for the other token y. This incentivizes traders to purchase token y by selling x and therefore return the pool to 50% in value.
When you consider all the possible scenarios in which rebalancing occurs, Lifinity’s pools end up buying the dip when prices fall and take profit when the prices rise. This results in market-making profit.
The exact equation and a more succinct explanation of the rebalancing mechanism is available in their litepaper.
To recap, the following 4 ideas are what sets Lifinity apart from traditional AMMs
Protocol owned Liquidity
Oracle Usage
Concentrating Liquidity
Rebalancing Mechanism
And how have these ideas played out?
We should judge a market-maker based on the following two metrics
How much volume do they generate?
Are they profitable in the long-run?
The bear market has been rough but Lifinity has been doing well on both accounts.
Trading volume
On any given day, Lifinity consistently ranks in the top 3 DEXs on Solana by volume (Source — Jupiter Stats Page). Considering that its TVL is just a fraction of what it is for the other DEXes, this is impressive and evidence that idea behind concentrating liquidity and using the oracle has been working out.
Additionally, Lifinity recently surpassed $2B in total trading volume (Link)
Revenue
Lifinity publishes its monthly revenues from its POL liquidity on their discord (link to channel) and Twitter. Over the last 6 months, this has amounted to over 952,000 USDC
And the revenue earned by Flare Owned Liquidity is published weekly and this currently totals 11,516 SOL over the last year
How is this revenue used?
50% of the revenue from POL is used to buyback the LFNTY token and the other 50% is distributed to veLFNTY holders
50% of the weekly revenue from FOL is sent to the Buyback fund to buyback Flares and the other 50% is added to the Flare Owned Liquidity
Although the primary income stream is from its pools, it bears to mention that Lifinity also provides other services and a portion of this revenue can be attributed to them.
Here’s a list of all other income streams
MMaas (Market Making as a Service) Partnerships where protocols provide Liquidity and Lifinity market-makes with it for a fee
UXD Protocol
xLPFi
LaaS Partnershps (Liquidity as a Service) where Lifinity provides both liquidity and market-makes on behalf of other protocols
LIDO
MNDE
Providing Liquidity in NFT AMMs
Providing SOL Liquidity on Frakt Pool for Lifinity Flares
Royalties on its NFT Collection
They tried lending SOL and USDC out to other DEXs on Solana in between but after a lot of hack-scares in the year, this was stopped.
Lifinity’s Tokenomics
This deep-dive would be incomplete if I didn’t mention how Lifinity’s tokenomics work and how they use their revenue to support it.
In a world of high FDV with a low circulating supply, Lifinity’s tokenomics and the reasoning behind them were a breath of fresh air. I would recommend you read their 6-part series on Medium in their entirety (1, 2, 3, 4, 5) but here’s a shorter version.
If there’s one takeaway you should note it is that there are no constant emissions of LFNTY tokens to LP holders to create a consistent downward sell pressure that plague all other DEX tokens.
Lifinity has 3 tokens
LFNTY — This refers to unlocked LFNTY
veLFNTY — Locked version of LFNTY that grants you access to protocol revenue on a monthly basis
xLFNTY — This is 4 year locked LFNTY token
Total Supply
20M LFNTY was sold in the IDO for a total of $9.6 million. Majority of this was sold as 4 year locked veLFNTY with a starting price of 0.42
Buy Pressure for LFNTY comes from
The protocol consistently buying back LFNTY every hour from its buyback fund which is replenished monthly (Link to the buyback account)
Users who want to purchase LFNTY to lock as veLFNTY to get access to protocol revenue
Sell Pressure for LFNTY comes from
Allocation for the NFT Holders who stake
Any IDO participants that want to exit
Team’s allocation if they choose to sell
Users whose veLFNTY decays into LFNTY and are looking to exit
On Dec 31, 2022 — In the 6 months since launch, the Lifinity Buyback bot bought a total of 1M LFNTY back, which is approximately 5% of the circulating supply.
Where can you trade these tokens
You can purchase/sell them on Jupiter but the underlying markets are
Lifinity runs a LFNTY-USDC pool and xLFNTY-LFNTY pool and provides liquidity to each of them
It has also created a serum market for xLFNTY-USDC but does not provide liquidity here
Performance of the token
LFNTY is currently $0.33 from it’s starting price of $0.84
xLFNTY is currently $0.31 from it’s starting price of $0.42
If you bought $1000 worth of unlocked LFNTY at IDO, it is currently worth $402
However, the majority bought 4 year locked LFNTY at $0.42. Assuming you bought $1000 of it at IDO, it is currently worth $756 and in the 6 months since the IDO, you would’ve gotten $57 in total revenue share (simplified calculations).
Token down, token bad?
The token is down significantly, does that imply bad tokenomics? Not really. The buyback mechanism has been working as advertised. Lifinity has bought back 1M LFNTY tokens. That is almost 5% of the circulating supply.
Price being down simply implies more people want to sell than people that want to buy.
But why have people wanted to offload their LFNTY?
Reduction in the asset prices that Lifinity holds to market-make Lifinity had raise $7.3M as POL (link) from their IDO. This amount was ~$5 M a month ago (link)
Lesser APR than projected Lifinity’s SOL-USDC pools in early testing had phenomenal APR, often upwards of 100% and I suspect a lot people invested looking at that. However, other pools haven’t been able to recreate this level of APR. The combined APR has been usually around 10-20% and that’s not enough.
Inability to deploy the entire POL A significant portion of the POL is undeployed and is sitting idle because there aren’t many tokens with significant trading volume on Solana.
Reduction in DeFi volumes Solana-wide Trading volume has come down significantly in this bear market. Jupiter did 4B in volume in May and 300M in volume in December. That’s 10 times as less. This directly affects the volume that Lifinity provides.
Lifinity’s Governance Mechanism
Lifinity outlines their approach to governance in this medium article.
Their approach to governance is influenced by their desire to be nimble and move quickly by not having to put everything they do to a vote. The team decides what should and should not be put up for a vote.
Examples where team will not plan to seek input
LFNTY emission schedule
New pools to add
Adjustments to parameters like trading fees, concentration
Their explanation for this is that since the developers are intimately familiar with on-chain market data and have spent considerable time optimizing the DEX’s parameters, they are best equipped to make decisions of this type.
However, they maintain that they value user’s input and feedback in everything that they do. An example of this is how they launched the tokenomics series 1 post at a time and als in advance for flare holders and took feedback before launching it for the rest of the team.
Examples of decisions made with voting
If the Flare DAO should deposit its bought back flares into GOATSwap
What should the protocol do with the MNDE that it received through a grant?
Examples of decisions made without voting
New pools to add
Adjustments to parameters like trading fees, concentration
Buyback bot frequency
What the team should be focusing on next
Although Lifinity has a token, it does not follow a token-based governance model. This means that whales don’t have an outsized influence on the votes and the median voter gets a much higher say in what happens to the protocol. Also, there is no worry about votes not reaching the required threshold to pass. The team takes a call in such situations.
Votes are done through a discord bot that called Pollmaster. It uses emojis to keep track of the options. Voters can see the results after the poll is closed.
From what I can recall, there have not been any major disagreements. I think a lot of that has to do with the trust that the community has in the team to do the right thing. Durden makes it look easy but he does a lot of legwork before a proposal is enacted in ensure that views of the holders are considered.
The participation of the community in these polls is generally higher than it would be if these votes happened onchain. Discord is simply easier for people to use.
The Road Ahead
Lifinity is experimenting with a v2 that should do better in single-sided markets. It’s called DNMM, a delta-neutral market maker which aims to remove price exposure of the tokens held for market-making and further improve profitability. Initial signs have been promising. Link to Medium Article
When DeFi volume returns to Solana, it will be interesting to see how well Lifinity’s v2 will be able to keep up.
Why you should care
Sometimes all of crypto can feel like a ponzi and the past year has not helped. Project after project designed to fleece retail investors out of their money to fuel unsustainable growth. NFTs whose entire value proposition is hype. Trust in the Solana ecosystem is at an all-time low.
In such a world, Lifinity is a breath of fresh air.
From day zero, the focus of this project has been on profitability and ensuring that its holders are placed above everything else
They focus on profitability of the protocol over other gameable metrics like volume
They have been extremely transparent in their communication and vocal in calling out bad actors
They are pushing the crypto space forward by actually innovating on existing models
What they’re building is only possible on Solana and nowhere else
It’s hard not to root for them.
If you’ve made it this far, thank you! I enjoyed writing this deep-dive and I hope I was able to intrigue you enough to check Lifinity out.
If you notice any inconsistencies or mistakes, please do hit me up on my Twitter @adarshrao_. I would love to improve my understanding of the concepts outlined here or just answer any further questions you may have!
References
Lifinity Discord
Lifinity Medium
Lifinity Litepaper
Tokenomics Series — Part 1, Part 2, Part 3, Part 4, Part 5, Part 6
The Beacon — Latest edition of Lifinity’s monthly newsletter
Disclosure: Author own tokens and NFTs of the project mentioned in this article and has a financial interest in them succeeding.
Disclaimer: This is not financial advice and you can lose your entire investment in anything in crypto.