Hello, I am trying to get full price data from all tokens on an exchange but am only finding the ability to pull by token. Is there a way to pull all tokens from an exchange to get up-to-date price and volume data per exchange?
Thank you guys for crushing it!
2 Likes
Hey @ACBassman
Currently getting price function is available only for one token. You can interact with factory
and router
smart contracts of an exchange for getting that info using web3 methods
Hope this will help you
2 Likes
For getting volume you can listen to transfer
events on exchange smrt contract and aggregate them
4 Likes
Great. I was looking for this. Currently Iβm just using web3 and eth pastLogs. With
-
the address = the Token Address I want the volume for
-
topics =[ transfer, one of the tokenβs related LPs ]
-
summing up the data of each transfer, looping through most liquid pairs with this token
Is there a better way? Some way of querying the blockchain transfer with just referencing the DEXβs Router address?
Thanks for your help.
Terry