mev-inspect-py/launch_analysis.py
Eru Ilúvatar bfbf1cc379
feat: analyze profits - closes #19 (#20)
* feat: analyze profits - closes #19

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* feat: analyze profits - closes #19

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* fix peotry lock

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* feat: add save to csv option

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* fix: update dockerfile to resolve deps automatically at build-time

Signed-off-by: Luca Georges Francois <luca@quartz.technology>

* feat: add porfit by day

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* feat: add failures saving

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* fix: launch script

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

* feat: get rpc url from env

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>
Signed-off-by: Luca Georges Francois <luca@quartz.technology>
Co-authored-by: Luca Georges Francois <luca@quartz.technology>
2023-01-16 07:00:21 +00:00

21 lines
819 B
Python

import sys
from profit_analysis.analysis import analyze_profit, get_profit_by
from profit_analysis.column_names import BLOCK_KEY
from mev_inspect.db import get_inspect_session
block_from = int(sys.argv[1])
block_to = int(sys.argv[2])
inspect_db_session = get_inspect_session()
profit = analyze_profit(inspect_db_session, block_from, block_to, True)
print(" -------------------------------------------------------------------")
print(" Profit By Block")
print(get_profit_by(profit, BLOCK_KEY, True))
print(" -------------------------------------------------------------------")
print(" Profit By Day")
print(get_profit_by(profit, "date", True))
print(" -------------------------------------------------------------------")
print(" Profit By Category")
print(get_profit_by(profit, "category", True))