Skip to content

Incorrect runtime balance calculation in synchronization process

https://gitlab.syncad.com/hive/balance_tracker/-/blob/develop/db/process_block_range_orders.sql?ref_type=heads#L63

Based on my understanding of this code, it appears that you created a partial copy of the hafd.account_operations table into the btracker schema and are calculating balances at runtime. This approach is incorrect.

The synchronization process should involve pre-calculating the balance for each account. The endpoint should then simply retrieve these pre-computed balances and return them in the appropriate format.

Edited by Michal Zander