code.vegaprotocol.io/vega@v0.79.0/core/integration/features/orders/offsets_with_decimals.feature (about)

     1  Feature: Test how offsets are applied with decimals
     2  
     3    Scenario:
     4  
     5      Given the following network parameters are set:
     6        | name                                    | value |
     7        | market.value.windowLength               | 1h    |
     8        | network.markPriceUpdateMaximumFrequency | 0s    |
     9        | limits.markets.maxPeggedOrders          | 8     |
    10      And the liquidity monitoring parameters:
    11        | name       | triggering ratio | time window | scaling factor |
    12        | lqm-params | 0.00             | 24h         | 1              |
    13      And the following assets are registered:
    14        | id  | decimal places |
    15        | ETH | 5              |
    16        | USD | 2              |
    17      And the average block duration is "2"
    18  
    19      And the log normal risk model named "log-normal-risk-model-1":
    20        | risk aversion | tau | mu | r | sigma |
    21        | 0.000001      | 0.1 | 0  | 0 | 1.0   |
    22      And the fees configuration named "fees-config-1":
    23        | maker fee | infrastructure fee |
    24        | 0.0004    | 0.001              |
    25      And the price monitoring named "price-monitoring-1":
    26        | horizon | probability | auction extension |
    27        | 100000  | 0.99        | 3                 |
    28  
    29      And the liquidity sla params named "SLA":
    30        | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
    31        | 1.0         | 0.5                          | 1                             | 1.0                    |
    32      And the following network parameters are set:
    33        | name                                             | value |
    34        | market.liquidity.providersFeeCalculationTimeStep | 660s  |
    35  
    36      And the markets:
    37        | id        | quote name | asset | liquidity monitoring | risk model              | margin calculator         | auction duration | fees         | price monitoring   | data source config     | decimal places | position decimal places | linear slippage factor | quadratic slippage factor | sla params |
    38        | USD/DEC19 | USD        | ETH   | lqm-params           | log-normal-risk-model-1 | default-margin-calculator | 1                | default-none | price-monitoring-1 | default-usd-for-future | 3              | 3                       | 0.25                   | 0                         | SLA        |
    39  
    40      Given the parties deposit on asset's general account the following amount:
    41        | party  | asset | amount          |
    42        | lp1    | ETH   | 100000000000000 |
    43        | party1 | ETH   | 10000000000000  |
    44        | party2 | ETH   | 10000000000000  |
    45        | party3 | ETH   | 10000000000000  |
    46  
    47      And the parties submit the following liquidity provision:
    48        | id  | party | market id | commitment amount | fee   | lp type    |
    49        | lp1 | lp1   | USD/DEC19 | 10000000000       | 0.001 | submission |
    50        | lp1 | lp1   | USD/DEC19 | 10000000000       | 0.001 | submission |
    51        | lp1 | lp1   | USD/DEC19 | 10000000000       | 0.001 | submission |
    52        | lp1 | lp1   | USD/DEC19 | 10000000000       | 0.001 | submission |
    53      And the parties place the following pegged iceberg orders:
    54        | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
    55        | lp1   | USD/DEC19 | 2         | 1                    | buy  | BID              | 66667  | 0      |
    56        | lp1   | USD/DEC19 | 2         | 1                    | buy  | MID              | 33334  | 1      |
    57        | lp1   | USD/DEC19 | 2         | 1                    | sell | MID              | 33334  | 1      |
    58        | lp1   | USD/DEC19 | 2         | 1                    | sell | ASK              | 66667  | 0      |
    59  
    60      Then the parties place the following orders:
    61        | party  | market id | side | volume | price   | resulting trades | type       | tif     |
    62        | party1 | USD/DEC19 | buy  | 10000  | 999999  | 0                | TYPE_LIMIT | TIF_GTC |
    63        | party1 | USD/DEC19 | buy  | 10000  | 1000000 | 0                | TYPE_LIMIT | TIF_GTC |
    64        | party2 | USD/DEC19 | sell | 10000  | 1000000 | 0                | TYPE_LIMIT | TIF_GTC |
    65        | party2 | USD/DEC19 | sell | 10000  | 1000001 | 0                | TYPE_LIMIT | TIF_GTC |
    66  
    67      Then the opening auction period ends for market "USD/DEC19"
    68      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "USD/DEC19"
    69      And the market data for the market "USD/DEC19" should be:
    70        | mark price | trading mode            | best static bid price | static mid price | best static offer price |
    71        | 1000000    | TRADING_MODE_CONTINUOUS | 999999                | 1000000          | 1000001                 |
    72      Then the orders should have the following states:
    73        | party | market id | side | volume | remaining | price   | status        |
    74        | lp1   | USD/DEC19 | buy  | 66667  | 2         | 999999  | STATUS_ACTIVE |
    75        | lp1   | USD/DEC19 | buy  | 33334  | 2         | 999999  | STATUS_ACTIVE |
    76        | lp1   | USD/DEC19 | sell | 33334  | 2         | 1000001 | STATUS_ACTIVE |
    77        | lp1   | USD/DEC19 | sell | 66667  | 2         | 1000001 | STATUS_ACTIVE |
    78  
    79      Then the parties place the following pegged orders:
    80        | party  | market id | side | volume | pegged reference | offset |
    81        | party3 | USD/DEC19 | buy  | 5      | BID              | 0      |
    82        | party3 | USD/DEC19 | buy  | 4      | MID              | 1      |
    83        | party3 | USD/DEC19 | sell | 3      | ASK              | 0      |
    84        | party3 | USD/DEC19 | sell | 2      | MID              | 1      |
    85  
    86      Then the orders should have the following states:
    87        | party  | market id | side | volume | remaining | price   | status        |
    88        | lp1    | USD/DEC19 | buy  | 66667  | 2         | 999999  | STATUS_ACTIVE |
    89        | lp1    | USD/DEC19 | buy  | 33334  | 2         | 999999  | STATUS_ACTIVE |
    90        | lp1    | USD/DEC19 | sell | 33334  | 2         | 1000001 | STATUS_ACTIVE |
    91        | lp1    | USD/DEC19 | sell | 66667  | 2         | 1000001 | STATUS_ACTIVE |
    92        | party3 | USD/DEC19 | buy  | 5      | 5         | 999999  | STATUS_ACTIVE |
    93        | party3 | USD/DEC19 | buy  | 4      | 4         | 999999  | STATUS_ACTIVE |
    94        | party3 | USD/DEC19 | sell | 3      | 3         | 1000001 | STATUS_ACTIVE |
    95        | party3 | USD/DEC19 | sell | 2      | 2         | 1000001 | STATUS_ACTIVE |