
Queries
To get a list of swaps for a token, you can use thegetTokenEvents query.
For example, for the WBNB token on the BNB chain (networkId 56), you can use the following query:
To get more (paginate), you can use the cursor argument to get the next page of results.
Modify the query to include the cursor like this:
Paginated
Paginated
getTokenEventsForMaker, holders for an example.
Realtime Updates
To get realtime updates, you can use theonTokenEventsCreated subscription.
Subscription
Subscription
Now you’ve got all you need to build a fully functional swap list view.
See more event queries in the api reference, like getTokenEventsForMaker, getEventLabels for an example.
And more subscriptions like