code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/liquidity-uncross.feature (about)

     1  Feature: Ensure we don't uncross when leaving liquidity auction
     2  
     3    Background:
     4      Given the following assets are registered:
     5        | id  | decimal places |
     6        | ETH | 5              |
     7      And the markets:
     8        | 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      |
     9        | ETH/DEC19 | ETH        | ETH   | default-simple-risk-model-3 | default-margin-calculator | 1                | default-none | default-none     | default-eth-for-future | 2              | 0.01                   | 0                         | default-futures |
    10      And the following network parameters are set:
    11        | name                           | value |
    12        | market.auction.minimumDuration | 1     |
    13        | limits.markets.maxPeggedOrders | 2     |
    14  
    15  
    16    @Panic @SLABug
    17    Scenario:
    18      Given the parties deposit on asset's general account the following amount:
    19        | party            | asset | amount    |
    20        | party1           | ETH   | 100000000 |
    21        | party2           | ETH   | 100000000 |
    22        | sellSideProvider | ETH   | 100000000 |
    23        | buySideProvider  | ETH   | 100000000 |
    24        | auxiliary        | ETH   | 100000000 |
    25        | aux2             | ETH   | 100000000 |
    26  
    27      # submit our LP
    28      Then the parties submit the following liquidity provision:
    29        | id  | party  | market id | commitment amount | fee | lp type    |
    30        | lp1 | party1 | ETH/DEC19 | 300000            | 0.1 | submission |
    31        | lp1 | party1 | ETH/DEC19 | 300000            | 0.1 | submission |
    32      And the parties place the following pegged iceberg orders:
    33        | party  | market id | peak size | minimum visible size | side | pegged reference | volume     | offset |
    34        | party1 | ETH/DEC19 | 2         | 1                    | buy  | MID              | 1          | 21     |
    35        | party1 | ETH/DEC19 | 2         | 1                    | sell | MID              | 1          | 21     |
    36   
    37      # get out of auction
    38      When the parties place the following orders:
    39        | party     | market id | side | volume | price | resulting trades | type       | tif     | reference |
    40        | auxiliary | ETH/DEC19 | buy  | 1      | 80    | 0                | TYPE_LIMIT | TIF_GTC | oa-b-1    |
    41        | auxiliary | ETH/DEC19 | sell | 1      | 120   | 0                | TYPE_LIMIT | TIF_GTC | oa-s-1    |
    42        | aux2      | ETH/DEC19 | buy  | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | oa-b-2    |
    43        | auxiliary | ETH/DEC19 | sell | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | oa-s-2    |
    44      Then the opening auction period ends for market "ETH/DEC19"
    45      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"
    46  
    47      # now consume all the volume on the sell side
    48      When the parties place the following orders:
    49        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference |
    50        | party1 | ETH/DEC19 | buy  | 1      | 120   | 1                | TYPE_LIMIT | TIF_GTC | t1-1      |
    51      And the network moves ahead "1" blocks
    52  
    53      # enter price monitoring auction
    54      #Then the market state should be "STATE_SUSPENDED" for the market "ETH/DEC19"
    55      #And the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC19"
    56  
    57  
    58      # now we move add back some volume
    59      When the parties place the following orders:
    60        | party     | market id | side | volume | price | resulting trades | type       | tif     | reference |
    61        | auxiliary | ETH/DEC19 | sell | 10     | 120   | 0                | TYPE_LIMIT | TIF_GTC | t1-2      |
    62      # now update the time to get the market out of auction
    63      And time is updated to "2019-12-01T00:00:00Z"
    64      # leave price monitoring auction
    65      Then the market state should be "STATE_ACTIVE" for the market "ETH/DEC19"
    66      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"