mev-inspect-py/scripts/launch_analysis.sh
Luca G.F 30895e5694
feat: update analysis launch to use generic pod id (#26)
Signed-off-by: Luca Georges Francois <luca@quartz.technology>

Signed-off-by: Luca Georges Francois <luca@quartz.technology>
2023-01-18 07:51:07 +00:00

26 lines
919 B
Bash

#!/bin/bash
# This is a script to analyze MEV profits
# Input the pool Id of mev-inspect (can also be found on your TILT interface)
mevInspectPoolId=$(kubectl get pods | sed -n -e '/^mev-inspect-/p' | sed '/^mev-inspect-workers/d' | awk '{print $1}')
# Input the starting and ending blocks you want to run the profit analysis for
blockFrom=$((34500000))
blockTo=$((34500100))
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