Innovative auto-lp
Last updated
Last updated
LVX auto-LP mechanism removes the many unnecessary steps of the most commonly used auto-LP code. The goal of auto-LP is to improve the constant factor of the LP, k = x*y, where x and y are the numbers of the paired tokens, in our case, LVX and USDC.
Usually, tokens to be added to the liquidity are taxed, half of the tokens are sold for the other token of the pair which are then added back, together with the unsold half of the taxed tokens. These steps are wholly redundant if we consider the following:
State A: a LVX and c+2*d USDC in LP, 2*b LVX taxed for LP on the token contract. Common approach: Sell b LVX for d USDC, now there are b taxed LVX and d USDC on the contract, those are then added in a pair back to the LP.
The LVX Solution: Add 2*b taxed tokens directly to the LP without selling for USDC first. Both cases result in State B: a+2*b LVX and c+2*d USDC in LP The constant factor increases from k = (a)*(c+2*d) in State A to k = (a+2*b)*(c+2*d) in State B
Let’s say you have a token, NULL. Its total supply is 1000. You pair it with USDC. When you create the pair, you send all 1000 NULLs and 1000 USDC as initial liquidity. This gives us a price of $1 per NULL. From this, we also calculate something that Uniswap calls K, which is the result of x*y. X and Y are the reserve/liquidity balances. So in our case, we have 1000 NULLs and 1000 USDC in reserves, so our K = 1000*1000 = 1,000,000.
K is a constant and only ever changes when liquidity is added or removed. It should never change from the actions of buying or selling the tokens in the pair contract. If someone spends $100 buying NULLs, then the USDC reserve grows to 1100, and therefore the NULL reserve MUST be 1,000,000 / 1100 = 909.09 NULLs. This calculation is the key to the famous Uniswap ‘price curve’.
An increasing K constant is advantageous to buyers because they will get less slippage.
The other side effect of increasing liquidity is the effect it has on the price floor of the token.
Going back to our original liquidity add of 1000 USDC and the entire supply of 1000 NULLs. Having this setup will guarantee every NULL is worth at least $1, no matter what.
Let’s assume that trading volume is $1m, and buy/sell tax of 10%, so a tax take of $100k. Half of that goes to USDC liquidity, so $50k.
If now every single NULL not in liquidity was sold, there would be 1000 NULLs in liquidity, but $51,000 in remaining USDC liquidity, giving a price floor of $51.