liquity / ChickenBond

GNU General Public License v3.0
31 stars 5 forks source link

[Parametrization] Curve V2 internal bLUSD/LUSD AMM params #230

Closed bingen closed 1 year ago

bingen commented 1 year ago

From https://github.com/liquity/ChickenBond/issues/95#issuecomment-1207336669

The parameters are:

Look here for an explanation of the parameters: https://resources.curve.fi/factory-pools/creating-a-crypto-factory-pool https://nagaking.substack.com/p/deep-dive-curve-v2-parameters?s=curve

Some examples of different configurations below.

bingen commented 1 year ago

cvxFxs / Fxs

https://curve.fi/factory-crypto/18

bTKN AMM pool:

 - LQTY amount: 89,391.99
 - bLQTY amount: 114,902.52
 - Price LQTY/bLQTY: 0.67
 - Price bLQTY/LQTY: 1.48
 - LP tokens total supply 144,770.56
 - LQTY Fees: 2,978.66
 - bLQTY Fees: 2,047.73
 - LQTYbLQTY Fees: 124.83
 - AMM APR: -31.040%

Performance

 - Total permament:               29,788.01
 - Permament percentage:          5.704%

 - Rebonders avg gain: 7.371%
 - LPs avg gain:       8.003%
 - Sellers avg gain:   3.205%
 - Traders avg gain:   9.877%

 - Total LQTY:         1,108,793.00

Screenshot_20220929_194538 Screenshot_20220929_194550 Screenshot_20220929_194624

Params

https://curve.fi/factory-crypto/18
CURVE_V2_A = 200000000 / 10**18
CURVE_V2_GAMMA = 19900000000000000 / 10**18
CURVE_V2_MID_FEE = 15000000 / 10**10
CURVE_V2_OUT_FEE = 30000000 / 10**10
CURVE_V2_ALLOWED_EXTRA_PROFIT = 100000000 / 10**18
CURVE_V2_FEE_GAMMA = 5000000000000000 / 10**18
CURVE_V2_ADJUSTMENT_STEP = 5500000000000 / 10**18
CURVE_V2_ADMIN_FEE = 5000000000 / 10**18
CURVE_V2_MA_HALF_TIME = 600
CURVE_V2_INITIAL_PRICE = INITIAL_BTKN_PRICE
bingen commented 1 year ago

Volatile recommendation

Surprisingly, it seems it works better with the previous configuration.

bTKN AMM pool:

 - LQTY amount: 68,812.08
 - bLQTY amount: 45,453.62
 - Price LQTY/bLQTY: 0.65
 - Price bLQTY/LQTY: 1.46
 - LP tokens total supply 51,460.59
 - LQTY Fees: 3,240.04
 - bLQTY Fees: 2,304.37
 - LQTYbLQTY Fees: 5.05
 - AMM APR: -3.535%

Performance

 - Total permament:               24,989.30
 - Permament percentage:          7.546%

 - Rebonders avg gain: 2.863%
 - LPs avg gain:       4.277%
 - Sellers avg gain:   1.785%
 - Traders avg gain:   9.569%

 - Total LQTY:         1,080,701.57

Screenshot_20220929_211123 Screenshot_20220929_211138 Screenshot_20220929_211201

Params

CURVE_V2_A = 400000 / 10**18
CURVE_V2_GAMMA = 145000000000000 / 10**18
CURVE_V2_MID_FEE = 26000000 / 10**10
CURVE_V2_OUT_FEE = 45000000 / 10**10
CURVE_V2_ALLOWED_EXTRA_PROFIT = 2000000000000 / 10**18
CURVE_V2_FEE_GAMMA = 230000000000000 / 10**18
CURVE_V2_ADJUSTMENT_STEP = 146000000000000 / 10**18
CURVE_V2_ADMIN_FEE = 5000000000 / 10**18
CURVE_V2_MA_HALF_TIME = 25
CURVE_V2_INITIAL_PRICE = INITIAL_BTKN_PRICE
bingen commented 1 year ago

Adding charts for slippage:

Less volatile assets (like cvxFXS pool above)

Screenshot_20221003_132051

Volatile assets

Screenshot_20221003_132041

bingen commented 1 year ago

Parameters can be changed after deployment:

Screenshot_20221003_132526 Screenshot_20221003_132604 Screenshot_20221003_132632 Screenshot_20221003_132655

This the factory admin contract:

Screenshot_20221003_132808

(It should be done by Curve DAO: parameter admin)