code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0068-MATC-078.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 IOC/FOK/GFN Incoming orders have their status set to REJECTED and are not processed further. (0068-MATC-078)
    42  
    43      # Place some orders while in opening auction to make sure they are rejected
    44      And the parties place the following orders:
    45        | party  | market id | side | volume | price | resulting trades | type       | tif     | error                                     | reference |
    46        | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_IOC | ioc order received during auction trading | sell1     |
    47        | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_FOK | fok order received during auction trading | sell2     |
    48        | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GFN | gfn order received during auction trading | sell3     |
    49        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_IOC | ioc order received during auction trading | buy1      |
    50        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_FOK | fok order received during auction trading | buy2      |
    51        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GFN | gfn order received during auction trading | buy3      |
    52  
    53     And the orders should have the following states:
    54      | party  | market id | reference | side | volume | remaining | price | status          |
    55      | party1 | BTC/ETH   | sell1     | sell | 1      | 1         | 1000  | STATUS_REJECTED |
    56      | party1 | BTC/ETH   | sell2     | sell | 1      | 1         | 1000  | STATUS_REJECTED |
    57      | party1 | BTC/ETH   | sell3     | sell | 1      | 1         | 1000  | STATUS_REJECTED |
    58      | party1 | BTC/ETH   | buy1      | buy  | 1      | 1         | 1000  | STATUS_REJECTED |
    59      | party1 | BTC/ETH   | buy2      | buy  | 1      | 1         | 1000  | STATUS_REJECTED |
    60      | party1 | BTC/ETH   | buy3      | buy  | 1      | 1         | 1000  | STATUS_REJECTED |
    61  
    62      # Place some orders to get out of auction
    63      And the parties place the following orders:
    64        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    65        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    66        | party5 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    67  
    68      And the opening auction period ends for market "BTC/ETH"
    69      When the network moves ahead "1" blocks
    70      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    71      And the mark price should be "1000" for the market "BTC/ETH"
    72  
    73      And the market data for the market "BTC/ETH" should be:
    74        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    75        | 1000       | TRADING_MODE_CONTINUOUS | 3600    | 959       | 1042      | 0            | 0              | 0             |
    76  
    77      # Now move into a price auction so we can test all the orders again
    78      And the parties place the following orders:
    79        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    80        | party1 | BTC/ETH   | buy  | 1      | 1050  | 0                | TYPE_LIMIT | TIF_GTC |
    81        | party5 | BTC/ETH   | sell | 1      | 1050  | 0                | TYPE_LIMIT | TIF_GTC |
    82  
    83      Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "BTC/ETH"
    84  
    85      # Place some orders while in price monitoring auction to make sure they are rejected
    86      And the parties place the following orders:
    87        | party  | market id | side | volume | price | resulting trades | type       | tif     | error                                     | reference |
    88        | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_IOC | ioc order received during auction trading | sell4     |
    89        | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_FOK | fok order received during auction trading | sell5     |
    90        | party1 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GFN | gfn order received during auction trading | sell6     |
    91        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_IOC | ioc order received during auction trading | buy4      |
    92        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_FOK | fok order received during auction trading | buy5      |
    93        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GFN | gfn order received during auction trading | buy6      |
    94  
    95     And the orders should have the following states:
    96      | party  | market id | reference | side | volume | remaining | price | status          |
    97      | party1 | BTC/ETH   | sell4     | sell | 1      | 1         | 1000  | STATUS_REJECTED |
    98      | party1 | BTC/ETH   | sell5     | sell | 1      | 1         | 1000  | STATUS_REJECTED |
    99      | party1 | BTC/ETH   | sell6     | sell | 1      | 1         | 1000  | STATUS_REJECTED |
   100      | party1 | BTC/ETH   | buy4      | buy  | 1      | 1         | 1000  | STATUS_REJECTED |
   101      | party1 | BTC/ETH   | buy5      | buy  | 1      | 1         | 1000  | STATUS_REJECTED |
   102      | party1 | BTC/ETH   | buy6      | buy  | 1      | 1         | 1000  | STATUS_REJECTED |