code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0037-OPEG-023.feature (about)

     1  
     2  Feature: 0001 tick size should be using market decimal, A pegged order specifying an offset which is not an integer multiple of the markets tick size should be rejected.
     3  
     4      Background:
     5          Given the following network parameters are set:
     6              | name                                                | value |
     7              | market.liquidity.bondPenaltyParameter               | 1     |
     8              | network.markPriceUpdateMaximumFrequency             | 0s    |
     9              | limits.markets.maxPeggedOrders                      | 6     |
    10              | validators.epoch.length                             | 5s    |
    11              | market.liquidity.earlyExitPenalty                   | 0.25  |
    12              | market.liquidity.stakeToCcyVolume                   | 1.0   |
    13              | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.19  |
    14              | market.liquidity.sla.nonPerformanceBondPenaltyMax   | 1     |
    15  
    16          And the liquidity monitoring parameters:
    17              | name       | triggering ratio | time window | scaling factor |
    18              | lqm-params | 0.1              | 24h         | 1              |
    19  
    20          And the following assets are registered:
    21              | id  | decimal places |
    22              | ETH | 1              |
    23              | BTC | 1              |
    24  
    25          And the average block duration is "1"
    26          And the simple risk model named "simple-risk-model-1":
    27              | long | short | max move up | min move down | probability of trading |
    28              | 0.1  | 0.1   | 60          | 50            | 0.2                    |
    29          And the fees configuration named "fees-config-1":
    30              | maker fee | infrastructure fee |
    31              | 0         | 0                  |
    32          And the price monitoring named "price-monitoring-1":
    33              | horizon | probability | auction extension |
    34              | 1       | 0.99        | 5                 |
    35          And the liquidity sla params named "SLA":
    36              | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
    37              | 0.01        | 0.5                          | 1                             | 1.0                    |
    38  
    39      Scenario:
    40          #0037-OPEG-023:Given a market with non-zero market and asset decimals where the asset decimals are strictly less than the market decimals (yielding a negative price factor). A pegged order specifying an offset which is not an integer multiple of the markets tick size should be rejected.
    41          #0037-OPEG-024:Given a market with non-zero market and asset decimals where the asset decimals are equal to the market decimals (yielding a negative price factor). A pegged order specifying an offset which is not an integer multiple of the markets tick size should be rejected.
    42          #0037-OPEG-027:Given a market with non-zero market and asset decimals where the asset decimals are strictly more than the market decimals (yielding a negative price factor). A pegged order specifying an offset which is not an integer multiple of the markets tick size should be rejected.
    43          And the spot markets:
    44              | id        | name    | quote asset | base asset | liquidity monitoring | risk model          | auction duration | fees          | price monitoring   | sla params    | decimal places | tick size |
    45              | ETH/DEC21 | BTC/ETH | BTC         | ETH        | lqm-params           | simple-risk-model-1 | 1                | fees-config-1 | price-monitoring-1 | default-basic | 2              | 10        |
    46              | ETH/DEC22 | BTC/ETH | BTC         | ETH        | lqm-params           | simple-risk-model-1 | 1                | fees-config-1 | price-monitoring-1 | default-basic | 2              | 5         |
    47              | ETH/DEC23 | BTC/ETH | BTC         | ETH        | lqm-params           | simple-risk-model-1 | 1                | fees-config-1 | price-monitoring-1 | default-basic | 1              | 5         |
    48              | ETH/DEC24 | BTC/ETH | BTC         | ETH        | lqm-params           | simple-risk-model-1 | 1                | fees-config-1 | price-monitoring-1 | default-basic | 0              | 10        |
    49          And the parties deposit on asset's general account the following amount:
    50              | party  | asset | amount        |
    51              | party1 | ETH   | 1000000000000 |
    52              | party1 | BTC   | 1000          |
    53              | party3 | ETH   | 1000000       |
    54              | party4 | ETH   | 1000000       |
    55          And the average block duration is "1"
    56  
    57          And the parties place the following orders:
    58              | party  | market id | side | volume | price | resulting trades | type       | tif     | reference | error                              |
    59              | party3 | ETH/DEC21 | buy  | 100    | 101   | 0                | TYPE_LIMIT | TIF_GTC | p3b1-1    | OrderError: price not in tick size |
    60              | party3 | ETH/DEC21 | buy  | 10     | 111   | 0                | TYPE_LIMIT | TIF_GTC | p3b2-1    | OrderError: price not in tick size |
    61              | party4 | ETH/DEC21 | sell | 10     | 111   | 0                | TYPE_LIMIT | TIF_GTC | p4s2-1    | OrderError: price not in tick size |
    62              | party4 | ETH/DEC21 | sell | 1000   | 191   | 0                | TYPE_LIMIT | TIF_GTC | p4s1-1    | OrderError: price not in tick size |
    63              | party3 | ETH/DEC22 | buy  | 100    | 101   | 0                | TYPE_LIMIT | TIF_GTC | p3b1-2    | OrderError: price not in tick size |
    64              | party3 | ETH/DEC22 | buy  | 10     | 111   | 0                | TYPE_LIMIT | TIF_GTC | p3b2-2    | OrderError: price not in tick size |
    65              | party4 | ETH/DEC22 | sell | 10     | 111   | 0                | TYPE_LIMIT | TIF_GTC | p4s2-2    | OrderError: price not in tick size |
    66              | party4 | ETH/DEC22 | sell | 1000   | 191   | 0                | TYPE_LIMIT | TIF_GTC | p4s1-2    | OrderError: price not in tick size |
    67              | party3 | ETH/DEC23 | buy  | 100    | 101   | 0                | TYPE_LIMIT | TIF_GTC | p3b1-3    | OrderError: price not in tick size |
    68              | party3 | ETH/DEC23 | buy  | 10     | 111   | 0                | TYPE_LIMIT | TIF_GTC | p3b2-3    | OrderError: price not in tick size |
    69              | party4 | ETH/DEC23 | sell | 10     | 111   | 0                | TYPE_LIMIT | TIF_GTC | p4s2-3    | OrderError: price not in tick size |
    70              | party4 | ETH/DEC23 | sell | 1000   | 191   | 0                | TYPE_LIMIT | TIF_GTC | p4s1-3    | OrderError: price not in tick size |
    71              | party3 | ETH/DEC24 | buy  | 100    | 101   | 0                | TYPE_LIMIT | TIF_GTC | p3b1-4    | OrderError: price not in tick size |
    72              | party3 | ETH/DEC24 | buy  | 10     | 111   | 0                | TYPE_LIMIT | TIF_GTC | p3b2-4    | OrderError: price not in tick size |
    73              | party4 | ETH/DEC24 | sell | 10     | 111   | 0                | TYPE_LIMIT | TIF_GTC | p4s2-4    | OrderError: price not in tick size |
    74              | party4 | ETH/DEC24 | sell | 1000   | 191   | 0                | TYPE_LIMIT | TIF_GTC | p4s1-4    | OrderError: price not in tick size |
    75  
    76          Then the network moves ahead "2" blocks
    77          And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC21"
    78          And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC22"
    79          And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC23"
    80          And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC24"
    81  
    82          And the parties place the following pegged iceberg orders:
    83              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset | reference | error                              |
    84              | party1 | ETH/DEC21 | 10        | 5                    | buy  | MID              | 10     | 10     | peg-buy-1 |                                    |
    85              | party1 | ETH/DEC21 | 10        | 5                    | sell | MID              | 20     | 20     | peg-buy-2 |                                    |
    86              | party1 | ETH/DEC21 | 10        | 5                    | buy  | MID              | 20     | 100    | peg-buy-3 |                                    |
    87              | party1 | ETH/DEC21 | 10        | 5                    | sell | MID              | 20     | 2      | peg-buy-4 | OrderError: price not in tick size |
    88              | party1 | ETH/DEC21 | 10        | 5                    | buy  | MID              | 20     | 5      | peg-buy-5 | OrderError: price not in tick size |
    89              | party1 | ETH/DEC22 | 10        | 5                    | buy  | MID              | 20     | 15     | peg-buy-6 |                                    |
    90              | party1 | ETH/DEC23 | 10        | 5                    | sell | MID              | 20     | 6      | peg-buy-7 | OrderError: price not in tick size |
    91              | party1 | ETH/DEC24 | 10        | 5                    | buy  | MID              | 20     | 17     | peg-buy-8 | OrderError: price not in tick size |