simulate slippage for pool of various Amplifier(s), based on a targeted slippage(%) or a poolBalance(%) with custom size of swap/withdraw(%).
pip install -r requirements.txt
# poolBalance 80%
python3 Withdraw.py -p 80
# Slippage 2%
python3 Withdraw.py -s 2
Swap
can be simulated in the same fashion using Swap.py
# poolBalance 80%
python3 Swap.py -p 80
# Slippage 2%
python3 Swap.py -s 2
# Pre-set `1%` of pool TVL for both swap and withdraw.
# Pass an optional argument -a to specify the size of the operation
# default
python3 Swap.py -s 2
# the above is the same as running
python3 Swap.py -s 2 -a 1
# specify swap size of 5% of total TVL
python3 Swap.py -s 2 -a 5
-
Use simulation code from Curve Finance
-
Use a simple 2-coins model.
-
Assume no admin fee in the above illustration, modify
fee
in the script to4000000
to resemble mainnet setting of 4 bps