1

I am interested in the trades taking place on Uniswap and I am wondering how can I get this data using subscriptions over websockets? I initially thought, I just have to subscribe to some Event of the Uniswap Router contract only to find out, it doesnt emmit any events? Is it even possible to get the data like token x transferred for token y at price z?

I know how to subscribe to events using web3, but I dont know what to subscribe to in case of uniswap to get all the trade data.

1 Answer 1

1

The easiest way you could get these events is via uniswap subgraph. This subgraph for example is for Uniswap V2 swaps. link: https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v2

Otherwise you would have to subscribe to the Swap event for each pair of the token you want to get swap events for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.