Method getTokenMetadataBySymbol returns too many results for single symbol

Hi,
I want to use method " getTokenMetadataBySymbol " to get contract address of token and then get token price , for example i called this:
const options2 = { chain: “bsc”, symbols: [“SAFEMOON”]};
and got hundreds of results like below:

  1. 3:

  2. address: “0x378ff4fe063fa29acc105f76d6405205c9d1119e”

  3. block_number: “8242108”

  4. decimals: “18”

  5. logo: null

  6. logo_hash: null

  7. name: “SafeMoon”

  8. symbol: “SAFEMOON”

  9. thumbnail: null

  10. validated: 1

  11. [[Prototype]]: Object

  12. 4:

  13. address: “0x1c2d7c26e990a9e09f2620f67604e21cef8b5321”

  14. block_number: “8242108”

  15. decimals: “18”

  16. logo: null

  17. logo_hash: null

  18. name: “SafeMoon Token for BSC Network”

  19. symbol: “SAFEMOON”

  20. thumbnail: null

  21. validated: 1

Main question : what are all these an how can i get the original SAFEMOON by symbol?
Another question : Is there a better solution to get token price by symbol?

Thanks

anyone can deploy an ERC20 token with that symbol, and you will get all those smart contracts that had that specific symbol.
You could check the number of transactions for every token address and keep only that one that has at least 10k transactions. And maybe keep in the database the right address for that symbol so that you don’t check that again next time. Also, you will not get a price for a random token that is not in a liquidity pool.

2 Likes