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

feat: STAKE-808: graph with historic vault apy tooltip #12804

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Matt561
Copy link
Contributor

@Matt561 Matt561 commented Dec 19, 2024

Description

This PR updates the existing pooled-staking learn more modal to include an interactive historic vault APY graph.

Changes

  • Updated pooled-staking learn more modal
  • Added <InteractiveTimespanChart /> component that is meant to be reusable in other flows (e.g. stablecoin lending)
  • Added useVaultAprs and useVaultApys hooks
    • These hooks use the stake-sdk under the hood to fetch data.
  • Added vaultAprs and vaultApys to our staking redux state

Related issues

Ticket: [FE]Graph with vault historic APY in tooltip

Manual testing steps

  1. From the asset list screen (home screen), click on "earn" next to Ethereum. Alternatively, you can select the "stake" or "stake more" button within the ETH asset overview screen.
  2. From the staking input screen, click on the tooltip icon "?" next to MetaMask Pool
  3. You should now see the learn more modal with the graph

Screenshots/Recordings

Before

stake-808-learn-more-modal-with-interactive-graph-before.mov

After

stake-808-learn-more-modal-with-interactive-graph-after.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

socket-security bot commented Dec 19, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/[email protected] network 0 182 kB metamaskbot

🚮 Removed packages: npm/@metamask/[email protected], npm/@metamask/[email protected]

View full report↗︎

@Matt561 Matt561 force-pushed the feat/stake-808/graph-with-historic-vault-apy-tooltip branch 3 times, most recently from e121cd6 to f7b65ad Compare December 19, 2024 22:54
numericChainId,
);
// TODO: Determine how we should refresh this value.
dispatch(setVaultAprs(vaultAprsResponse));
Copy link
Contributor Author

@Matt561 Matt561 Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amitabh94 @nickewansmith How do you guys think we should keep redux values up to date? If we store the vaultAprs in our redux store when and how do we refresh it? We can fetch on render (hit the staking-api cache) but this will require a skeleton loader state so we don't get pop-in.

Curious to hear your thoughts 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also fetch/refresh the data in the input view itself and then either pass the data as prop or get data in the component directly from the selector.

@Matt561 Matt561 force-pushed the feat/stake-808/graph-with-historic-vault-apy-tooltip branch from f7b65ad to aa5c436 Compare December 20, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants