code.vegaprotocol.io/vega@v0.79.0/core/integration/features/mark-price/0032-PRIM-040.feature (about)

     1  Feature: Test the mark price update candidate gets rejected if it violates the price monitoring engine bounds.
     2    Background:
     3      Given the following network parameters are set:
     4        | name                                    | value |
     5        | network.markPriceUpdateMaximumFrequency | 4s    |
     6  
     7      And the liquidity monitoring parameters:
     8        | name       | triggering ratio | time window | scaling factor |
     9        | lqm-params | 0.00             | 24h         | 1e-9           |
    10      And the simple risk model named "simple-risk-model":
    11        | long | short | max move up | min move down | probability of trading |
    12        | 0.1  | 0.1   | 100         | -100          | 0.2                    |
    13      And the price monitoring named "my-price-monitoring":
    14        | horizon | probability | auction extension |
    15        | 36000   | 0.95        | 1                 |
    16  
    17      And the composite price oracles from "0xCAFECAFE1":
    18        | name    | price property   | price type   | price decimals |
    19        | oracle1 | price1.USD.value | TYPE_INTEGER | 0              |
    20  
    21      And the markets:
    22        | 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      | price type | decay weight | decay power | cash amount | source weights | source staleness tolerance | oracle1 | market type |
    23        | ETH/FEB23 | ETH        | USD   | lqm-params           | simple-risk-model | default-margin-calculator | 1                | default-none | my-price-monitoring | default-eth-for-future | 0.25                   | 0                         | default-futures | weight     | 0            | 1           | 20000       | 1,0,0,0        | 5s,20s,20s,1h25m0s         | oracle1 | future      |
    24  
    25    Scenario: 0032-PRIM-040
    26      Given the parties deposit on asset's general account the following amount:
    27        | party            | asset | amount       |
    28        | buySideProvider  | USD   | 100000000000 |
    29        | sellSideProvider | USD   | 100000000000 |
    30        | party            | USD   | 48050        |
    31  
    32      And the parties place the following orders:
    33        | party            | market id | side | volume | price | resulting trades | type       | tif     | reference |
    34        | buySideProvider  | ETH/FEB23 | buy  | 3      | 15900 | 0                | TYPE_LIMIT | TIF_GTC |           |
    35        | party            | ETH/FEB23 | sell | 3      | 15900 | 0                | TYPE_LIMIT | TIF_GTC |           |
    36        | sellSideProvider | ETH/FEB23 | sell | 2      | 18000 | 0                | TYPE_LIMIT | TIF_GTC |           |
    37  
    38      When the network moves ahead "2" blocks
    39      # leaving opening auction
    40      Then the market data for the market "ETH/FEB23" should be:
    41        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    42        | 15900      | TRADING_MODE_CONTINUOUS | 36000   | 15801     | 15999     | 0            | 0              | 3             |
    43  
    44      When the network moves ahead "1" blocks
    45      #create traded price 18000 which is outside price monitoring bounds
    46      And the parties place the following orders:
    47        | party           | market id | side | volume | price | resulting trades | type       | tif     | reference |
    48        | buySideProvider | ETH/FEB23 | buy  | 1      | 18000 | 0                | TYPE_LIMIT | TIF_GTC |           |
    49  
    50      Then the market data for the market "ETH/FEB23" should be:
    51        | mark price | trading mode                    |
    52        | 15900      | TRADING_MODE_MONITORING_AUCTION |
    53      When the network moves ahead "2" blocks
    54  
    55      Then the market data for the market "ETH/FEB23" should be:
    56        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    57        | 18000      | TRADING_MODE_CONTINUOUS | 36000   | 17900     | 18100     | 0            | 0              | 4             |
    58  
    59      And the parties place the following orders:
    60        | party            | market id | side | volume | price | resulting trades | type       | tif     | reference |
    61        | buySideProvider  | ETH/FEB23 | buy  | 1      | 15900 | 0                | TYPE_LIMIT | TIF_GTC |           |
    62        | sellSideProvider | ETH/FEB23 | sell | 1      | 15900 | 0                | TYPE_LIMIT | TIF_GTC |           |
    63  
    64      Then the market data for the market "ETH/FEB23" should be:
    65        | mark price | trading mode                    |
    66        | 18000      | TRADING_MODE_MONITORING_AUCTION |
    67      When the network moves ahead "4" blocks
    68  
    69      #mark price 18000 which is outside the price monitoring bounds is rejected in mark price calculation
    70      Then the market data for the market "ETH/FEB23" should be:
    71        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    72        | 15900      | TRADING_MODE_CONTINUOUS | 36000   | 15801     | 15999     | 0            | 0              | 5             |
    73