Token_holders & token_holders_changes returns different balance than balances_v2 endpoint

So not sure if this is a bug or I am reading balances wrong but if we look at address:


Their balance of the token Mithril on the BSC chain can be found with the /balances_v2/ endpoint

At time of writing returns: ‘13852812678813092044794’

But when I run the /token_holders/ endpoint: 1&page-size=10&key=APIKEY

I get a balance of ‘812248382789531844731091’ for the same address

Same balance for the same address on the ‘token_holders_changes’ endpoint

I get a balance of ‘812248382789531844731091’ for the same address again

So my question is, is there something with the V2 versions of end points that gives the correct balance that I can find information about? Is there a way I can convert the balance I am being given from the v1 to the correct one? It might have something to do with the token’s reflections? Or am I not using the API correctly?

Thanks for the help, I tried to look for an answer to this question or someone who had the same issue but I couldn’t find anything sorry. The API call is exactly what I need but the balances just aren’t right so if I could get some more clarity that would be super thanks!

Thanks for pointing! I raised a ticket :slight_smile:

1 Like

so the issue is reflection tokens****&page-size=9999****&page-size=9999****&page-size=9999

latest block_height == 12956885
last block where last event occurred: 12575442

12956885 - 12575442 = 381443 block difference

balance diff 

Prelude> 1920000000000000000000 - 6864114161334774883
Prelude> 1913135885838665225117 / 1920000000000000000000


Prelude> 0.03590443 * (1920000000000000000000 / 1e18)
Prelude> 0.03590443 * (6864114161334774883 / 1e18) 

Prelude> 1 - 0.24645210641765314/68.9365056

This holder somehow (no transaction or event emitted) lost 99% of its balance between blocks 12956885 and 12575442

So yeah, bottom line, token_holders currently do event-based tracking of token holder balances.

I believe that token_holders_v2 will support this case though.

Great thanks, that is the answer I wanted. Just had to know why the balance_v2 was correct and the others were incorrect, makes sense that one version factors that in and the other does not.

Thank you so much :slight_smile:

I assume ETA for v2 is quite a while out or unknown for these endpoints?