Farm with Leverage

Farming with more power!

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;

  1. Add BNB only x1 - no leverage, no destruction occurred.

  2. Add USDT only x1 - no leverage, no destruction occurred.

  3. Add BNB with leverage x1 x1.5 x2 x2.5 with minimum borrowed amounts of 0.2 BNB.

  4. 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.

  5. Add BNB and USDT only x1 - no leverage, no destruction occurred.

  6. 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.

🧾Total Debt

The total amount of loan user takes on price leverage.

TotalDebt=LeveragePriceCostTotal Debt=Leverage Price−Cost

Leverage price can be calculated from the total input price (in BNB) and leverage.

LeveragePrice=TotalInputPriceLeverageLeverage Price=Total Input Price∗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 and Trading Fees

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:

Price Impact=(reserve0token1reserve1reserve0token1reserve1+token1)reserve0token1reserve1100{Price}\space{Impact}=\frac{(\frac{{reserve0}*{token1}}{reserve1}-\frac{{reserve0}*{token1}}{reserve1+token1})}{\frac{{reserve0}*{token1}}{reserve1}}*100

For further detail, the market price is the ratio between reserve0 and reserve1 (The amount of token0 and token1 stored in a pool).

Market Price=reserve0reserve1Market\ Price=\frac{reserve0}{reserve1}

The estimated price due to trade size is the market price with the additional token.

Estimated Price=reserve0reserve1+token1Estimated\ Price=\frac{reserve0}{reserve1+token1}

So, we can find the slippage value from the difference between the market price and estimated price due to trade size.

Slippage=MarketPriceEstimatedPriceSlippage=∣Market Price−Estimated Price∣

Now, the top equation could be simplified like this;

Price Impact=SlippageMarket Price×100Price\ Impact=\frac{Slippage}{Market\ Price}\times100

🧾Trading Fees Calculation (7 Days Avg.)

TradingfeeAPR=(oneDayVolumeUSDvolume7D)totalLiquidity×(3657)×100×(0.25100)Trading fee APR =\frac{(oneDayVolumeUSD - volume7D)}{totalLiquidity \times(\frac{365}7)} \times100\times(\frac{0.25}{100})

Last updated