The "V2" magic happens here. Instead of refreshing every second, the script subscribes to pendingTransactions .
Blockchain data fetching can fail due to network drops or temporary fork reorganizations. Wrap all asynchronous contract calls in strict try/catch statements to prevent the script from crashing. dex explorer v2 script