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

     1  Feature: Replicate failing system tests after changes to price monitoring (trigger lower bounds)
     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.25                   | 0                         | default-futures |
    15      And the following network parameters are set:
    16        | name                                    | value |
    17        | market.auction.minimumDuration          | 1     |
    18        | network.markPriceUpdateMaximumFrequency | 0s    |
    19        | limits.markets.maxPeggedOrders          | 2     |
    20      And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC20"
    21  
    22    Scenario: Replicate test called test_TriggerWithLowerBounds
    23      Given the parties deposit on asset's general account the following amount:
    24        | party   | asset | amount    |
    25        | party1  | ETH   | 100000000 |
    26        | party2  | ETH   | 100000000 |
    27        | party3  | ETH   | 100000000 |
    28        | partyLP | ETH   | 100000000 |
    29        | aux     | ETH   | 100000000 |
    30  
    31      When the parties place the following orders:
    32        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    33        | party1 | ETH/DEC20 | buy  | 1      | 100000 | 0                | TYPE_LIMIT | TIF_GFA |
    34        | party2 | ETH/DEC20 | sell | 1      | 100000 | 0                | TYPE_LIMIT | TIF_GFA |
    35        | party1 | ETH/DEC20 | buy  | 5      | 95000  | 0                | TYPE_LIMIT | TIF_GTC |
    36        | party2 | ETH/DEC20 | sell | 5      | 107000 | 0                | TYPE_LIMIT | TIF_GTC |
    37        | party1 | ETH/DEC20 | buy  | 1      | 95000  | 0                | TYPE_LIMIT | TIF_GTC |
    38        | party2 | ETH/DEC20 | sell | 1      | 107000 | 0                | TYPE_LIMIT | TIF_GTC |
    39      And the parties submit the following liquidity provision:
    40        | id  | party  | market id | commitment amount | fee | lp type    |
    41        | lp1 | party1 | ETH/DEC20 | 16000000          | 0.3 | submission |
    42        | lp1 | party1 | ETH/DEC20 | 16000000          | 0.3 | amendment  |
    43      And the parties place the following pegged iceberg orders:
    44        | party  | market id | peak size | minimum visible size | side | pegged reference | volume     | offset |
    45        | party1 | ETH/DEC20 | 2         | 1                    | buy  | BID              | 2          | 10     |
    46        | party1 | ETH/DEC20 | 2         | 1                    | sell | ASK              | 13         | 10     |
    47      Then the mark price should be "0" for the market "ETH/DEC20"
    48      And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC20"
    49  
    50      When the opening auction period ends for market "ETH/DEC20"
    51      Then the mark price should be "100000" for the market "ETH/DEC20"
    52      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
    53      ## price bounds are 99771 to 100290
    54      When the parties place the following orders:
    55        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    56        | party1 | ETH/DEC20 | buy  | 1      | 100150 | 0                | TYPE_LIMIT | TIF_GTC |
    57        | party2 | ETH/DEC20 | sell | 1      | 100150 | 1                | TYPE_LIMIT | TIF_GTC |
    58      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
    59  
    60      # checking if continuous mode still exists
    61      Then the market data for the market "ETH/DEC20" should be:
    62        | mark price | last traded price | trading mode            |
    63        | 100000     | 100150            | TRADING_MODE_CONTINUOUS |
    64  
    65      ## This order should breach one price bound (price bounds are 100156 and 100290)
    66      When the parties place the following orders:
    67        | party  | market id | side | volume | price  | resulting trades | type       | tif     |
    68        | party2 | ETH/DEC20 | sell | 2      | 100160 | 0                | TYPE_LIMIT | TIF_GTC |
    69        | party1 | ETH/DEC20 | buy  | 1      | 100160 | 0                | TYPE_LIMIT | TIF_GTC |
    70      Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC20"
    71  
    72      # checking if continuous mode still exists
    73      Then the market data for the market "ETH/DEC20" should be:
    74        | mark price | last traded price | trading mode                    |
    75        | 100000     | 100150            | TRADING_MODE_MONITORING_AUCTION |
    76  
    77  
    78      # after opening auction, market time is 2020-10-16T00:00:02Z (00 seconds + 2x auction duration)
    79      # The price auction violated 1 bound, so the auction period was 6 seconds, meaning  the auction
    80      # lasts until 2020-10-16T00:00:08Z, update time to 1 second after:
    81      When time is updated to "2020-10-16T00:00:09Z"
    82      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20"
    83  
    84      Then the market data for the market "ETH/DEC20" should be:
    85        | mark price | last traded price | trading mode            |
    86        | 100160     | 100160            | TRADING_MODE_CONTINUOUS |