Skip to content

simulate slippage for pool of various Amplifier(s), based on a targeted slippage(%) or a poolBalance(%)

License

Notifications You must be signed in to change notification settings

Trickkkkkkk/Curve_Finance_Slippage_Simulator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

simulate slippage for pool of various Amplifier(s), based on a targeted slippage(%) or a poolBalance(%)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%