squeeth-monorepo icon indicating copy to clipboard operation
squeeth-monorepo copied to clipboard

Keeping ethPrice, dailyHistoricFunding and currentImpliedFunding in sync with network changes

Open EstherSeyi opened this issue 2 years ago • 3 comments

Task:

Description

This is in continuation of the wrong data in wrong network issue fixes.

  • Added networkId to ethPrice query key to ensure ethPrice is prefetched when there's a network change.
  • Moves dailyHistoricFunding and currentImpliedFunding to fetch with react-query to ensure values are in sync with network changes.
  • The other file changes were updates due to the changes in useDailyHistoricFunding and useCurrentImpliedFunding hooks.
  • Update the onboard initialization
  • added walletBalance atom.

Fixes # (issue) #479

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Document update

How Has This Been Tested

Please describe how to test to verify the changes. Provide instructions so we can reproduce.

FE Checklist

  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings
  • [ ] Added video recordings if it is a UI change

User Facing Checklist

  • [x] I fully understand the user problem this PR is solving
  • [x] I know who the target user is for this PR and have a deep understanding of that user
  • [x] I have tried this flow thinking from the pov of the target user for this PR
  • [ ] I (or working w someone on team) have scheduled a user test for this PR (if it is a large change)

EstherSeyi avatar May 27 '22 14:05 EstherSeyi

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
continuouscall ✅ Ready (Inspect) Visit Preview Jun 21, 2022 at 8:03AM (UTC)

vercel[bot] avatar May 27 '22 14:05 vercel[bot]

Sometimes it show mainnet price for ropsten, if I press reload. Also funding takes lot of time to load

Screen Shot 2022-05-30 at 3 14 35 pm

Funding takes longer to load on ropsten because everytime there is a refresh on ropsten, the funding requests initially fail with this error Returned values aren't valid, did it run Out of Gas? Screenshot 2022-05-30 at 08 07 32 so we have to refetch it after the error occurs and that takes some time. For mainnet it only happens when a user initially moves from ropsten to mainnet but it doesn't happen when you refresh on mainnet. @KMKoushik do you have any suggestions on avoiding this error?

EstherSeyi avatar May 30 '22 07:05 EstherSeyi

@EstherSeyi I have only 1 issue now. If I reload with ropsten connected it always shows mainnet data

KMKoushik avatar Jun 06 '22 00:06 KMKoushik