Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V7 farming rewards showing APR after rewards expiration #6071

Closed
0xean opened this issue Jan 24, 2024 · 2 comments · Fixed by #6083
Closed

V7 farming rewards showing APR after rewards expiration #6071

0xean opened this issue Jan 24, 2024 · 2 comments · Fixed by #6083
Assignees
Labels
bug Something isn't working

Comments

@0xean
Copy link
Contributor

0xean commented Jan 24, 2024

Currently v7 farming has expired, while we still need to allow users to interact with this contract to remove assets, it shouldn't show any APY.

Screenshot 2024-01-24 at 11 14 03 AM

The staking contracts have an expiration date that is build into them (periodFinish) which should be respected as the deadline to no longer show a valid APR on the staking contract.

Not sure how this has been dealt with in the past, but ideally we simply query that timestamp to disable showing any rewards past the date.

Acceptance Criteria

  • UI correctly stops showing rewards/APR for a staking contract after periodFinish has past
  • User can still interact with existing staked position in that contract, but we disable new deposits (think this already exists).
  • bonus points if we display the expiration date nicely somewhere in the UI so that the user understands the timeline and when they will need to migrate (next to V8 or the APR, maybe @reallybeard has an opinion as to where)

alternative long-term solution: we find a better staking contract to fork and stop with this nonsense every 4.5 months :)

@0xean 0xean added the bug Something isn't working label Jan 24, 2024
@0xean 0xean changed the title V7 farming rewards showing high APR after expiration V7 farming rewards showing APR after rewards expiration Jan 24, 2024
@0xean
Copy link
Contributor Author

0xean commented Jan 24, 2024

per conversation with most TMDC members, a new contract would be the desired long term path, so any fixes will just be for v8 and once v8 ends, we will migrate to an evergreen type contract to avoid migrations.

@gomesalexandre gomesalexandre self-assigned this Jan 24, 2024
@gomesalexandre
Copy link
Contributor

@0xean we already consume periodFinish from the contract to detect expired state:

const timeStamp = await foxFarmingContract.read.periodFinish()
const expired = Number(timeStamp) === 0 ? false : dayjs().isAfter(dayjs.unix(Number(timeStamp)))

I'll author a PR to ensure we holistically stop showing APR for expired opportunities. While FOX Farming is the obvious one, and the only one having this property, it may not be in the future so might as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants