code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/enter-leave-liquidity-auction.feature (about) 1 Feature: Ensure we can enter and leave liquidity auction 2 3 Background: 4 Given the liquidity monitoring parameters: 5 | name | triggering ratio | time window | scaling factor | 6 | lqm-params | 1.0 | 20s | 1.0 | 7 8 Given the following network parameters are set: 9 | name | value | 10 | market.auction.minimumDuration | 1 | 11 | limits.markets.maxPeggedOrders | 1500 | 12 And the markets: 13 | id | quote name | asset | liquidity monitoring | risk model | margin calculator | auction duration | fees | price monitoring | data source config | linear slippage factor | quadratic slippage factor | sla params | 14 | ETH/DEC19 | ETH | ETH | lqm-params | default-simple-risk-model-3 | default-margin-calculator | 1 | default-none | default-none | default-eth-for-future | 0.01 | 0 | default-futures | 15 16 17 18 @SLABug 19 Scenario: 001, LP only provides LP orders 20 Given the parties deposit on asset's general account the following amount: 21 | party | asset | amount | 22 | party1 | ETH | 100000000 | 23 | sellSideProvider | ETH | 100000000 | 24 | buySideProvider | ETH | 100000000 | 25 | auxiliary | ETH | 100000000 | 26 | aux2 | ETH | 100000000 | 27 28 # submit our LP 29 Then the parties submit the following liquidity provision: 30 | id | party | market id | commitment amount | fee | lp type | 31 | lp1 | party1 | ETH/DEC19 | 3000 | 0.1 | submission | 32 | lp1 | party1 | ETH/DEC19 | 3000 | 0.1 | submission | 33 And the parties place the following pegged iceberg orders: 34 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 35 | party1 | ETH/DEC19 | 2 | 1 | buy | BID | 50 | 10 | 36 | party1 | ETH/DEC19 | 2 | 1 | sell | ASK | 50 | 10 | 37 38 # get out of auction 39 When the parties place the following orders: 40 | party | market id | side | volume | price | resulting trades | type | tif | reference | 41 | auxiliary | ETH/DEC19 | buy | 20 | 80 | 0 | TYPE_LIMIT | TIF_GTC | oa-b-1 | 42 | auxiliary | ETH/DEC19 | sell | 20 | 120 | 0 | TYPE_LIMIT | TIF_GTC | oa-s-1 | 43 | aux2 | ETH/DEC19 | buy | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | oa-b-2 | 44 | auxiliary | ETH/DEC19 | sell | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | oa-s-2 | 45 Then the opening auction period ends for market "ETH/DEC19" 46 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 47 48 # add a few pegged orders now 49 Then the parties place the following pegged orders: 50 | party | market id | side | volume | pegged reference | offset | 51 | aux2 | ETH/DEC19 | sell | 10 | ASK | 9 | 52 | aux2 | ETH/DEC19 | buy | 5 | BID | 9 | 53 54 # now consume all the volume on the sell side 55 When the parties place the following orders: 56 | party | market id | side | volume | price | resulting trades | type | tif | reference | 57 | party1 | ETH/DEC19 | buy | 20 | 120 | 1 | TYPE_LIMIT | TIF_GTC | t1-1 | 58 And the network moves ahead "1" blocks 59 60 # enter price monitoring auction 61 Then the market state should be "STATE_ACTIVE" for the market "ETH/DEC19" 62 63 64 # now we move add back some volume 65 When the parties place the following orders: 66 | party | market id | side | volume | price | resulting trades | type | tif | reference | 67 | aux2 | ETH/DEC19 | sell | 20 | 120 | 0 | TYPE_LIMIT | TIF_GTC | t1-1 | 68 69 # now update the time to get the market out of auction 70 Given time is updated to "2019-12-01T00:00:00Z" 71 # leave price monitoring auction 72 Then the market state should be "STATE_ACTIVE" for the market "ETH/DEC19" 73 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 74 75 @SLABug 76 Scenario: 002, LP provides LP orders and also limit orders 77 Given the parties deposit on asset's general account the following amount: 78 | party | asset | amount | 79 | party1 | ETH | 100000000 | 80 | sellSideProvider | ETH | 100000000 | 81 | buySideProvider | ETH | 100000000 | 82 | auxiliary | ETH | 100000000 | 83 | aux2 | ETH | 100000000 | 84 85 # submit our LP 86 Then the parties submit the following liquidity provision: 87 | id | party | market id | commitment amount | fee | lp type | 88 | lp1 | aux2 | ETH/DEC19 | 3000 | 0.1 | submission | 89 | lp1 | aux2 | ETH/DEC19 | 3000 | 0.1 | submission | 90 And the parties place the following pegged iceberg orders: 91 | party | market id | peak size | minimum visible size |side | pegged reference | volume | offset | 92 | aux2 | ETH/DEC19 | 2 | 1 |buy | BID | 50 | 10 | 93 | aux2 | ETH/DEC19 | 2 | 1 |sell | ASK | 50 | 10 | 94 95 # get out of auction 96 When the parties place the following orders: 97 | party | market id | side | volume | price | resulting trades | type | tif | reference | 98 | aux2 | ETH/DEC19 | buy | 20 | 80 | 0 | TYPE_LIMIT | TIF_GTC | oa-b-1 | 99 | aux2 | ETH/DEC19 | sell | 20 | 120 | 0 | TYPE_LIMIT | TIF_GTC | oa-s-1 | 100 | aux2 | ETH/DEC19 | buy | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | oa-b-2 | 101 | auxiliary | ETH/DEC19 | sell | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | oa-s-2 | 102 Then the opening auction period ends for market "ETH/DEC19" 103 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 104 105 # add a few pegged orders now 106 Then the parties place the following pegged orders: 107 | party | market id | side | volume | pegged reference | offset | 108 | aux2 | ETH/DEC19 | sell | 10 | ASK | 9 | 109 | aux2 | ETH/DEC19 | buy | 5 | BID | 9 | 110 111 # now consume all the volume on the sell side 112 When the parties place the following orders: 113 | party | market id | side | volume | price | resulting trades | type | tif | reference | 114 | party1 | ETH/DEC19 | buy | 20 | 120 | 1 | TYPE_LIMIT | TIF_GTC | t1-1 | 115 And the network moves ahead "1" blocks 116 117 # enter price monitoring auction 118 #Then the market state should be "STATE_SUSPENDED" for the market "ETH/DEC19" 119 #And the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC19" 120 121 122 # now we move add back some volume 123 When the parties place the following orders: 124 | party | market id | side | volume | price | resulting trades | type | tif | reference | 125 | aux2 | ETH/DEC19 | sell | 20 | 120 | 0 | TYPE_LIMIT | TIF_GTC | t1-1 | 126 127 # now update the time to get the market out of auction 128 Given time is updated to "2019-12-01T00:00:00Z" 129 # leave price monitoring auction 130 Then the market state should be "STATE_ACTIVE" for the market "ETH/DEC19" 131 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 132 133 134 @LPOA @SLABug 135 Scenario: 003, we do not leave opening auction unless target stake is reached 136 Given the parties deposit on asset's general account the following amount: 137 | party | asset | amount | 138 | party1 | ETH | 100000000 | 139 | sellSideProvider | ETH | 100000000 | 140 | buySideProvider | ETH | 100000000 | 141 | auxiliary | ETH | 100000000 | 142 | aux2 | ETH | 100000000 | 143 144 # submit our LP, amount is 1 145 Then the parties submit the following liquidity provision: 146 | id | party | market id | commitment amount | fee | lp type | 147 | lp1 | party1 | ETH/DEC19 | 1 | 0.1 | submission | 148 And the parties place the following pegged iceberg orders: 149 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 150 | party1 | ETH/DEC19 | 2 | 1 | buy | BID | 50 | 10 | 151 | party1 | ETH/DEC19 | 2 | 1 | sell | ASK | 50 | 10 | 152 # get out of auction 153 When the parties place the following orders: 154 | party | market id | side | volume | price | resulting trades | type | tif | reference | 155 | auxiliary | ETH/DEC19 | buy | 20 | 80 | 0 | TYPE_LIMIT | TIF_GTC | oa-b-1 | 156 | auxiliary | ETH/DEC19 | sell | 20 | 120 | 0 | TYPE_LIMIT | TIF_GTC | oa-s-1 | 157 | aux2 | ETH/DEC19 | buy | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | oa-b-2 | 158 | auxiliary | ETH/DEC19 | sell | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | oa-s-2 | 159 Then the opening auction period ends for market "ETH/DEC19" 160 161 # Amend LP, set the commitment amount to be enough to leave opening auction 162 When the parties submit the following liquidity provision: 163 | id | party | market id | commitment amount | fee | lp type | 164 | lp1 | party1 | ETH/DEC19 | 30000 | 0.1 | amendment | 165 And the parties place the following pegged iceberg orders: 166 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 167 | party1 | ETH/DEC19 | 2 | 1 | buy | BID | 50 | 10 | 168 | party1 | ETH/DEC19 | 2 | 1 | sell | ASK | 50 | 10 | 169 Then the market data for the market "ETH/DEC19" should be: 170 | trading mode | supplied stake | target stake | 171 | TRADING_MODE_CONTINUOUS | 30000 | 11 | 172 173 # after updating the LP, we now can leave opening auction 174 When the network moves ahead "3" blocks 175 Then the market data for the market "ETH/DEC19" should be: 176 | mark price | trading mode | supplied stake | target stake | 177 | 100 | TRADING_MODE_CONTINUOUS | 30000 | 11 | 178 179 # add a few pegged orders now 180 Then the parties place the following pegged orders: 181 | party | market id | side | volume | pegged reference | offset | 182 | aux2 | ETH/DEC19 | sell | 10 | ASK | 9 | 183 | aux2 | ETH/DEC19 | buy | 5 | BID | 9 | 184 185 # now consume all the volume on the sell side 186 When the parties place the following orders: 187 | party | market id | side | volume | price | resulting trades | type | tif | reference | 188 | party1 | ETH/DEC19 | buy | 20 | 120 | 1 | TYPE_LIMIT | TIF_GTC | t1-1 | 189 And the network moves ahead "1" blocks 190 191 # enter price monitoring auction 192 #Then the market state should be "STATE_SUSPENDED" for the market "ETH/DEC19" 193 #And the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC19" 194 195 When the parties submit the following liquidity provision: 196 | id | party | market id | commitment amount | fee | reference | lp type | 197 | lp1 | party1 | ETH/DEC19 | 3000 | 0.1 | lp1 | amendment | 198 And the parties place the following pegged iceberg orders: 199 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 200 | party1 | ETH/DEC19 | 2 | 1 | buy | BID | 50 | 10 | 201 | party1 | ETH/DEC19 | 2 | 1 | sell | ASK | 50 | 10 | 202 203 # now we move add back some volume 204 When the parties place the following orders: 205 | party | market id | side | volume | price | resulting trades | type | tif | reference | 206 | aux2 | ETH/DEC19 | sell | 20 | 120 | 0 | TYPE_LIMIT | TIF_GTC | t1-1 | 207 208 # now update the time to get the market out of auction 209 Given time is updated to "2019-12-01T00:00:00Z" 210 # leave price monitoring auction 211 Then the market state should be "STATE_ACTIVE" for the market "ETH/DEC19" 212 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"