-
Notifications
You must be signed in to change notification settings - Fork 4
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: SyncActivityPrices command to update missing nft activity sales prices #249
feat: SyncActivityPrices command to update missing nft activity sales prices #249
Conversation
…istory' of https://github.com/ArdentHQ/dashbrd into feat/sync-total-usd-and-total-native-from-token-price-history
…istory' of https://github.com/ArdentHQ/dashbrd into feat/sync-total-usd-and-total-native-from-token-price-history
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs checking how long this takes to run for x amount of records, as the initial reports would indicate it's too slow to run this on the production database
[nft activity] compute and sync total usd/native amount from the token price history
Summary
activities:sync-prices
command to update all the NFT activities from a Polygon collection in our DB.Explanation of the command
This new command runs a transaction query that updates the 'nft_activity' table by calculating and setting the 'total_native' and 'total_usd' columns based on the values stored in the 'extra_attributes' column from the 'token_price_history' table and the
price
column in thetoken_price_history
table. The command performs the following actions:For each record in 'nft_activity':
Update is limited to records in 'nft_activity' associated with collections having a 'network_id' of 1 (Polygon in our app).
The command uses a transaction to ensure data consistency. It commits the changes after successful execution.
Steps to reproduce
token_price_history
table is empty.php artisan marketdata:fetch-price-history
).php artisan activities:sync-prices
.total_native
andtotal_usd
is now filled for all the entries that belong to a Polygon collection.Checklist