In this series of Francium Explained, we will be walking you through the basics of leveraged yield farming (LYF), as well as the mathematics behind the long, shorts, and hedging strategies with LYF. LYF is a mechanism that allows farmers to lever up their yield farming position, meaning to borrow external liquidity and add to their liquidity to yield farm. Keen to find out how much do you actually know about LYF? Read on!
Imagine this scenario.
Alice is a happy farmer. She has obtained a good return by planting and selling wheat. Alice wants to expand the scale of farming, so she proposes to borrow some money from his neighbour Bob and use the money to buy more wheat seeds. Part of the harvest will be paid to Bob in return.
This is where Leveraged Yield Farming (LYF) starts. Now imagine that Alice owns 1,000 USDC at the beginning, and Alice uses her 1,000 USDC and the 1,000 USDC borrowed from Bob to buy wheat seeds for cultivation. The 1000USDC borrowed from Bob will generate 10% interest and be returned to Bob. In this case, on the premise that Alice only owns 1,000 USDC, she can enjoy the income generated by nearly 2,000 USDC.
This is farming with 2x leverage.
Not every investment will have a good return. When Alice proposed to borrow USDC from Bob, Bob made such a trade-off: If he does not lend those USDC, then he will always have 1000 USDC assets; If he lends with USDC, he will enjoy 10% (100 USDC) interest every year, but if Alice fails in planting wheat or the wheat price drops, in the worst case, she will not be able to repay the principal or even the interest. In order to ensure the safety of his assets, Bob and Alice reached an agreement that if the value of Alice’s wheat drops to a certain amount, Alice will sell all wheat and return Bob’s 1,000 USDC.
This is the leverage yield farm with liquidation.
However, what if Alice does not borrow money, but wheat from Bob? And what if the value of Alice’s assets is not only dependent on wheat?
Longing, Shorting & Hedging LP tokens with LYF:
From the above example, we can see that the most intuitive function of LYF is to amplify the income of the farm, longing certain assets. When we farm LP tokens (which is the commonest case in the DeFi world), to study the performance of LYF, let’s establish a stable coin model.
There are two tokens in this model: Token A & Stable Coin USDC. Let’s take P as the price of A using amount of USDC as a unit. Initially, Charlie holds N USDC, and the price of A is P₀. When he participated in LYF with leverage Y:
- N(Y-1) USDC are borrowed from the lending pool
- NY/2 USDC (Half of total USDC) will be swapped for A
- Deposit A & USDC for LP tokens
- Stake LP tokens into the farming pool
When closing the position, it follows the next steps:
- Redeem All LP tokens for A & USDC
- Sell all A for USDC
- Repay N(Y-1) USDC
- You get the remaining USDC
Based on the AMM formula, when P changes, the amount of USDC we can withdraw by redeeming the LP token is
so when close position, the profit you get is
In traditional longing, the profit we can get by long X A is X(P-P₀). Without losing generality, let’s make the initial price P₀=100, the performance of longing with different leverage are illustrated below:
But the role of LYF is not only that. If you are a keen trader, you may think that if the price of a certain token will fall within a certain period of time, the best way to make a profit from it is to go short this token. The usual steps are: when token A price is P₀, borrow X token A, sell X token A for Y token B immediately, when token A price drops to P, buy X token A back, by doing so, the profit you get is X*(P₀-P) token B-borrowing interest. With LYF, there is a little difference. If you are holding X token A and open a 3 times leverage position, you will automatically borrow 2X token A from the lending pool, and half of total token A, 1.5X A will be swapped to token B immediately. 0.5X token A short exposure is generated instantly. In traditional shorting, you can only earn profit from a price drop, but with yield farming, you can also earn LP tokens apart from the earning with a price drop. It’s a safer method to short a certain asset since the price of LP price and the token price has a square-root relation. You might doubt that if it is a good method to short, so next we will show you the performance of shorting with LYF by using the same model.
Initially, Charlie holds M A, whose initial price is P₀, when he participated in LYF with leverage Y:
- M(Y-1) A are borrowed from the lending pool
- MY/2 A (Half of total A) will be swapped for B
- Deposit A&B for LP tokens
- Stake LP tokens into the farming pool
When closing the position, it follows the next steps:
- Redeem All LP tokens for A&B
- Sell all B for A
- Repay M(Y-1) A
- You get the remaining A
Based on the AMM formula, when P changes, the amount of A we can withdraw by redeeming LP token is
The total worth of LP tokens are
when close position, the profit you get is
In traditional shorting, the profit we can get by shorting
Without losing generality, let’s make the initial price 100, (due to the similarity solution you can get the same performance at other initial prices)
From the above figures, you can see the LYF curve is smoother. when the leverage is equal, long & shorting with LYF can reduce the risk when the price is going down/up. When the leverage reaches double of the traditional short, it starts to suppress the profit of traditional longing/shorting at a certain range, but the cost will be a higher risk when prices go down/up or in times of higher capital usage. It may look like a simple longing/shorting strategy, but there existing an important factor we haven’t take into account: farming yield, or maybe what we can call self-adjusting leverage. Knowing that our LP tokens keep earning rewards, and those rewards are reinvested into our LP tokens, the borrowed tokens are going to take a lower and lower proportion relative to the capital, thus we have a decreasing leverage. For example, if token A is not likely to fluctuate within a short time, an LYF longing/shorting can make it more resistant to market volatility in the future. In a constant APR auto-compound model, the profit can be demonstrated as below:
There will be an embedded calculator on our website for our users to plan their investments better. Since we have already known how to long & short with LYF, it is also for hedging, we will discuss it in the following articles.
How to farm with Francium:
Francium Protocol is now live: https://francium-protocol.io/app/invest/farm
At Francium, you can earn income by depositing your assets into our Leveraged LP farming pool. You don’t need to obtain those LP tokens before farming, we actually do that for you! Francium will automatically convert your asset into LP tokens through our smart engine.
To farm, you may follow the next steps:
- Connect to your Web3 wallet (such as Sollet, Phantom, Coin 98).
- Choose your farming pool, click “Farm”.
- Once you click “Farm”, you can specify the amount of USDC you want to deposit. You can also adjust the leverage and set up a stop-loss position (Please make good use of the stop-loss position to reduce risks).
- Click “Farm”, approve this transaction and wait for Solana confirmation.
To withdraw, you may then follow the next steps:
- Choose the position you want to close and click “Withdraw”.
- You can specify the amount you wish to withdraw.
- Click “Withdraw”, approve this transaction and wait for Solana confirmation.
Don’t miss out on our ongoing Beta Launch campaign! Farm with Francium Protocol to win airdrop and whitelist opportunities.
Be Part of the (Chemical) Equation — Join Francium!
- 🌐 Official Website: https://francium-protocol.io
- 🐦Twitter: https://twitter.com/Francium_Defi
- 💬 Telegram: https://t.me/franciumprotocol
- 👾 Discord: https://discord.gg/53rrwuRFra
- 👨💼 LinkedIn: https://www.linkedin.com/company/francium-protocol