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

[Spike] Refactor precision amounts #7108

Open
twblack88 opened this issue Jun 12, 2024 · 0 comments
Open

[Spike] Refactor precision amounts #7108

twblack88 opened this issue Jun 12, 2024 · 0 comments
Labels
nice to have mayyyybe one day spike

Comments

@twblack88
Copy link
Contributor

twblack88 commented Jun 12, 2024

While in the process of refactoring things in RFOX land and deciding to whether or not I should store precision as its own field or keep on deriving in-place, there's something I remembered coming across a few times in Uniswap SDK and finally found back... very close to the infamous amounts package that never came to be (IYKYK)

https://github.com/Uniswap/sdks/blob/9cd39edd4771a3817a05c417d1da3610790d4106/sdks/sdk-core/src/entities/fractions/currencyAmount.ts#L23

Shout out to @gomesalexandre for catching this upgrade possibility . It would help rFOX by forcing us to be explicit in whether an amount is a base unit or precision with fromRawAmount / fromFractionalAmount.

But at a larger scale, better precision would be super helpful accross the apps scope now, and especially when we integrate something like #6981 .

AC:

  • LOE and next steps from looking at the precision errors as a feature.
  • Define API and / or library to use for this, present to team so we are all agree on solution.
  • Create tickets for grooming/estimating
@0xean 0xean added the nice to have mayyyybe one day label Aug 5, 2024
@0xean 0xean moved this from Backlog to Up next / groomed in ShapeShift Dashboard Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice to have mayyyybe one day spike
Projects
Status: Up next / groomed
Development

No branches or pull requests

2 participants