-
Notifications
You must be signed in to change notification settings - Fork 10
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
payment spec: divisibility / arbitrary precision #249
Comments
Ivshti
changed the title
payment spec: divisibility
payment spec: divisibility / arbitrary precision
May 25, 2019
Closing this in favor of the v5 Unified Precision of (8) #384 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We can implement a property of the payment spec that allows to divide a token to any arbitrary number of decimals, and use that unit internally
then, when the state tree is signed, it would be divided to get the real token unit (e.g. if we were dividing to
10**30
, and the real unit is10**18
, we'd mul by10**-12
and round down)useful for AmbireTech/adex-validator#14
this can help going both ways - if the token multiplier is, say - 18, and we want to pay out
3*10**12
, there's no point to increment aggregates by3*10**12
; we can just increment by 3 and set10**12
to be the multiplierPrecision
1 USD
to be1 * 10**6
(i.e. 6 decimal places)10**18
10**8
This means that we can use a base of
10**12
for internal database storage, four couple of reasons:1 000
, this means we need 3 decimals places of precision more for a total of 610**18
and is the most precise of them, we can use it as a base, meaning we get the base10**12 = 10**18 - 10**6
(6 decimal points less precise than DAI)This should only be applied to Sentry and it's internal representation in the Database of the payouts.
Benefits
Multiple tokes support
Combined with AmbireTech/adex-validator#324 we can have the whitelisted tokens
Sentry changes:
Channel
if thedepositAsset
is on the Whitelisted tokensChannelSpec
depositChainId
(optional) - if it's not specified, try to infer the chain ID from thedepositAsset
(token address)Related
The text was updated successfully, but these errors were encountered: