Hosted web service here kindly created by Vhjiang
simulate slippage & bonus for pool of various Amplifier(s), based on a targeted slippage(%) or a poolBalance(%) with custom size as a percentage of pool Total Value Locked (TVL).
Scripts for Swap, Withdrawal and Deposit
pip install -r requirements.txt
# poolBalance 80%
python3 Withdraw.py -p 80
# Slippage 2%
python3 Withdraw.py -s 2
# the excess assets are withdrawed
python3 Withdraw.py -p 80 --bonus True
# bonus 2%
python3 Withdraw.py -s 2 --bonus True
# swap excess asset with needed asset, further tilt the pool
python3 Swap.py -p 80
# Slippage 2%
python3 Swap.py -s 2
# swap needed asset with access asset, return the pool to balance
python3 Swap.py -p 80 --bonus True
# Bonus 2%
python3 Swap.py -s 2 --bonus True
# deposit excess asset
python3 Deposit.py -p 80
# Slippage 2%
python3 Deposit.py -s 2
# deposit needed asset, return the pool to balance
python3 Deposit.py -p 80 --bonus True
# Bonus 2%
python3 Deposit.py -s 2 --bonus True
# Pre-set `1%` of poolSize for the operations
# Pass an optional argument -a to specify the size as a percentage of TVL
# default
python3 Swap.py -s 2 -a 1
# specify swap size of 5%
python3 Swap.py -s 2 -a 5
-
Modified 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
Core Simulation Logic: GeekRunner
Streamlit: VJiang