code.vegaprotocol.io/vega@v0.79.0/core/integration/features/price_monitoring/3362-failing-system-tests-trigger-close-out.feature (about)

     1  Feature: Replicate failing system tests after changes to price monitoring (not triggering with FOK orders, auction duration)
     2  
     3    Background:
     4      Given time is updated to "2020-10-16T00:00:00Z"
     5      And the price monitoring named "my-price-monitoring":
     6        | horizon | probability | auction extension |
     7        | 5       | 0.95        | 6                 |
     8        | 10      | 0.99        | 8                 |
     9      And the log normal risk model named "my-log-normal-risk-model":
    10        | risk aversion | tau                    | mu | r     | sigma |
    11        | 0.000001      | 0.00011407711613050422 | 0  | 0.016 | 2.0   |
    12      And the markets:
    13        | id        | quote name | asset | risk model               | margin calculator         | auction duration | fees         | price monitoring    | data source config     | linear slippage factor | quadratic slippage factor | sla params      |
    14        | ETH/DEC20 | ETH        | ETH   | my-log-normal-risk-model | default-margin-calculator | 1                | default-none | my-price-monitoring | default-eth-for-future | 0.01                   | 0                         | default-futures |
    15      And the following network parameters are set:
    16        | name                                    | value |
    17        | market.auction.minimumDuration          | 1     |
    18        | limits.markets.maxPeggedOrders          | 1500  |
    19        | network.markPriceUpdateMaximumFrequency | 0s    |
    20        | limits.markets.maxPeggedOrders          | 2     |
    21      And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC20"
    22  
    23    Scenario: Replicate test called test_TriggerWithMarketOrder
    24      Given the parties deposit on asset's general account the following amount:
    25        | party   | asset | amount    |
    26        | party1  | ETH   | 100000000 |
    27        | party2  | ETH   | 100000000 |
    28        | party3  | ETH   | 100000000 |
    29        | party4  | ETH   | 800000    |
    30        | partyLP | ETH   | 100000000 |
    31        | aux     | ETH   | 100000000 |
    32  
    33      When the parties place the following orders:
    34        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    35        | party1 | ETH/DEC20 | buy  | 1      | 100000 | 0                | TYPE_LIMIT | TIF_GFA |
    36        | party2 | ETH/DEC20 | sell | 1      | 100000 | 0                | TYPE_LIMIT | TIF_GFA |
    37        | party1 | ETH/DEC20 | buy  | 5      | 95000  | 0                | TYPE_LIMIT | TIF_GTC |
    38        | party2 | ETH/DEC20 | sell | 5      | 107000 | 0                | TYPE_LIMIT | TIF_GTC |
    39        | party1 | ETH/DEC20 | buy  | 1      | 95000  | 0                | TYPE_LIMIT | TIF_GTC |
    40        | party2 | ETH/DEC20 | sell | 1      | 107000 | 0                | TYPE_LIMIT | TIF_GTC |
    41      And the parties submit the following liquidity provision:
    42        | id  | party  | market id | commitment amount | fee | lp type    |
    43        | lp1 | party1 | ETH/DEC20 | 16000000          | 0.3 | submission |
    44        | lp1 | party1 | ETH/DEC20 | 16000000          | 0.3 | amendment  |
    45      And the parties place the following pegged iceberg orders:
    46        | party  | market id | peak size | minimum visible size | side | pegged reference | volume     | offset |
    47        | party1 | ETH/DEC20 | 2         | 1                    | buy  | BID              | 2          | 10     |
    48        | party1 | ETH/DEC20 | 2         | 1                    | sell | ASK              | 13         | 10     |
    49   
    50      Then the mark price should be "0" for the market "ETH/DEC20"
    51      And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC20"
    52  
    53      When the opening auction period ends for market "ETH/DEC20"
    54      Then the mark price should be "100000" for the market "ETH/DEC20"
    55  
    56  
    57      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
    58  
    59      ## price bounds are 99711 - 99845 - 100156 - 100290
    60      When the parties place the following orders with ticks:
    61        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    62        | party2 | ETH/DEC20 | sell | 15     | 107500 | 0                | TYPE_LIMIT | TIF_GTC |
    63        | party1 | ETH/DEC20 | buy  | 10     | 107100 | 0                | TYPE_LIMIT | TIF_GTC |
    64      Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC20"
    65      And the mark price should be "100000" for the market "ETH/DEC20"
    66  
    67      When the parties place the following orders with ticks:
    68        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    69        | party3 | ETH/DEC20 | buy  | 10     | 107300 | 0                | TYPE_LIMIT | TIF_GTC |
    70        | party2 | ETH/DEC20 | sell | 10     | 107100 | 0                | TYPE_LIMIT | TIF_GTC |
    71      Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC20"
    72      And the mark price should be "100000" for the market "ETH/DEC20"
    73  
    74      When time is updated to "2020-10-16T00:00:09Z"
    75      Then the market data for the market "ETH/DEC20" should be:
    76        | mark price | trading mode                    | auction trigger       | extension trigger     | auction end |
    77        | 100000     | TRADING_MODE_MONITORING_AUCTION | AUCTION_TRIGGER_PRICE | AUCTION_TRIGGER_PRICE | 14          |
    78      When time is updated to "2020-10-16T00:00:18Z"
    79      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
    80      And the mark price should be "107100" for the market "ETH/DEC20"
    81  
    82      When the parties place the following orders with ticks:
    83        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    84        | party4 | ETH/DEC20 | buy  | 50     | 107500 | 0                | TYPE_LIMIT | TIF_GTC |
    85      Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC20"
    86      And the mark price should be "107100" for the market "ETH/DEC20"
    87  
    88      When the parties place the following orders with ticks:
    89        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    90        | party3 | ETH/DEC20 | buy  | 70     | 106000 | 0                | TYPE_LIMIT | TIF_GFA |
    91      And the parties place the following pegged orders:
    92        | party  | market id | side | volume | pegged reference | offset |
    93        | party4 | ETH/DEC20 | buy  | 35     | BID              | 1000   |
    94        | party4 | ETH/DEC20 | sell | 35     | ASK              | 3000   |
    95      And the parties place the following orders with ticks:
    96        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    97        | party2 | ETH/DEC20 | sell | 80     | 105000 | 0                | TYPE_LIMIT | TIF_GTC |
    98        | party3 | ETH/DEC20 | buy  | 81     | 106000 | 0                | TYPE_LIMIT | TIF_GFA |
    99        | party3 | ETH/DEC20 | buy  | 86     | 107000 | 0                | TYPE_LIMIT | TIF_GTC |
   100      And the parties place the following pegged orders:
   101        | party  | market id | side | volume | pegged reference | offset |
   102        | party1 | ETH/DEC20 | buy  | 100    | BID              | 5000   |
   103        | party2 | ETH/DEC20 | sell | 95     | ASK              | 1000   |
   104      Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC20"
   105      And the mark price should be "107100" for the market "ETH/DEC20"
   106  
   107      # Need to update time twice so that 2nd bound gets activated when attempting to leave the auction after first trigger extension elapses
   108      When time is updated to "2020-10-16T00:00:25Z"
   109      When time is updated to "2020-10-16T00:00:33Z"
   110      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
   111      And the mark price should be "106000" for the market "ETH/DEC20"