Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 1.98 KB

File metadata and controls

70 lines (48 loc) · 1.98 KB

Curve_Finance_Slippage_Simulator

simulate slippage for pool of various Amplifier(s), based on a targeted slippage(%) or a poolBalance(%) with custom size of swap/withdraw(%).

Install

pip install -r requirements.txt

Usage

Simulate withdraw on a targeted PoolBalance(%)

# poolBalance 80%
python3 Withdraw.py -p 80

Withdraw Slippage with 80% Pool Balance

Simulate withdraw on a targeted Slippage(%)

# Slippage 2%
python3 Withdraw.py -s 2

Withdraw PoolBalance with 2% Slippage

Swap can be simulated in the same fashion using Swap.py

Simulate swap on a targeted PoolBalance(%)

# poolBalance 80%
python3 Swap.py -p 80

Swap Slippage with 80% Pool Balance

Simulate swap on a targeted Slippage(%)

# Slippage 2%
python3 Swap.py -s 2

PoolBalance with 2% Slippage

Swap / Withdraw Sizes

# 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

PoolBalance with 2% Slippage

Note:

  1. Use simulation code from Curve Finance

  2. Use a simple 2-coins model.

  3. Assume no admin fee in the above illustration, modify fee in the script to 4000000 to resemble mainnet setting of 4 bps