Using python web3, is it possible to listen for when a given target address uses a specific contract?
For context: I want to be able to know every time a wallet purchases/sells tokens via Pancakeswap's router contract (using swapExactEthForTokens or swapExactTokensForEth).
Currently I am using bscscan's api to query for "token transfer events" via one of their APIs. But this is very limited since I am dependent on a third party's API and consequently have to use rate limited repeated http polling to check for a new event every t time interval.
I know something of the sort is possible via websockets and subscriptions, but I have been unable to find an example similar to mine using web3.py v6.
If anybody has any suggestions it would be greatly appreciated!