liquity / ChickenBond

GNU General Public License v3.0
33 stars 5 forks source link

test: add tests for bLUSD:LUSD Curve gauge #170

Closed danielattilasimon closed 2 years ago

danielattilasimon commented 2 years ago

The tests are focused on clarifying our understanding of how the gauge hands out secondary reward tokens (in our case: LUSD), particularly in edge cases like:

The tests don't cover CRV rewards. We're assuming that it's been thoroughly tested by now.

It turns out that:

Resolves #165.

bingen commented 2 years ago

rewards are lost during periods when no one is staking in the gauge

Hm, too bad, I hope first users to chicken in provide liquidity and stake soon then.

Btw, this is a common issue it seems: https://github.com/aragonone/liquidity-rewards/issues/4

which we fixed here: https://github.com/liquity/dev/pull/271/commits/dcac80c0e23c352281ff4c8529131d91760c677a

danielattilasimon commented 2 years ago

rewards are lost during periods when no one is staking in the gauge

Hm, too bad, I hope first users to chicken in provide liquidity and stake soon then.

Btw, this is a common issue it seems: aragonone/liquidity-rewards#4

Haha! I wrote these test cases because I remembered you did some fixes on Unipool specifically to make it "pause" rewards during periods of no one staking: https://github.com/liquity/dev/commit/23515e878dbe33105e81906be311f3897dc58a9c

It's a bummer that the gauge doesn't work like that, but there's not much we can do about it.

RickGriff commented 2 years ago

Does the gauge smoothly distribute rewards over time, like our previous staking contract?

e.g. if there is a single fee event generating x LUSD, will that x be continuously dripped to stakers over time?

danielattilasimon commented 2 years ago

Does the gauge smoothly distribute rewards over time, like our previous staking contract?

e.g. if there is a single fee event generating x LUSD, will that x be continuously dripped to stakers over time?

Yes, my understanding is: whenever there's a fee event, the remaining rewards are calculated, to which the new rewards are added, and the gauge will proceed to continuously distribute the new total over the next 7 days... or until there's another fee event, in which case another recalculation takes place.

This can be observed in testGaugeContinuesToRewardLUSDAfterKilled (indirectly).

RickGriff commented 2 years ago

Yes, my understanding is: whenever there's a fee event, the remaining rewards are calculated, to which the new rewards are added, and the gauge will proceed to continuously distribute the new total over the next 7 days... or until there's another fee event, in which case another recalculation takes place.

This can be observed in testGaugeContinuesToRewardLUSDAfterKilled (indirectly).

Got it. All makes sense. Tests look good!