code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/opening-auction-price-manipulation.feature (about)

     1  Feature: Set up a market with an opening auction manipulate price to low level with low collateral, move price to higher level, manipulator orders should get cancelled
     2  
     3    Background:
     4  
     5      Given the markets:
     6        | id        | quote name | asset | risk model                  | margin calculator         | auction duration | fees         | price monitoring | data source config     | linear slippage factor | quadratic slippage factor | sla params      |
     7        | ETH/DEC19 | BTC        | BTC   | default-simple-risk-model-4 | default-margin-calculator | 10               | default-none | default-none     | default-eth-for-future | 0.25                   | 0                         | default-futures |
     8      And the parties deposit on asset's general account the following amount:
     9        | party        | asset | amount    |
    10        | manipulator1 | BTC   | 3         |
    11        | manipulator2 | BTC   | 3         |
    12        | party3       | BTC   | 100000000 |
    13        | party4       | BTC   | 100000000 |
    14        | party5       | BTC   | 100000000 |
    15      And the following network parameters are set:
    16        | name                                    | value |
    17        | limits.markets.maxPeggedOrders          | 2     |
    18        | network.markPriceUpdateMaximumFrequency | 1s    |
    19    
    20    Scenario: 
    21      When the parties place the following orders with ticks:
    22        | party         | market id | side | volume | price | resulting trades | type       | tif     | reference |
    23        | manipulator1  | ETH/DEC19 | buy  | 10     | 2     | 0                | TYPE_LIMIT | TIF_GTC | mani-1    |
    24        | manipulator2  | ETH/DEC19 | sell | 10     | 2     | 0                | TYPE_LIMIT | TIF_GTC | mani-2    |
    25      Then the parties should have the following margin levels:
    26        | party        | market id | maintenance |
    27        | manipulator1 | ETH/DEC19 | 2           |
    28        | manipulator2 | ETH/DEC19 | 2           |
    29      And the orders should have the following states:
    30        | party        | market id | reference | side | volume | remaining | price | status        |
    31        | manipulator1 | ETH/DEC19 | mani-1    | buy  | 10     | 10        | 2     | STATUS_ACTIVE |
    32        | manipulator2 | ETH/DEC19 | mani-2    | sell | 10     | 10        | 2     | STATUS_ACTIVE |
    33      And the market data for the market "ETH/DEC19" should be:
    34        | trading mode                 | open interest | indicative price | indicative volume |
    35        | TRADING_MODE_OPENING_AUCTION | 0             | 2                | 10                |
    36  
    37  
    38      When the parties place the following orders with ticks:
    39        | party         | market id | side | volume | price | resulting trades | type       | tif     |
    40        | party3        | ETH/DEC19 | buy  | 20     | 100   | 0                | TYPE_LIMIT | TIF_GTC |
    41        | party4        | ETH/DEC19 | sell | 20     | 100   | 0                | TYPE_LIMIT | TIF_GTC |
    42      Then the parties should have the following margin levels:
    43        | party        | market id | maintenance |
    44        | manipulator1 | ETH/DEC19 | 2           |
    45        | manipulator2 | ETH/DEC19 | 2           |
    46        | party3       | ETH/DEC19 | 200         |
    47        | party4       | ETH/DEC19 | 200         |
    48      Then the market data for the market "ETH/DEC19" should be:
    49        | trading mode                 | open interest | indicative price | indicative volume |
    50        | TRADING_MODE_OPENING_AUCTION | 0             | 100              | 20                |
    51  
    52      # 0019-MCAL-234
    53      When the parties place the following orders with ticks:
    54        | party         | market id | side | volume | price | resulting trades | type       | tif     |
    55        | party5        | ETH/DEC19 | buy  | 10     | 3     | 0                | TYPE_LIMIT | TIF_GTC |
    56      Then the parties should have the following margin levels:
    57        | party        | market id | maintenance |
    58        | party5       | ETH/DEC19 | 100         |
    59  
    60      When the network moves ahead "5" blocks
    61      Then the parties should have the following margin levels:
    62        | party        | market id | maintenance |
    63        | manipulator1 | ETH/DEC19 | 2           |
    64        | manipulator2 | ETH/DEC19 | 2           |
    65        | party3       | ETH/DEC19 | 200         |
    66        | party4       | ETH/DEC19 | 200         |
    67      And the orders should have the following states:
    68        | party        | market id | reference | side | volume | remaining | price | status        |
    69        | manipulator1 | ETH/DEC19 | mani-1    | buy  | 10     | 10        | 2     | STATUS_ACTIVE |
    70        | manipulator2 | ETH/DEC19 | mani-2    | sell | 10     | 10        | 2     | STATUS_ACTIVE |
    71  
    72      When the network moves ahead "11" blocks  
    73      Then the market data for the market "ETH/DEC19" should be:
    74        | trading mode            | open interest |
    75        | TRADING_MODE_CONTINUOUS | 20            |
    76      Then debug orders
    77      And the orders should have the following states:
    78        | party        | market id | reference | side | volume | remaining | price | status         |
    79        | manipulator1 | ETH/DEC19 | mani-1    | buy  | 10     | 10        | 2     | STATUS_STOPPED |
    80        | manipulator2 | ETH/DEC19 | mani-2    | sell | 10     | 0         | 2     | STATUS_FILLED  |