0

Looking at the transactions from:

https://explorer-mainnet.maticvigil.com/address/0xfD0E9d3f4Eee056B49DF062B70f766cFB13fEb01/transactions

Looking at every block that a transactions is sent to this contract, I concluded that no matter the gas price of other transactions, I even tried to increase gasPrice of my transactions, it will always send an higher gas price than mine.

I was wondering how would that be possible?

1

When you send a transaction, it gets relayed to all nodes in the network and it is waiting to be included in a block. This list of pending transaction is called mempool.

Since all the transactions are relayed to all nodes, they are all public and visible for everyone. That means that anyone wanting to, can immediately react to any new transactions. So, for some reason, someone (or some thing) is monitoring transaction to that contract and replaces their earlier transaction with a higher gas price than yours.

2
  • Got some more questions if you could help and would like to elaborate: - What are the possible ways to access 'mempool' to do that? web3js has valid options for it? and are any alternatives? - How could someone avoid be overrunned by something like this? - What would happen if two where doing the same "trick"? Jan 24 '21 at 16:21
  • Web3 has options to read pending transactions, but not very familiar with those. Probably all clients have such functionality, so you can use anything you like. And about being overrun and competition - you should read some articles about the mempool being a "dark forest", and about frontrunning. Jan 24 '21 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.