solo11
solo11

Reputation: 11

How to do simulation of all/most pending transactions?

everybody. I have a task to search in mempool for transactions like "swap tokens for eth" or any other type where a wallet sells tokens and its transaction can affect token reserves. There are many tokens and their contract adresses are stored in an array.

I couldn't find how to filter pending transactions for my task, without high load for CPU. The only option I came up with is to filter out all transactions that have value zero (because 98% of "swap tokens for eth" have value 0.

And so, now my code can filter out most of the transactions that I definitely don't need. But now I need to simulate the ones with value == 0. I found alchemy api to simulate transactions, but it requires filling in the "From" field. But go-ethereum/geth method "SubscribeFullPendingTransactions", does not provide a way to know who sent the transaction. It is possible to find out who sent it using other tools, but it requires many lines of code with type conversions, very many. I found this method unworkable because transactions with value == 0 are 11-14 per second on average.

And I need to find out information about how many tokens a wallet wants to sell before its transaction is executed.

I've been thinking for many days now, and I can't figure out how to solve my problem. If you know how I can solve it, please help me.

......................................................

Upvotes: 1

Views: 110

Answers (0)

Related Questions