storj_earnings
Earnings calculation script for Storj V3 storagenodes
Example current month:
April 2023 (Version: 13.0.0) [snapshot: 2023-04-20 10:45:45Z]
TYPE PRICE DISK BANDWIDTH PAYOUT
Upload Ingress -not paid- 1.82 TB
Upload Repair Ingress -not paid- 98.17 GB
Download Egress $ 20.00 / TB (avg) 413.80 GB $ 8.28
Download Repair Egress $ 10.00 / TB (avg) 80.19 GB $ 0.80
Download Audit Egress $ 10.00 / TB (avg) 20.23 MB $ 0.00
Disk Current Storage -not paid- 8.88 TB
Disk Average So Far Storage -not paid- 7.93 TB
Disk Usage Month Storage $ 1.50 / TBm (avg) 5.11 TBm $ 7.67
________________________________________________________________________________________________________+
Total 5.11 TBm 2.42 TB $ 16.75
Estimated total by end of month 7.93 TBm 3.73 TB $ 25.90
Payout and held amount by satellite:
┌────────────────────────────────┬─────────────┬──────────────────────────┬─────────────────────────────────────────────────────────────┐
│ SATELLITE │ HELD AMOUNT │ REPUTATION │ PAYOUT THIS MONTH │
│ Joined Month │ Total │ Disq Susp Down │ Storage Egress Repair/Aud Held Payout │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ ap1.storj.io:7777 (OK) │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2020-05-21 36 │ $ 0.56 │ 0.00% 0.00% 0.00% │ $ 0.5993 $ 0.2981 $ 0.0815 -$ 0.0000 $ 0.9789 │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ eu1.storj.io:7777 (OK) │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2020-05-21 36 │ $ 0.75 │ 0.00% 0.00% 0.01% │ $ 2.9784 $ 2.9768 $ 0.1850 -$ 0.0000 $ 6.1403 │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ europe-north-1.tardigrade.io:7777 (OK) │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2020-05-21 36 │ $ 7.33 │ 0.00% 0.00% 0.01% │ $ 1.8074 $ 0.0028 $ 0.2424 -$ 0.0000 $ 2.0527 │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ saltlake.tardigrade.io:7777 (OK) │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2020-05-21 36 │ $ 2.12 │ 0.00% 0.00% 0.00% │ $ 0.8922 $ 0.0039 $ 0.1833 -$ 0.0000 $ 1.0794 │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ us1.storj.io:7777 (OK) │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2020-05-21 36 │ $ 0.64 │ 0.00% 0.00% 0.00% │ $ 1.3897 $ 4.9933 $ 0.1090 -$ 0.0000 $ 6.4920 │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ us2.storj.io:7777 (OK) │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2021-01-06 28 │ $ 0.01 │ 0.00% 0.00% 0.00% │ $ 0.0050 $ 0.0011 $ 0.0008 -$ 0.0000 $ 0.0069 │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤ +
│ TOTAL │ $ 11.41 │ │ $ 7.6721 $ 8.2759 $ 0.8021 -$ 0.0000 $ 16.7501 │
│ ESTIMATED END OF MONTH TOTAL │ $ 11.41 │ │ $ 11.8345 $ 12.7660 $ 1.2372 -$ 0.0000 $ 25.8377 │
└────────────────────────────────┴─────────────┴──────────────────────────┴─────────────────────────────────────────────────────────────┘
Prerequisites
Python is required to run this script.
This script was tested on Windows 10 and Linux, with Python 3.7. Other OS's and versions will likely also work.
Warning
If you are running Docker on Windows or MacOS, stop the node, copy the satellites.db, bandwidth.db, storage_usage.db, piece_spaced_used.db, reputation.db, heldamount.db and pricing.db to a different location and run the script from there. Running the script on docker nodes on these OS's while the node is using it could lead to corruption of the database, which will kill the node.
Usage
Earnings for current month:
python earnings.py /path/to/storj/data
Note: If you omit the path it will look in the current working directory.
Earnings for previous months:
python earnings.py /path/to/storj/data 2023-03
Example previous months:
February 2021 (Version: 13.0.0)
TYPE PRICE DISK BANDWIDTH PAYOUT
Upload Ingress -not paid- 269.83 GB
Upload Repair Ingress -not paid- 130.37 GB
Download Egress $ 20.00 / TB (avg) 1.45 TB $ 28.91
Download Repair Egress $ 10.00 / TB (avg) 296.18 GB $ 2.96
Download Audit Egress $ 10.00 / TB (avg) 12.25 MB $ 0.00
Disk Usage Month Storage $ 1.50 / TBm (avg) 13.18 TBm $ 19.76
________________________________________________________________________________________________________+
Total 13.18 TBm 2.14 TB $ 51.64
Payout and held amount by satellite:
┌────────────────────────────────┬─────────────┬──────────────────────────┬─────────────────────────────────────────────────────────────┐
│ SATELLITE │ HELD AMOUNT │ REPUTATION │ PAYOUT THIS MONTH │
│ Joined Month │ Total │ Disq Susp Down │ Storage Egress Repair/Aud Held Payout │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ ap1.storj.io:7777 │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2019-06-10 21 │ $ 0.34 │ │ $ 1.4218 $ 2.0987 $ 0.1383 -$ 0.0000 $ 3.6588 │
│ │ │ │ DIFFERENCE $ -0.0227 │
│ │ │ │ PAID $ 3.6361 │
│ │ │ │ PAID PREVIOUS MONTHS $ 4.0464 │
│ │ │ │ PAID TOTAL $ 7.6825 │
│ Transaction($ 7.68): https://etherscan.io/tx/****************************************************************** │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ eu1.storj.io:7777 │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2019-05-31 22 │ $ 20.82 │ │ $ 1.9396 $ 3.7378 $ 0.1803 -$ 0.0000 $ 5.8577 │
│ │ │ │ DIFFERENCE $ -0.0309 │
│ │ │ │ PAID $ 5.8268 │
│ │ │ │ PAID PREVIOUS MONTHS $ 4.3825 │
│ │ │ │ PAID TOTAL $ 10.2093 │
│ Transaction($ 10.21): https://etherscan.io/tx/****************************************************************** │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ europe-north-1.tardigrade.io:7777 │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2020-04-18 11 │ $ 47.78 │ │ $ 6.7460 $ 9.6441 $ 1.5383 -$ 0.0000 $ 17.9284 │
│ │ │ │ DIFFERENCE $ -0.1078 │
│ │ │ │ PAID $ 17.8205 │
│ │ │ │ PAID PREVIOUS MONTHS $ 16.5435 │
│ │ │ │ PAID TOTAL $ 34.3641 │
│ Transaction($ 34.36): https://etherscan.io/tx/****************************************************************** │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ saltlake.tardigrade.io:7777 │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2020-02-11 13 │ $ 69.74 │ │ $ 8.2517 $ 11.8080 $ 0.9814 -$ 0.0000 $ 21.0411 │
│ │ │ │ DIFFERENCE $ -0.1320 │
│ │ │ │ PAID $ 20.9091 │
│ │ │ │ PAID PREVIOUS MONTHS $ 25.7830 │
│ │ │ │ PAID TOTAL $ 46.6921 │
│ Transaction($ 46.69): https://etherscan.io/tx/****************************************************************** │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ us1.storj.io:7777 │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 0% 100% │
│ 2019-02-28 25 │ $ 1.33 │ │ $ 1.4031 $ 1.6244 $ 0.1236 -$ 0.0000 $ 3.1512 │
│ │ │ │ DIFFERENCE $ -0.0225 │
│ │ │ │ PAID $ 3.1287 │
│ │ │ │ PAID PREVIOUS MONTHS $ 4.0642 │
│ │ │ │ PAID TOTAL $ 7.1929 │
│ Transaction($ 7.19): https://etherscan.io/tx/****************************************************************** │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤
│ us2.storj.io:7777 │ │ │ $ 1.50/TBm $ 20.00/TB $ 10.00/TB 75% 25% │
│ 2021-01-07 2 │ $ 0.00 │ │ $ 0.0003 $ 0.0012 $ 0.0000 -$ 0.0011 $ 0.0004 │
│ │ │ │ DIFFERENCE $ -0.0000 │
│ │ │ │ PAID $ 0.0004 │
│ │ │ │ PAID PREVIOUS MONTHS $ 0.0000 │
│ │ │ │ PAID TOTAL $ 0.0004 │
│ Transaction($ 0.00): https://etherscan.io/tx/****************************************************************** │
├────────────────────────────────┼─────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────┤ +
│ TOTAL │ $ 140.01 │ │ $ 19.7625 $ 28.9142 $ 2.9619 -$ 0.0011 $ 51.6375 │
│ │ │ │ │
│ │ │ │ PAYOUT DIFFERENCE $ -0.3159 │
│ │ │ │ PAID OUT THIS MONTH $ 51.3216 │
│ │ │ │ PAID PREVIOUS MONTHS $ 54.8196 │
│ │ │ │ PAID TOTAL $106.1412 │
└────────────────────────────────┴─────────────┴──────────────────────────┴─────────────────────────────────────────────────────────────┘