code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0068-MATC-073.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        | 30      | 0.999       | 10                |
    25        | 60      | 0.999       | 10                |
    26  
    27      And the spot markets:
    28        | id      | name    | base asset | quote asset | risk model             | auction duration | fees          | price monitoring   | decimal places | position decimal places | sla params    |
    29        | BTC/ETH | BTC/ETH | BTC        | ETH         | lognormal-risk-model-1 | 1                | fees-config-1 | price-monitoring-1 | 2              | 2                       | default-basic |
    30  
    31      # setup accounts
    32      Given the parties deposit on asset's general account the following amount:
    33        | party  | asset | amount |
    34        | party1 | ETH   | 10000  |
    35        | party1 | BTC   | 1000   |
    36        | party2 | ETH   | 10000  |
    37        | party4 | BTC   | 1000   |
    38        | party5 | BTC   | 1000   |
    39      And the average block duration is "1"
    40  
    41      # Place some orders to get out of auction
    42      And the parties place the following orders:
    43        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    44        | party1 | BTC/ETH   | buy  | 1      | 998   | 0                | TYPE_LIMIT | TIF_GTC |
    45        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    46        | party5 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    47        | party5 | BTC/ETH   | sell | 1      | 1002  | 0                | TYPE_LIMIT | TIF_GTC |
    48  
    49      And the opening auction period ends for market "BTC/ETH"
    50      When the network moves ahead "1" blocks
    51      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    52      And the mark price should be "1000" for the market "BTC/ETH"
    53  
    54      Scenario: For Good 'Til Time (GTT) / Good 'Till Cancelled (GTC) / Good For Normal (GFN) orders: 
    55                Incoming LIMIT: POST-ONLY TRUE orders will be placed fully on the book if no orders currently cross. (0068-MATC-073)
    56  
    57      And the parties place the following orders:
    58          | party  | market id | side | volume | price | resulting trades | type       | tif     | expires in | reference | only |
    59          | party1 | BTC/ETH   | buy  | 1      | 999   | 0                | TYPE_LIMIT | TIF_GTT | 3600       | buy-gtt   | post |
    60          | party1 | BTC/ETH   | buy  | 1      | 999   | 0                | TYPE_LIMIT | TIF_GTC |            | buy-gtc   | post |
    61          | party1 | BTC/ETH   | buy  | 1      | 999   | 0                | TYPE_LIMIT | TIF_GFN |            | buy-gfn   | post |
    62          | party5 | BTC/ETH   | sell | 1      | 1001  | 0                | TYPE_LIMIT | TIF_GTT | 3600       | sell-gtt  | post |
    63          | party5 | BTC/ETH   | sell | 1      | 1001  | 0                | TYPE_LIMIT | TIF_GTC |            | sell-gtc  | post |
    64          | party5 | BTC/ETH   | sell | 1      | 1001  | 0                | TYPE_LIMIT | TIF_GFN |            | sell-gfn  | post |
    65  
    66      Then the orders should have the following status:
    67          | party  | reference  | status        |
    68          | party1 | buy-gtt    | STATUS_ACTIVE |
    69          | party1 | buy-gtc    | STATUS_ACTIVE |
    70          | party1 | buy-gfn    | STATUS_ACTIVE |
    71          | party5 | sell-gtt   | STATUS_ACTIVE |
    72          | party5 | sell-gtc   | STATUS_ACTIVE |
    73          | party5 | sell-gfn   | STATUS_ACTIVE |
    74