code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/0094-PRAC-007.feature (about)

     1  Feature: When a market's trigger or extension_trigger is set to represent a governance suspension then no other triggers can affect the market. (0094-PRAC-007)
     2  
     3  
     4  
     5    Background:
     6      Given the following assets are registered:
     7        | id  | decimal places |
     8        | ETH | 5              |
     9      And the long block duration table is:
    10        | threshold | duration |
    11        | 3s        | 1m       |
    12        | 40s       | 10m      |
    13        | 2m        | 1h       |
    14      And the simple risk model named "my-simple-risk-model":
    15        | long                   | short                  | max move up | min move down | probability of trading |
    16        | 0.08628781058136630000 | 0.09370922348428490000 | -1          | -1            | 0.2                    |
    17      And the fees configuration named "my-fees-config":
    18        | maker fee | infrastructure fee |
    19        | 0.004     | 0.001              |
    20      # create 2 markets
    21      And the markets:
    22        | id        | quote name | asset | risk model           | margin calculator         | auction duration | fees           | price monitoring | data source config     | decimal places | linear slippage factor | quadratic slippage factor | sla params      |
    23        | ETH/DEC19 | ETH        | ETH   | my-simple-risk-model | default-margin-calculator | 1                | my-fees-config | default-none     | default-eth-for-future | 2              | 0.25                   | 0                         | default-futures |
    24        | ETH/DEC20 | ETH        | ETH   | my-simple-risk-model | default-margin-calculator | 1                | my-fees-config | default-none     | default-eth-for-future | 2              | 0.25                   | 0                         | default-futures |
    25      And the following network parameters are set:
    26        | name                           | value |
    27        | limits.markets.maxPeggedOrders | 2     |
    28      And the average block duration is "1"
    29      And the parties deposit on asset's general account the following amount:
    30        | party   | asset | amount        |
    31        | party1  | ETH   | 1000000000000 |
    32        | party2  | ETH   | 1000000000000 |
    33        | party3  | ETH   | 1000000000000 |
    34        | party4  | ETH   | 1000000000000 |
    35        | lpprov1 | ETH   | 1000000000000 |
    36        | lpprov2 | ETH   | 1000000000000 |
    37      And the parties submit the following liquidity provision:
    38        | id  | party   | market id | commitment amount | fee | lp type    |
    39        | lp1 | lpprov1 | ETH/DEC20 | 937000000         | 0.1 | submission |
    40        | lp2 | lpprov2 | ETH/DEC19 | 937000000         | 0.1 | submission |
    41      And the parties place the following pegged iceberg orders:
    42        | party   | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
    43        | lpprov1 | ETH/DEC20 | 2         | 1                    | buy  | BID              | 50     | 100    |
    44        | lpprov1 | ETH/DEC20 | 2         | 1                    | sell | ASK              | 50     | 100    |
    45        | lpprov2 | ETH/DEC19 | 2         | 1                    | buy  | MID              | 50     | 100    |
    46        | lpprov2 | ETH/DEC19 | 2         | 1                    | sell | MID              | 50     | 100    |
    47  
    48    @LBA
    49    Scenario: 0094-PRAC-007: market suspended via governance is unaffected by long block auction triggers.
    50      # place orders and generate trades - slippage 100
    51      When the parties place the following orders:
    52        | party  | market id | side | volume | price   | resulting trades | type       | tif     | reference |
    53        | party1 | ETH/DEC20 | buy  | 1      | 999500  | 0                | TYPE_LIMIT | TIF_GTC | t1-b-1    |
    54        | party1 | ETH/DEC20 | buy  | 1      | 1000000 | 0                | TYPE_LIMIT | TIF_GFA | t1-b-2    |
    55        | party2 | ETH/DEC20 | sell | 2      | 1000000 | 0                | TYPE_LIMIT | TIF_GTC | t2-s-1    |
    56        | party3 | ETH/DEC19 | buy  | 1      | 999500  | 0                | TYPE_LIMIT | TIF_GTC | t3-b-1    |
    57        | party3 | ETH/DEC19 | buy  | 1      | 1000000 | 0                | TYPE_LIMIT | TIF_GTC | t3-b-2    |
    58        | party4 | ETH/DEC19 | sell | 2      | 1000000 | 0                | TYPE_LIMIT | TIF_GTC | t4-s-1    |
    59      Then the market data for the market "ETH/DEC20" should be:
    60        | trading mode                 | supplied stake | target stake |
    61        | TRADING_MODE_OPENING_AUCTION | 937000000      | 937000000    |
    62      And the market data for the market "ETH/DEC19" should be:
    63        | trading mode                 | supplied stake | target stake |
    64        | TRADING_MODE_OPENING_AUCTION | 937000000      | 937000000    |
    65  
    66      When the network moves ahead "2" blocks
    67      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
    68      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"
    69      #And debug detailed orderbook volumes for market "ETH/DEC20"
    70      And the order book should have the following volumes for market "ETH/DEC20":
    71        | volume | price   | side |
    72        | 2      | 999400  | buy  |
    73        | 1      | 999500  | buy  |
    74        | 1      | 1000000 | sell |
    75        | 2      | 1000100 | sell |
    76      #And debug detailed orderbook volumes for market "ETH/DEC19"
    77      And the order book should have the following volumes for market "ETH/DEC19":
    78        | volume | price   | side |
    79        | 1      | 999500  | buy  |
    80        | 2      | 999650  | buy  |
    81        | 2      | 999850  | sell |
    82        | 1      | 1000000 | sell |
    83  
    84      And the following trades should be executed:
    85        | buyer  | price   | size | seller |
    86        | party1 | 1000000 | 1    | party2 |
    87        | party3 | 1000000 | 1    | party4 |
    88      And the mark price should be "1000000" for the market "ETH/DEC20"
    89      And the mark price should be "1000000" for the market "ETH/DEC19"
    90  
    91      When the market states are updated through governance:
    92        | market id | state                            |
    93        | ETH/DEC20 | MARKET_STATE_UPDATE_TYPE_SUSPEND |
    94  
    95      When the previous block duration was "90s"
    96      Then the trading mode should be "TRADING_MODE_SUSPENDED_VIA_GOVERNANCE" for the market "ETH/DEC20"
    97      And the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC19"
    98  
    99      # We know what the volume on the books look like, but let's submit some orders that will trade regardless
   100      # And we'll see no trades happen
   101      When the parties place the following orders:
   102        | party  | market id | side | volume | price  | resulting trades | type       | tif     | reference |
   103        | party1 | ETH/DEC20 | buy  | 1      | 999999 | 0                | TYPE_LIMIT | TIF_GTC | t1-b-3    |
   104        | party2 | ETH/DEC20 | sell | 1      | 999999 | 0                | TYPE_LIMIT | TIF_GTC | t2-s-2    |
   105        | party3 | ETH/DEC19 | buy  | 1      | 999999 | 0                | TYPE_LIMIT | TIF_GTC | t3-b-3    |
   106        | party4 | ETH/DEC19 | sell | 1      | 999999 | 0                | TYPE_LIMIT | TIF_GTC | t4-s-2    |
   107      Then the trading mode should be "TRADING_MODE_SUSPENDED_VIA_GOVERNANCE" for the market "ETH/DEC20"
   108      And the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC19"
   109  
   110      When the network moves ahead "1s" with block duration of "1s"
   111      And the market states are updated through governance:
   112        | market id | state                           |
   113        | ETH/DEC20 | MARKET_STATE_UPDATE_TYPE_RESUME |
   114      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
   115  
   116      When the network moves ahead "9m50s" with block duration of "2s"
   117      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
   118      And the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC19"
   119  
   120      # still in auction, 10 seconds later, though:
   121      When the network moves ahead "11" blocks
   122      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
   123      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"
   124      And the following trades should be executed:
   125        | buyer  | price  | size | seller |
   126        | party1 | 999999 | 1    | party2 |
   127        | party3 | 999999 | 1    | party4 |
   128