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

ES payment stats #329

Merged
merged 4 commits into from
Oct 5, 2023
Merged

ES payment stats #329

merged 4 commits into from
Oct 5, 2023

Conversation

ArtemKolodko
Copy link
Collaborator

@ArtemKolodko ArtemKolodko commented Oct 3, 2023

Added fields to Elasticsearch:
totalCredits, freeCredits, oneCredits, fiatCredits

@ArtemKolodko ArtemKolodko marked this pull request as ready for review October 3, 2023 16:19
@polymorpher
Copy link
Collaborator

ES only supports numeric values up to 64-bits (as long type). If we were to cast the values to string, we would lose useful analytics properties such as sum, reduction, and aggregation. I see that the values to be stored are denominated in wei (in terms of fractions of ONE), so the values would be indeed very large (mostly in the order of greater than 10^18), and would have to be stored as string in ES.

Can we convert the values to equivalent USD first, and storing them in ES as double floating point values? I will create the corresponding mappings accordingly in ES

@ArtemKolodko
Copy link
Collaborator Author

ArtemKolodko commented Oct 4, 2023

Refactored ES payment stats
Convert ONE credits in wei to USD amount (float) with 4 fractional digits

New fields (number):

paymentTotal
paymentFreeCredits
paymentOneCredits
paymentFiatCredits

@theofandrich theofandrich merged commit a08bd24 into master Oct 5, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants