code.vegaprotocol.io/vega@v0.79.0/core/integration/features/mark-price/panic-upon-leaving-opening-auction.feature (about)

     1  Feature: Test setting of first mark price with bound violation
     2    Background:
     3      Given the following network parameters are set:
     4        | name                                    | value |
     5        | network.markPriceUpdateMaximumFrequency | 4s    |
     6        | limits.markets.maxPeggedOrders          | 2     |
     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 "price-monitoring":
    14        | horizon | probability | auction extension |
    15        | 5       | 0.99        | 3                 |
    16      And the composite price oracles from "0xCAFECAFE1":
    17        | name    | price property   | price type   | price decimals |
    18        | oracle1 | prices.ETH.value | TYPE_INTEGER | 0              |
    19      And the markets:
    20        | 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 |
    21        | ETH/FEB23 | ETH        | USD   | lqm-params           | simple-risk-model | default-margin-calculator | 5                | default-none | price-monitoring | default-eth-for-future | 0.25                   | 0                         | default-futures | weight     | 0.1          | 0.5         | 500000      | 0,0,1,0        | 0s,0s,24h0m0s,0s           | oracle1 | future      |
    22  
    23    Scenario: when mark price methodology hasn't provided a price at the point of uncrossing the opening auction (0009-MRKP-001,0009-MRKP-003)
    24      Given the parties deposit on asset's general account the following amount:
    25        | party             | asset | amount       |
    26        | buySideProvider   | USD   | 100000000000 |
    27        | sellSideProvider  | USD   | 100000000000 |
    28        | lp1               | USD   | 100000000000 |
    29      And the parties submit the following liquidity provision:
    30        | id  | party  | market id | commitment amount | fee   | lp type    |
    31        | lp1 | lp1    | ETH/FEB23 | 50000             | 0.001 | submission |
    32        | lp1 | lp1    | ETH/FEB23 | 50000             | 0.001 | amendment  |
    33      And the parties place the following pegged iceberg orders:
    34        | party | market id | peak size | minimum visible size | side | pegged reference | volume  | offset |
    35        | lp1   | ETH/FEB23 | 49        | 1                    | sell | ASK              | 49      | 20     |
    36        | lp1   | ETH/FEB23 | 52        | 1                    | buy  | BID              | 52      | 20     |
    37      And the parties place the following orders:
    38        | party             | market id | side | volume | price  | resulting trades | type       | tif     | reference    |
    39        | lp1               | ETH/FEB23 | buy  | 1      | 15899  | 0                | TYPE_LIMIT | TIF_GTC |              |
    40        | lp1               | ETH/FEB23 | sell | 1      | 15901  | 0                | TYPE_LIMIT | TIF_GTC |              |
    41        | buySideProvider   | ETH/FEB23 | buy  | 1      | 1      | 0                | TYPE_LIMIT | TIF_GTC |              |
    42        | buySideProvider   | ETH/FEB23 | buy  | 1      | 15900  | 0                | TYPE_LIMIT | TIF_GTC |              |
    43        | sellSideProvider  | ETH/FEB23 | sell | 1      | 15900  | 0                | TYPE_LIMIT | TIF_GTC |              |
    44        | sellSideProvider  | ETH/FEB23 | sell | 1      | 100000 | 0                | TYPE_LIMIT | TIF_GTC |              |
    45  
    46      When the network moves ahead "1" blocks
    47      Then the mark price should be "0" for the market "ETH/FEB23"
    48      And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/FEB23"
    49  
    50      Then the oracles broadcast data with block time signed with "0xCAFECAFE1":
    51        | name             | value | time offset |
    52        | prices.ETH.value | 16000 | -1s         |
    53      And the market data for the market "ETH/FEB23" should be:
    54        | mark price | trading mode                 | horizon | min bound | max bound |
    55        | 0          | TRADING_MODE_OPENING_AUCTION | 5       | 15801     | 15999     |
    56  
    57  
    58      When the network moves ahead "5" blocks
    59      And the market data for the market "ETH/FEB23" should be:
    60        | mark price | trading mode                    | auction trigger             | horizon | min bound | max bound |
    61        | 16000      | TRADING_MODE_CONTINUOUS         | AUCTION_TRIGGER_UNSPECIFIED | 5       | 15900     | 16100     |
    62      And the parties place the following orders with ticks:
    63        | party             | market id | side | volume | price  | resulting trades | type       | tif     | reference    |
    64        | buySideProvider   | ETH/FEB23 | buy  | 1      | 14000  | 0                | TYPE_LIMIT | TIF_GTC |              |
    65        | sellSideProvider  | ETH/FEB23 | sell | 1      | 14000  | 0                | TYPE_LIMIT | TIF_GTC |              |
    66