-
Notifications
You must be signed in to change notification settings - Fork 24
SOV-5278: estimated amm weekly rewards #1133
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
SOV-5278: estimated amm weekly rewards #1133
Conversation
🦋 Changeset detectedLatest commit: 5527c5c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for sovryn-dapp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for sovryn-storybook canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the AMM weekly rewards estimation calculation to use more accurate data sources and improves the implementation by migrating to React Query for better data fetching patterns.
Changes:
- Refactored
useGetReturnRatehook from useState/useEffect pattern to React Query - Updated
useGetPoolBalanceAndRewardsto calculate weekly rewards using actual return rates instead of a fixed constant - Added support for both V1 and V2 pool types with different calculation methods
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/frontend/src/utils/graphql/rsk/operations/getToken.graphql | Added symbol field to token query |
| apps/frontend/src/utils/graphql/rsk/generated.tsx | Generated TypeScript types for the updated GraphQL query |
| apps/frontend/src/app/5_pages/MarketMakingPage/hooks/useGetReturnRate.ts | Migrated from useState/useEffect to React Query pattern |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/PoolsTable/components/PoolsTableReturns/PoolsTableReturns.tsx | Updated to match new return signature of useGetReturnRate |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AdjustAndDepositModal/hooks/useGetPoolBalanceAndRewards.ts | Refactored to use dynamic APY-based rewards calculation with support for V1/V2 pools |
| apps/frontend/src/app/5_pages/MarketMakingPage/components/AdjustAndDepositModal/components/NewPoolStatistics/NewPoolStatistics.tsx | Updated function call to pass additional required parameters |
| .changeset/few-bugs-remember.md | Added changeset documenting the fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://sovryn.atlassian.net/browse/SOV-5278