Farm with Leverage
Farming with more power!
Last updated
Farming with more power!
Last updated
The pop-up box for adding amounts will be shown when clicking the ‘Farm’ button. The amounts users put will be equally divided into two groups in order to add a liquidity pool on PancakeSwap.
For example, in the BNB-USDT, there are 6 cases;
Add BNB only x1 - no leverage, no destruction occurred.
Add USDT only x1 - no leverage, no destruction occurred.
Add BNB with leverage x1 x1.5 x2 x2.5 with minimum borrowed amounts of 0.2 BNB.
Add BNB and USDT with leverage x1 x1.5 x2 x2.5 (the system will calculate how much USDT users put equal to how much BNB amount) with minimum borrowed amounts of 0.2 BNB.
Add BNB and USDT only x1 - no leverage, no destruction occurred.
Add USDT only with leverage x1 x1.5 x2 x2.5 (the system will calculate how much USDT users put equal to how much BNB amount) with minimum borrowed amounts of 0.2 BNB.
The total amount of loan user takes on price leverage.
Leverage price can be calculated from the total input price (in BNB) and leverage.
Total input price can easily get from the BNB input field, but in case the user enters a number in the alternative token input field, the token will be converted to BNB via PancakeSwap protocol.
Slippage or price impact is the difference between the market price and estimated price due to trade size. The value can be calculated from the following equation.
Price Impact Calculation:
For further detail, the market price is the ratio between reserve0 and reserve1 (The amount of token0 and token1 stored in a pool).
The estimated price due to trade size is the market price with the additional token.
So, we can find the slippage value from the difference between the market price and estimated price due to trade size.
Now, the top equation could be simplified like this;