This is an automated archive made by the Lemmit Bot.
The original was posted on /r/monero by /u/Unkn8wn69 on 2024-03-08 13:27:59.
Help the network by running a node or mining xmr!
Hey,
I wrote a small script to calculate average fee of the transactions in the mempool. Which is then multiplied by the attacking tx's (estimated about 50k of spam tx a day).
Tell me if I'm wrong with the math, but my python scripts results are:
Average Fee: 41143406.40293638 (piconeros XMR), Number of Transactions in mempool: 9808
Fee for 50K Tx a day: 2.057170320146819 XMR
Here is the script:
import requests
url = ''
response = requests.get(url)
attacking\_tx = 50000
if response.status\_code == 200:
data = response.json()
if 'data' in data and 'txs' in data['data']:
txs = data['data']['txs']
num_tx = len(txs) # Number of transactions
# Calculate the total fee of all transactions
total_fee = sum(tx['tx_fee'] for tx in txs)
# Calculate the average transaction fee if there are any transactions
if num_tx > 0:
avg_fee = total_fee / num_tx
else:
avg_fee = 0
print(f"Average Fee: {avg_fee}, Number of Transactions in mempool: {num_tx}")
fee_for_spam = avg_fee * attacking_tx
monero = fee_for_spam / 1e12 # piconeros to moneros
print(f"Fee for {attacking_tx / 1000}K Tx a day: {monero}")
else:
print("No transactions found.")
else:
print(f"Failed to fetch data, status code: {response.status\_code}")
EDIT: Edited script to have easily changable amount of spam tx