code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0068-MATC-079.feature (about)

     1  Feature: Spot market
     2  
     3    Background:
     4      Given time is updated to "2024-01-01T00:00:00Z"
     5  
     6      Given the following network parameters are set:
     7        | name                                                | value |
     8        | network.markPriceUpdateMaximumFrequency             | 0s    |
     9        | market.value.windowLength                           | 1h    |
    10      
    11      Given the following assets are registered:
    12        | id  | decimal places |
    13        | ETH | 2              |
    14        | BTC | 2              |
    15  
    16      Given the fees configuration named "fees-config-1":
    17        | maker fee | infrastructure fee |
    18        | 0.01      | 0.03               |
    19      Given the log normal risk model named "lognormal-risk-model-1":
    20        | risk aversion | tau  | mu | r   | sigma |
    21        | 0.001         | 0.01 | 0  | 0.0 | 1.2   |
    22      And the price monitoring named "price-monitoring-1":
    23        | horizon | probability | auction extension |
    24        | 3600    | 0.999       | 10                |
    25  
    26      And the spot markets:
    27        | id      | name    | base asset | quote asset | risk model             | auction duration | fees          | price monitoring   | decimal places | position decimal places | sla params    |
    28        | BTC/ETH | BTC/ETH | BTC        | ETH         | lognormal-risk-model-1 | 1                | fees-config-1 | price-monitoring-1 | 2              | 2                       | default-basic |
    29  
    30      # setup accounts
    31      Given the parties deposit on asset's general account the following amount:
    32        | party  | asset | amount |
    33        | party1 | ETH   | 10000  |
    34        | party1 | BTC   | 1000   |
    35        | party2 | ETH   | 10000  |
    36        | party2 | BTC   | 1000   |
    37        | party5 | ETH   | 10000  |
    38        | party5 | BTC   | 1000   |
    39      And the average block duration is "1"
    40  
    41      Scenario: In auction GTC/GTT All MARKET orders are rejected. For product spot: (0068-MATC-079)
    42  
    43        # Place some orders that are invalid in the opening auction
    44        And the parties place the following orders:
    45          | party  | market id | side | volume | price | resulting trades | type        | tif     | expires in | reference | error |
    46          | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_MARKET | TIF_GTC |            | sell1     | OrderError: Invalid Persistence |
    47          | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_MARKET | TIF_GTT | 3600       | sell2     | OrderError: Invalid Expiration Datetime |
    48          | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_MARKET | TIF_GTC |            | buy1      | OrderError: Invalid Persistence |
    49          | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_MARKET | TIF_GTT | 3600       | buy2      | OrderError: Invalid Expiration Datetime |
    50  
    51        Then the orders should have the following status:
    52          | party  | reference | status          |
    53          | party1 | sell1     | STATUS_REJECTED |
    54          | party1 | sell2     | STATUS_REJECTED |
    55          | party1 | buy1      | STATUS_REJECTED |
    56          | party1 | buy2      | STATUS_REJECTED |
    57  
    58      # Place some orders to get out of auction
    59      And the parties place the following orders:
    60        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    61        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    62        | party5 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    63  
    64      And the opening auction period ends for market "BTC/ETH"
    65      When the network moves ahead "1" blocks
    66      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    67      And the mark price should be "1000" for the market "BTC/ETH"
    68  
    69      And the market data for the market "BTC/ETH" should be:
    70        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    71        | 1000       | TRADING_MODE_CONTINUOUS | 3600    | 959       | 1042      | 0            | 0              | 0             |
    72  
    73      # Now get into a price monitoring auction
    74        And the parties place the following orders:
    75          | party  | market id | side | volume | price | resulting trades | type       | tif     | 
    76          | party5 | BTC/ETH   | sell | 1      | 1050  | 0                | TYPE_LIMIT | TIF_GTC | 
    77          | party1 | BTC/ETH   | buy  | 1      | 1050  | 0                | TYPE_LIMIT | TIF_GTC | 
    78  
    79      Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "BTC/ETH"
    80  
    81      # Place some orders that are invalid in the price monitoring auction
    82      And the parties place the following orders:
    83        | party  | market id | side | volume | price | resulting trades | type        | tif     | expires in | reference | error |
    84        | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_MARKET | TIF_GTC |            | sell3     | OrderError: Invalid Persistence |
    85        | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_MARKET | TIF_GTT | 3600       | sell4     | OrderError: Invalid Expiration Datetime |
    86        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_MARKET | TIF_GTC |            | buy3      | OrderError: Invalid Persistence |
    87        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_MARKET | TIF_GTT | 3600       | buy4      | OrderError: Invalid Expiration Datetime |
    88  
    89      Then the orders should have the following status:
    90        | party  | reference | status          |
    91        | party1 | sell3     | STATUS_REJECTED |
    92        | party1 | sell4     | STATUS_REJECTED |
    93        | party1 | buy3      | STATUS_REJECTED |
    94        | party1 | buy4      | STATUS_REJECTED |