feat: refactor launch script - closes #45

Signed-off-by: Arthurim <arthurbdauphine@gmail.com>
This commit is contained in:
Arthurim 2023-01-26 07:40:18 +00:00
parent 24ea73a0b2
commit e9461734da

View File

@ -1,25 +1,16 @@
#!/bin/bash
# This is a script to analyze MEV profits
# Run with:
# sleep(900); ./mev exec alembic upgrade head; sleep(60); nohup bash scripts/launch_analysis.sh > analysis.out 2>&1 &
# 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
nBlocks=500000
blockTo=$((blockFrom+nBlocks))
./mev inspect-many $blockFrom $blockTo
./mev analyze-profit $blockFrom $blockTo True
declare -a file_names=("profit_by_date.csv" "profit_by_block_number.csv" "profit_by_category.csv")
declare -a file_names=("profit_by_date.csv" "profit_by_block_number.csv" "profit_by_category.csv" "analyze_profit_failures.csv")
for fname in "${file_names[@]}"
do
kubectl cp $mevInspectPoolId:resources/$fname $fname;