code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0014-ORDT-083.feature (about)

     1  Feature: Spot market
     2  
     3    Background:
     4  
     5      Given the following network parameters are set:
     6        | name                                                | value |
     7        | network.markPriceUpdateMaximumFrequency             | 0s    |
     8        | market.value.windowLength                           | 1h    |
     9      
    10      Given the following assets are registered:
    11        | id  | decimal places |
    12        | ETH | 2              |
    13        | BTC | 2              |
    14  
    15      Given the fees configuration named "fees-config-1":
    16        | maker fee | infrastructure fee |
    17        | 0.01      | 0.03               |
    18      Given the log normal risk model named "lognormal-risk-model-1":
    19        | risk aversion | tau  | mu | r   | sigma |
    20        | 0.001         | 0.01 | 0  | 0.0 | 1.2   |
    21      And the price monitoring named "price-monitoring-1":
    22        | horizon | probability | auction extension |
    23        | 360000  | 0.999       | 1                 |
    24  
    25      And the spot markets:
    26        | id      | name    | base asset | quote asset | risk model             | auction duration | fees          | price monitoring   | decimal places | position decimal places | sla params    |
    27        | BTC/ETH | BTC/ETH | BTC        | ETH         | lognormal-risk-model-1 | 1                | fees-config-1 | price-monitoring-1 | 2              | 2                       | default-basic |
    28  
    29      # setup accounts
    30      Given the parties deposit on asset's general account the following amount:
    31        | party  | asset | amount |
    32        | party1 | ETH   | 10000  |
    33        | party3 | BTC   | 100    |
    34        | party4 | BTC   | 100    |
    35        | party5 | BTC   | 100    |
    36      And the average block duration is "1"
    37  
    38      # Place some orders to get out of auction
    39      And the parties place the following orders:
    40        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    41        | party1 | BTC/ETH   | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GFA |
    42        | party5 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    43  
    44      And the opening auction period ends for market "BTC/ETH"
    45      When the network moves ahead "1" blocks
    46      Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    47  
    48  
    49    Scenario: Immediate orders, continuous trading An aggressive persistent (GTC) limit order that is partially filled
    50              generates trades commensurate with the filled volume. The remaining volume is placed on the order book at the
    51              limit order price, at the back of the queue of orders at that price. (0014-ORDT-083)
    52  
    53      # Place some orders to get some volume at a fixed price level
    54      And the parties place the following orders:
    55        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference |
    56        | party3 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC | sell3     |
    57        | party4 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC | sell4     |
    58        | party5 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC | sell5     |
    59  
    60      # Now place the aggressive GTC order to partially fill from the available volume on the book
    61      And the parties place the following orders:
    62        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference |
    63        | party1 | BTC/ETH   | buy  | 5      | 1000  | 3                | TYPE_LIMIT | TIF_GTC | buy1      |
    64  
    65      Then the orders should have the following states:
    66        | party  | market id | reference   | side | volume | remaining | price | status        |
    67        | party3 | BTC/ETH   | sell3       | sell | 1      | 0         | 1000  | STATUS_FILLED |
    68        | party4 | BTC/ETH   | sell4       | sell | 1      | 0         | 1000  | STATUS_FILLED |
    69        | party5 | BTC/ETH   | sell5       | sell | 1      | 0         | 1000  | STATUS_FILLED |
    70        | party1 | BTC/ETH   | buy1        | buy  | 5      | 2         | 1000  | STATUS_ACTIVE |
    71  
    72      And the order book should have the following volumes for market "BTC/ETH":
    73        | side | price | volume |
    74        | buy  | 1000  | 2      |
    75  
    76    Scenario: Immediate orders, continuous trading An aggressive persistent (GTT) limit order that is partially filled
    77              generates trades commensurate with the filled volume. The remaining volume is placed on the order book at the
    78              limit order price, at the back of the queue of orders at that price. (0014-ORDT-083)
    79  
    80      # Place some orders to get some volume at a fixed price level
    81      And the parties place the following orders:
    82        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference |
    83        | party3 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC | sell3     |
    84        | party4 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC | sell4     |
    85        | party5 | BTC/ETH   | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC | sell5     |
    86  
    87      # Now place the aggressive GTC order to partially fill from the available volume on the book
    88      And the parties place the following orders:
    89        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference | expires in |
    90        | party1 | BTC/ETH   | buy  | 5      | 1000  | 3                | TYPE_LIMIT | TIF_GTT | buy1      | 3600       |
    91  
    92      Then the orders should have the following states:
    93        | party  | market id | reference   | side | volume | remaining | price | status        |
    94        | party3 | BTC/ETH   | sell3       | sell | 1      | 0         | 1000  | STATUS_FILLED |
    95        | party4 | BTC/ETH   | sell4       | sell | 1      | 0         | 1000  | STATUS_FILLED |
    96        | party5 | BTC/ETH   | sell5       | sell | 1      | 0         | 1000  | STATUS_FILLED |
    97        | party1 | BTC/ETH   | buy1        | buy  | 5      | 2         | 1000  | STATUS_ACTIVE |
    98  
    99      And the order book should have the following volumes for market "BTC/ETH":
   100        | side | price | volume |
   101        | buy  | 1000  | 2      |
   102  
   103