farm-army / farm-army-backend

Track your farming and pool performance on the Binance Smart Chain, Polygon, Fantom, KuCoin Community Chain, Harmony, Celo - https://farm.army - nodejs backend
https://farm.army
MIT License
107 stars 61 forks source link

Remove repetition in pancakebunny platform #13

Closed 0xSwego closed 3 years ago

0xSwego commented 3 years ago

Found it while debugging why the APY of some pools of pancakebunny were off. Probably just a copy-paste artifact.

Haehnchen commented 3 years ago

:+1: fyi: i did not found a solution, sometimes the contracts given just wrong data, sometimes they just show different data. :)

0xSwego commented 3 years ago

In this case it seems that the APY (or APR?) for BUNNY-boost and BUNNY-BNB-boost is the APR of the simple BUNNY pool: scr scr2

0xSwego commented 3 years ago

Also, I was trying to fix why BUNNY-BNB FLIP Boost shows rewards only in BUNNY, while now they also give out CAKE (since yesterday or the day before).

I thought that the problem was in \platforms\pancakebunny\farms.json, where I added CAKE:

image

But I still cannot see the reward when I call /all/yield/:address. Do you have a hint where I could look at? 😄

Haehnchen commented 3 years ago

nice, free money didnt noticed. but you are right not visible.

https://github.com/farm-army/farm-army-backend/blob/master/src/platforms/pancakebunny/pancakebunny.js#L317 is the line. but if you look at the contract:

https://bscscan.com/address/0x40e31876c4322bd033BAb028474665B12c4d04CE#readProxyContract

there is only a "pendingBunny" method. the question is now where the cake is stored:

0xSwego commented 3 years ago

Amazing! Thanks for the tip! I'll look at it after work

0xSwego commented 3 years ago

I'm learning quite a lot about contracts, but I couldn't get to the end of the riddle.

It seems they have the same contract (this is the commit in which they added the newest pools) that use the same old bunnyChef 0x40e31876c4322bd033BAb028474665B12c4d04CE

I also noted that the value pendingBunny returns is ok for the BUNNY pool (still a bit off tho):

image image

And even more off for BUNNY-BNB:

image image

Of course the value of pendingBunny is what is displayed on farm.army.