daoswapdex / daoswap-docs

0 stars 1 forks source link

Add APY for Untiswap V2 liquidity Mining. #2

Open daoswap002 opened 2 years ago

daoswap002 commented 2 years ago

Context In the previous Uniswap V2 liquidity mining September 18 2020 12:00am UTC. 5,000,000 UNI were allocated to 4 pools' LPs proportional to liquidity. No APY showing to indicate ROI (image 1), but Pancake farm (image 2) have APY for each pool liquidity mining.

Requirement:

  1. Describe how the APY calculated.
  2. Delivery coder to calculate APY, and can insert to Uniswap v2's liquidity mining page (image 1)
  3. Delivery code pancake liquidity mining ROI Calculator (image 3)

Image 1 image

Image 2 image

Image 2 image

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 150.0 USDT (150.0 USD @ $1.0/USDT) attached to it.

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Workers have applied to start work.

These users each claimed they can complete the work by 265 years, 1 month from now. Please review their action plans below:

1) wanchalong19 has applied to start work _(Funders only: approve worker | reject worker)_.

https://gitcoin.co/issue/Ideamarket/gitcoin-bounties/34/100026656?utm_source=gitcoin&utm_medium=email&utm_campaign=new_bounty_daily

Learn more on the Gitcoin Issue Details page.

Asepkece commented 2 years ago

Case study We will stake 10 CAKE coins with an interest of 130% APY Example 1 – APY 130% (Annual Percentage Yield) 130% x 10 Cakes = 13 Cakes This means that if we stake 10 CAKE with 130% APY and keep it for 12 months we will get 13 Cake. Example 2 – If stake for 1 month with APY 130% 130 : 12 = 10.83 130% divided by 12 months equals 10.83%, so monthly you get 10.83% at 130% APY. So if it is calculated, 10.83% multiplied by 10 Cake equals 1.0833 Cake, and if 1.0833 multiplied by 12 equals 13. Example 3 – If stake for 7 days with 130% APY It's a little different counting it

130 : 365 = 0.35616438356 0.35616438356 x 7 = 2.49315068493 2.49315068493% x 10 = 0.249315068493 Explanation: The calculation above is an example of 130% divided by 365 days equals 0.35616438356 meaning every day we get 0.3561%

So if 0.35616438356 multiplied by 7 days equals 2.49315068493%

If calculated 2.49315068493% multiplied by 10 cakes is equal to 0.2493150684932,493 divided by 10 cakes Conclusion if we staking 10 Cakes for 7 days from 130% APY we will get 0.249315068493 Cake.

The important point that can be taken is number one, which is after dividing by 365 days, you should already know what percentage you will get per day.

There is also an easy way without the need to use a calculator, you can use the website www.stakingrewards.com Example 1 – If We Staking on PancakeSwap We use the stakingrewards.com website to calculate the income, this version has been set automatically according to the one on PancakeSwap Visit the website, in the search menu then write 'PancakeSwap' Then check the Earn section, you then enter the amount (Amount) Click Compound if you stake in 'Auto Cake'

![Uploading Staking-Reward-PancakeSwap-768x455.jpg…]()

The results you can see on the right, Total Reward Rate: 85% APY Est. Monthly Earning (Estimated Monthly Income) Est. Yearly Earning (Estimated Annual Income)

Example 2 – Calculating According to the Interest We Set (Advanced Calculator) Still using the stakingrewards.com website, each exchange offers different interest, so to calculate it you can use the method below: In our case, we will be staking 100 DOT coins and on the Binance exchange it offers 12.79% APY interest, for 30 days. How much interest do you get for 30 days? First go to the Advanced Calculator page (stakingrewards.com/calculator/binance-smart-chain) For provider fees make sure 0% Now in the section 'What % of all BNB on Binance Smart Chain are being staked?:' adjust it to return '1 Year @ 12.79%' basically just slide and adjust to return 1 year.

Staking-Reward-Kalkulator-Binance-Smart-Chain-DOT

Now to find out 30 days of income, you can check the return section '1 Month @ 1.05%'. According to the example above 100 DOT with an APY of 12.79% we get an estimated interest of 1.05 DOT within 30 days of locked staking. So we only get 1.05% for 30 days of stake, because 12.79 divided by 12 equals 1.05. In addition, if the stake is 15 days, just divide it by 2 from the 1 month calculation. You can see the proof in the screenshot below, the estimated interest rate is the same as we get 1.05 DOT, if with APY 12.79% in locked staking for 30 days.

Staking-DOT-di-Binance-30-Hari-768x439

Asepkece commented 2 years ago

https://github.com/gaijinjoe/cake-liquidity/blob/7ae59f159d09dc3560b294ce8d19955a56f401e5/borrow-limit-status.js#L233

Here you go.

Call it like this:

const autoAPY = compoundInterest(1, cakeSwapPoolAPR / 100, 365 * 288, 1); where cakeSwapPoolAPR is the APR of the Manual CAKE pool. Look at the code to see how to calculate the Manual CAKE pool APR.

Asepkece commented 2 years ago

Hello sir aprove my work