Written by Shao Tian
As I mentioned in my previous article “Uniswap v3 Features Explained in Depth”, liquidity provider (LP) operating strategies and LP NFT aggregation are becoming a blue ocean for emerging startups in the decentralized finance (DeFi) space.
Discover the v3 LP investment strategy holy grail. Source : uniswap.org & charm.fi
Today, we will examine the first Uniswap v3 LP strategy to go live (the first to my knowledge): the
Charm.fi is an anonymous team that has built two DeFi products: Cube Tokens, a token product, and Options, an option product.
Two days after the release of Uniswap v3 on May 5, Charm deployed its third product: the Uniswap v3 LP strategy, Alpha Vault, and it has already proven to be a great success: more than twice as profitable as the v2 LP! more than twice as profitable as the v2 LP!
No wonder there are many people flocking to the game, with its first ETH / USDC machine gun pool fully capitalized, even though there is a clear warning message on its website: the project’s code is unaudited.
Now let’s dive into Alpha Vault’s strategy and its codebase!
The understanding and explanation of this article comes from the official announcement article, its Github codebase and my chat with Charm developer mxwtnb.
Since their article already explains the product well, I will only repeat it when necessary.
The constantly changing price of token pairs in the Charm pool means that the current price will not always be in the middle of the LP’s liquidity band. Therefore, a well-designed rebalancing mechanism is at the heart of any strategy.
Alpha Vault’s approach is very simple and effective: when two assets become unbalanced and it is not possible to put them all into the machine gun pool, Vault first puts the maximum available amount of both assets into the machine gun pool, and then uses the one with the balance to put in another range order .
Let’s take an example.
Initially we have 50% of the assets in ETH and the other 50% in USDC. After a day, as the ETH price drops, we get more ETH and less USDC.
ETH price = $3000 : (50% ETH, 50% USDC)
ETH price = $2500 : (70% ETH, 30% USDC) -> all assets taken out
Now, let’s say we can enter a maximum amount of 30% ETH and 30% USDC for both of the machine gun pools within the current price range.
Vault’s job is to first withdraw all liquidity and then drop a base pool consisting of 30% ETH, 30% USDC and 30% ETH.
30% USDC and a limit/rebalance order consisting of 40% ETH, 0 USDC.
Base order: (30% ETH, 30% USDC) -> place an order at the current price range
Limit / Rebalance order: (40% ETH, 0 USDC) -> place an order in the price range ≥ current price, for example: (2500, 2600), so that ETH can be converted to USDC when the price goes up.
Allow me to shamelessly borrow an image from their article.
If ETH has a balance, put in ETH at a range value higher than the current price. Source : https://medium.com/charmfinance/introducing-alpha-vaults-an-lp-strategy-for-uniswap-v3- ebf500b67796
Likewise, if we have a USDC balance, we put the USDC balance in a range where the price ≤ current price, so that when the price drops, we can convert the USDC to ETH.
The purpose of limit/rebalancing orders is to avoid direct swapping (converting 20% ETH to 20% USDC), which would result in a transaction fee of 0.1 to 1%, and to naturally swapping by providing liquidity without spending a penny on fees, and even earning a transaction fee.
This is the reason for the “passive” rebalancing mechanism.
But in the example above where ETH has a balance there is an assumption that limit orders will only be honored if the ETH price rises – which is obviously the opposite of why we have an imbalance in assets: the latter because the ETH price fell from $3000 to $2500.
However, this assumption is very realistic, because there will always be consolidation markets.
Let’s take a look at the real market price of ETH: there are periods when there are several green bars / pull-ups in a row, but they are always followed by red bars / consolidation.
There is always a price correction. Source : tradingview.com
Well, what if the price keeps falling?
If the price keeps falling, then Vault may do nothing, which means: failure to rebalance.
LPs in Uniswap v3 may suffer greater unpredictable losses than in v2 if the wrong LP strategy is used.
Therefore, it makes sense that in some cases it is better not to take any action.
Instead, in AlphaStrategy.sol, rebalance () has two conditional checks (require ()) to determine if rebalancing is necessary.
Extreme price movements that should never happen
Too much price volatility -> Avoid manipulation of market prices before rebalancing or rebalancing during extreme market conditions
In addition to these two conditions, there is another condition (at the time I started writing this article).
Not too much price movement -> avoiding double spending Gas
According to the developers, the reason this condition is not included in the current smart contract design is that it has now been moved off-chain.
The choice between on-chain or off-chain depends on whether the condition should always be strictly adhered to: if yes, then on-chain; if ‘no’, keeping it off-chain provides better development flexibility, considering that the strategy is still in its early stages.
Low cost of Gas
According to the aforementioned developers, this feature was only recently developed and therefore fails to align with the ETH/USDC Vault already deployed to the main network.
Investors who have already tried putting liquidity into the v3 machine gun pool will no doubt already know that the fee cost of the process is not cheap.
The cost of a liquid random transaction Gas into the Uniswap v3 pool is 431,134. Source : https://etherscan.io/tx/ 0x06a01a31692fd74057caccebdf7c0449d2fbf0bcec4c67108dbaac1ef76ff642
What is the cost of Gas for a deposit to Alpha Vault? Because there is also the logic of Vault, will it be more expensive than the cost of adding liquidity to v3?
The answer is: much cheaper than adding liquidity to the v3 pool!
The cost of a stochastic trade of Gas to invest liquidity into Alpha Vault is 180,573. Please note that this transaction is in Ropsten, provided by the developer. Source : https://rinkeby.etherscan.io/tx/0x73a20b35c1598e2e891d85ab19e431251558165d13dfa166ac773505072d8fb4
Why? The reason is that depositing dollars into Alpha Vault does not lead to an increase in liquidity on v3.
Changes in liquidity will only happen on rebalancing, which means that individual users will not have to pay high Gas fees for adding and removing liquidity. The rebalancing duties are currently performed by the team’s own Keeper who recently performed the rebalancing at a twice-daily frequency.
Gas costs are low, which sounds great! But does this also mean that funds deposited in the pool by users will not be used until the next rebalancing? Yes. But adding liquidity is not like buying a 10x leveraged perpetual contract; it is usually a long-term or at least medium-term investment.
Losing a few hours of capital efficiency is not a big deal if the user plans to provide it with several months of liquidity. Plus, Gas costs less!
Tip: If you are depositing money into Alpha Vault, check the Vault’s smart contracts to see if rebalancing has just occurred. If so, then you don’t have to rush and can wait for a lower Gas price!
So, combined with the description in Section 2: Conditional Rebalancing, is it possible for funds deposited by users to sit idle for days under extreme market conditions?
The answer is still “yes”, but that’s precisely why there are conditions on whether Vault should be rebalanced: to protect users.
Access to liquidity only at the time of rebalancing
Rebalance only when needed
Swap tokens by providing liquidity, not just swapping
Before their Github codebase was opened, I had a hard time imagining that the v3 LP strategy would only require about 700 lines of code.
The team is clearly doing everything they can to minimize the complexity of the strategy, which is why I call Alpha Vault a “minimalist LP strategy”!
There are definitely more strategies coming and it is expected that many of them will also use Alpha Vault’s techniques, such as passive rebalancing techniques to avoid transaction fees.
Let’s wait and see if there is another project that can achieve the same level of performance and simplicity as Alpha Vault!
Be careful, apes!
With the above knowledge of the project, it sounds like it’s time to follow the trend and take the plunge (these hitchhiking investors are also known as “apes”) …… but please wait.
Since the code for this project has not yet been audited (it’s a work in progress), there are two panic buttons for special cases (e.g., serious bugs are found).
In AlphaVault.sol, since the contract is not yet finalized, the governance / project owner has the right to use the emergencyBurn() and emergencyWithdraw() commands, meaning they can withdraw liquidity from the pool and then transfer it to the governance.
So if the team is ever ready to finalize the smart contract (with the finalized value set to true), probably after passing a code audit, one no longer needs to worry about this issue.
It is common practice to reserve privileges for emergencies in the early stages of a project, but please keep these risks in mind and think twice before you consider investing your life savings, especially since Charm is an anonymous team.
I mention this not to discourage people from using this product, but simply to remind people that putting money into smart contracts is always a risk. After all, no matter how many audit reports back up the product, smart contracts can still be hacked.
Personally, I’ve read their code, like the simplicity of their strategy, and will definitely try it once the contract is finalized! But to repeat the phrase: never invest more than you are willing to lose.
To sum up
That’s pretty much all Charm’s Alpha Vault has to offer. I didn’t expect such a simple strategy, did you?
If you’re excited about using Alpha Vault, they’re launching another ETH / USDT machine gun pool on May 24.
One last thing I’ll say: all of Charm’s products are built by one developer. That’s super vital and awesome! I’m a big fan now.
Posted by:CoinYuppie，Reprinted with attribution to:https://coinyuppie.com/five-minutes-to-read-charm-alpha-vault-uniswap-v3-lp-minimalist-operating-strategy/
Coinyuppie is an open information publishing platform, all information provided is not related to the views and positions of coinyuppie, and does not constitute any investment and financial advice. Users are expected to carefully screen and prevent risks.