beefyfinance / beefy-contracts

Public repo for the community devs to advance the Beefy protocol.
https://app.beefy.finance
175 stars 163 forks source link

beets rounding error causes vault to throw at >0 if-statement #171

Closed andreb0x closed 11 months ago

andreb0x commented 2 years ago

encountered an issue pertaining to this line with the current beets-cre8r vault: https://github.com/beefyfinance/beefy-contracts/blob/481fd6ea570e4b46a1766359c0a7bc42aba7bb1f/contracts/BIFI/strategies/Beethovenx/StrategyBeethovenxDual.sol#L135

I setup the vault to accept beets outputs in case they were eventually bribed for by cre8r. however, while current beets emissions are nominally zero, because of "rounding error" (according to beets admin) 1gwei beets is emitted every day or so. because the strat contract tries to swap beets whenever beets > 0, when it detects 1gwei beets it tries to trade, and as a consequence throws.

its unclear what a solution might be. any lower bound on trade would be arbitrary since its difficult to predict the price range at which the want token will swap against beets (it could be that a really really cheap token does in fact swap for 1 gwei beets in the future).

devyJo commented 2 years ago

Thank you for reaching to Our Github. Customer service may take some time to respond due to a large number of requests. We believe your case will be resolved as soon as possible. Kindly visit the Support live chat below for instant support response Support chat @andreb0x

Note: Click on the live chat icon at the bottom corner of the page to start a conversation