code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0068-MATC-076.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        | party4 | BTC   | 1000   |
    37        | party5 | BTC   | 1000   |
    38      And the average block duration is "1"
    39  
    40      # Place some orders to get out of auction
    41      And the parties place the following orders:
    42        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    43        | party1 | BTC/ETH   | buy  | 1      | 998   | 0                | TYPE_LIMIT | TIF_GTC |
    44        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    45        | party5 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    46        | party5 | BTC/ETH   | sell | 1      | 1050  | 0                | TYPE_LIMIT | TIF_GTC |
    47  
    48      And the opening auction period ends for market "BTC/ETH"
    49      When the network moves ahead "1" blocks
    50      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    51      And the mark price should be "1000" for the market "BTC/ETH"
    52  
    53      Scenario: For Good 'Til Time (GTT) orders:
    54                A market will enter auction if the mark price moves by a larger amount than the price monitoring settings allow. (0068-MATC-076)
    55  
    56        And the market data for the market "BTC/ETH" should be:
    57          | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    58          | 1000       | TRADING_MODE_CONTINUOUS | 3600    | 959       | 1042      | 0            | 0              | 0             |
    59  
    60        # Place a GTT order that is outside the price bounds
    61        And the parties place the following orders:
    62          | party  | market id | side | volume | price | resulting trades | type       | tif     | expires in | reference |
    63          | party1 | BTC/ETH   | buy  | 1      | 1050  | 0                | TYPE_LIMIT | TIF_GTT | 3600       | buy-gtt   |
    64        Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "BTC/ETH"
    65  
    66        When the network moves ahead "11" blocks
    67        Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    68        And the mark price should be "1050" for the market "BTC/ETH"
    69  
    70  
    71      Scenario: For Good 'Till Cancelled (GTC) orders:
    72                A market will enter auction if the mark price moves by a larger amount than the price monitoring settings allow. (0068-MATC-076)
    73  
    74        And the market data for the market "BTC/ETH" should be:
    75          | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    76          | 1000       | TRADING_MODE_CONTINUOUS | 3600    | 959       | 1042      | 0            | 0              | 0             |
    77  
    78        # Place a GTC order that is outside the price bounds
    79        And the parties place the following orders:
    80          | party  | market id | side | volume | price | resulting trades | type       | tif     | reference |
    81          | party1 | BTC/ETH   | buy  | 1      | 1050  | 0                | TYPE_LIMIT | TIF_GTC | buy-gtc   |
    82        Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "BTC/ETH"
    83  
    84        When the network moves ahead "11" blocks
    85        Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    86        And the mark price should be "1050" for the market "BTC/ETH"
    87  
    88  
    89      Scenario: For Good For Normal (GFN) orders:
    90                A market will enter auction if the mark price moves by a larger amount than the price monitoring settings allow. (0068-MATC-076)
    91  
    92        And the market data for the market "BTC/ETH" should be:
    93          | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    94          | 1000       | TRADING_MODE_CONTINUOUS | 3600    | 959       | 1042      | 0            | 0              | 0             |
    95  
    96        # Place a GFN order that is outside the price bounds, this will be treated as a non persistent order and will be rejected
    97        And the parties place the following orders:
    98          | party  | market id | side | volume | price | resulting trades | type       | tif     | reference | error |
    99          | party1 | BTC/ETH   | buy  | 1      | 1050  | 0                | TYPE_LIMIT | TIF_GFN | buy-gfn   | OrderError: non-persistent order trades out of price bounds |
   100        Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
   101  
   102  
   103