Returns a list of parsed DEX trades for all transactions on a token across all of its pools.

"use strict";
const Shards = require("web3-shards");

const shards = Shards.API.Ethereum.V1;
shards.configure({
    apiKey: "YOUR_API_KEY", // Join the discord to get your api key. https://discord.com/invite/kJd8W7Nh7e
    maxRequestsPerSecond:5, // client-side limiter to prevent accidental burning
    logger: 1               // 0=none,1=errors,2=verbose
});

const getTradesOnToken = async function() {
    const token = "0x6982508145454ce325ddbe47a25d4ec3d2311933";
    const page = 1;
    const origin = "0xba01a8f92d0226beb53adf9fbea4088dd8c89a31";
    const startTime = 1690610183;
    const endTime = 1692647843;
    const resp = await shards.transactions.getTradesOnToken(token, page, origin, startTime, endTime);
    console.log(resp)
}

getTradesOnToken();
Language
Click Try It! to start a request and see the response here!