mev-inspect-py/scripts/launch_analysis.sh
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

27 lines
913 B
Bash

#!/bin/bash
# This is a script to analyze MEV profits
# Input the pool Id of mev-inspect (can be found on your TILT interface)
# TODO: How to extract the mev-inspect pool id to copy the csv files?
mevInspectPoolId="mev-inspect-759f8dc6f7-2nnzl"
# Input the starting and ending blocks you want to run the profit analysis for
blockFrom=$((34500000))
blockTo=$((34800000))
window=$((100))
reps=$(((${blockTo}-${blockFrom})/${window}))
echo "${reps}"
for i in $(seq 0 1 $reps)
do
from=$(($blockFrom + $i*$window))
to=$(($blockFrom + ($i+1)*$window))
echo "--"
echo "rep= $i/$reps"
echo "from= $from"
echo "to= $to"
./mev inspect-many $from $to
done
./mev analyze-profit $blockFrom $blockTo True
declare -a file_names=("profit_by_date.csv" "profit_by_block_number.csv" "profit_by_category.csv")
for fname in "${file_names[@]}"
do
kubectl cp $mevInspectPoolId:resources/$fname $fname;
done