(Testing it in BSC) So I made simple js bot that looks for pending transactions in mempool that are using pancake router v2 and if in path[1] (token that someone is buying) it will console log it but it only seams to find biggest tokens busd wbnb ect... But on bscscan there where transactions for that token? Do you know how to fix it

let test_mempool = async () => {
  var customWsProvider = new ethers.providers.WebSocketProvider(wss);
  customWsProvider.on("pending", (tx) => {
    customWsProvider.getTransaction(tx).then(function (transaction) {
      if (transaction["to"] == "0x10ED43C718714eb63d5aA57B78B54704E256024E") {
        // if to pancake swap
        let ABI = fs.readFileSync('./BSC.json');
        let BSC = JSON.parse(ABI);
        const inter = new ethers.utils.Interface(BSC);
        const decode = inter.parseTransaction({ data: transaction.data, value: transaction.value});  
        // decode the transaction
        let tokenOut_address = path[1];
        if (tokenOut_address == "my token") {
        console.log("found it!!");


Your Answer

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

Browse other questions tagged or ask your own question.