1
+ Feature : Spot market SLA
2
+
3
+ Scenario : 001 0044-LIME-054,For a market that is in opening auction and LP has committed liquidity:
4
+ #- When a LP increases their commitment then:
5
+ # - It takes effect immediately for the purposes of LP stake supplied to the market
6
+ # - In terms of the liquidity they are expected to supply: this only takes effect from the start of the next epoch
7
+ Given time is updated to "2023-07-20T00:00:00Z"
8
+
9
+ Given the fees configuration named "fees-config-1" :
10
+ | maker fee | infrastructure fee |
11
+ | 0 | 0 |
12
+ Given the log normal risk model named "lognormal-risk-model-1" :
13
+ | risk aversion | tau | mu | r | sigma |
14
+ | 0 .001 | 0 .01 | 0 | 0 .0 | 1 .2 |
15
+
16
+ And the price monitoring named "price-monitoring-1" :
17
+ | horizon | probability | auction extension |
18
+ | 360000 | 0 .999 | 300 |
19
+
20
+ And the liquidity sla params named "SLA-1" :
21
+ | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
22
+ | 1 | 0 .6 | 2 | 0 .2 |
23
+
24
+ Given the following assets are registered:
25
+ | id | decimal places |
26
+ | ETH | 1 |
27
+ | BTC | 1 |
28
+
29
+ And the following network parameters are set:
30
+ | name | value |
31
+ | network .markPriceUpdateMaximumFrequency | 2s |
32
+ | market .liquidity .earlyExitPenalty | 0 .25 |
33
+ | market .liquidity .bondPenaltyParameter | 0 .2 |
34
+ | market .liquidity .sla .nonPerformanceBondPenaltySlope | 0 .4 |
35
+ | market .liquidity .sla .nonPerformanceBondPenaltyMax | 0 .4 |
36
+ | market .liquidity .maximumLiquidityFeeFactorLevel | 0 .4 |
37
+ | validators .epoch .length | 4s |
38
+
39
+ And the spot markets:
40
+ | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | sla params |
41
+ | BTC /ETH | BTC /ETH | BTC | ETH | lognormal -risk -model -1 | 1 | fees -config -1 | price -monitoring -1 | SLA -1 |
42
+ And the following network parameters are set:
43
+ | name | value |
44
+ | market .liquidity .providersFeeCalculationTimeStep | 1s |
45
+ | market .liquidity .stakeToCcyVolume | 1 |
46
+
47
+ Given the parties deposit on asset's general account the following amount:
48
+ | party | asset | amount |
49
+ | party1 | ETH | 10000 |
50
+ | party2 | BTC | 500 |
51
+ | lp1 | ETH | 4000 |
52
+ | lp1 | BTC | 60 |
53
+ | lp2 | ETH | 4000 |
54
+ | lp2 | BTC | 60 |
55
+
56
+ And the average block duration is "1"
57
+
58
+ Given the liquidity monitoring parameters:
59
+ | name | triggering ratio | time window | scaling factor |
60
+ | updated -lqm -params | 0 .2 | 20s | 0 .8 |
61
+
62
+ When the spot markets are updated:
63
+ | id | liquidity monitoring | linear slippage factor | quadratic slippage factor |
64
+ | BTC /ETH | updated -lqm -params | 0 .5 | 0 .5 |
65
+
66
+ When the parties submit the following liquidity provision:
67
+ | id | party | market id | commitment amount | fee | lp type |
68
+ | lp1 | lp1 | BTC /ETH | 1000 | 0 .1 | submission |
69
+ | lp2 | lp2 | BTC /ETH | 2000 | 0 .1 | submission |
70
+
71
+ Then the network moves ahead "1" blocks
72
+ And the network treasury balance should be "0" for the asset "ETH"
73
+ Then the party "lp1" lp liquidity bond account balance should be "1000" for the market "BTC/ETH"
74
+ Then the party "lp2" lp liquidity bond account balance should be "2000" for the market "BTC/ETH"
75
+ And the supplied stake should be "3000" for the market "BTC/ETH"
76
+
77
+ Then the network moves ahead "1" blocks
78
+ And the network treasury balance should be "0" for the asset "ETH"
79
+ Then the party "lp1" lp liquidity bond account balance should be "1000" for the market "BTC/ETH"
80
+ Then the party "lp2" lp liquidity bond account balance should be "2000" for the market "BTC/ETH"
81
+ And the supplied stake should be "3000" for the market "BTC/ETH"
82
+
83
+ # # place orders and generate trades
84
+ And the parties place the following orders:
85
+ | party | market id | side | volume | price | resulting trades | type | tif | reference | only |
86
+ | party1 | BTC /ETH | buy | 6 | 8 | 0 | TYPE_LIMIT | TIF_GTC | party -order5 | |
87
+ | party1 | BTC /ETH | buy | 1 | 15 | 0 | TYPE_LIMIT | TIF_GTC | party -order3 | |
88
+ | party2 | BTC /ETH | sell | 1 | 15 | 0 | TYPE_LIMIT | TIF_GTC | party -order4 | |
89
+ | party2 | BTC /ETH | sell | 6 | 24 | 0 | TYPE_LIMIT | TIF_GTC | party -order6 | |
90
+
91
+ When the network moves ahead "2" blocks
92
+
93
+ Then the market data for the market "BTC/ETH" should be:
94
+ | mark price | trading mode | auction trigger | target stake | supplied stake | open interest |
95
+ | 15 | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 2400 | 3000 | 0 |
96
+
97
+ Then the network moves ahead "4" blocks
98
+ And the network treasury balance should be "1200" for the asset "ETH"
99
+ Then the party "lp1" lp liquidity bond account balance should be "600" for the market "BTC/ETH"
100
+ Then the party "lp2" lp liquidity bond account balance should be "1200" for the market "BTC/ETH"
101
+ And the supplied stake should be "1800" for the market "BTC/ETH"
0 commit comments