How to listen for incoming transactions not yet mined for a single address?

丶灬走出姿态 提交于 2021-01-28 00:04:34

问题


Using OpenEthereum, which is the json rpc call allowing to do it?
I found the parity_pubsub module but I ve no idea of the parameter for getting not yet confirmed transactions.
I also found https://web3js.readthedocs.io/en/v1.2.11/web3-eth-subscribe.html#subscribe-pendingtransactions in the web3 module but it doesn t allows to filter transactions and the documentation doesn t explains how to use the full web3 api along OpenEthereum.

The purpose

The aim is to frontrun transactions for arbitrage by always maintinning the highest gas price until the next block is mined.
This involve detecting competiting transactions (those targetting the same Ethereum address as mine and with a higher gas price than me) with the lowest latency as possible in order to replace them as soon as possible (either for abortting the trade or changing the gas price again). So this exclude constantly polling for the answer as the requirement is to have the lowest number of context switches.

来源:https://stackoverflow.com/questions/65095482/how-to-listen-for-incoming-transactions-not-yet-mined-for-a-single-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!