New ERC-20 token not shown instantly

When an account gains a new erc-20 token, the token doesn’t always show up in the return from the erc-20 api.

Check: https://deep-index.moralis.io/api/v2/0x1396b36449A81D51c6E06e59A3e62069B843DB4e/erc20?chain=polygon

It initially didn’t show the “GFARM” token (it did after about 5 minutes), but if you check that address on polygonscan, the token is there. Eventually the problem corrects itself, but this is really rough customer experience when they’ve received a token (and spent another token), but the balance isn’t updated in real time.

The balance should be updated in real time if you use Moralis db, initially the token balance should get in the table that ends with Pending (when using Moralis db to sync data for current user address). And it would take some time until the transaction will be considered validated and it will also appear in the API output. The delay should’t be be too long, but it will be a delay.

I don’t think that’s exactly what’s happening here. The transactions we have (a) transfer GAME from the user to a contract, and (b) mint GFARM to the user. The transfer of GAME is instant (effectively, I’m sure there’s some small delay), but the minting of the GFARM token takes significant time, on the order of several minutes, to show up in the API. So, there’s a period of minutes where the API returns the new GAME value, and the old GFARM value. That doesn’t make sense because they’re both from the same transaction, so should both resolve at the same time.

1 Like