code.vegaprotocol.io/vega@v0.79.0/core/integration/features/price_monitoring/ETH_USDT-perp-bounds.feature (about)

     1  Feature: Reproduce ETH/USDT-PERP market configuration as updated on November 30th 2023
     2  
     3    Background:
     4      Given time is updated to "2024-02-04T16:00:00Z"
     5      And the following assets are registered:
     6        | id    | decimal places |
     7        | TUSDT | 6              |
     8      And the log normal risk model named "log-normal-risk-model":
     9        | risk aversion | tau               | mu    | r | sigma |
    10        | 0.000001      | 0.000009506426342 | 0.016 | 0 | 1.5   |
    11      And the margin calculator named "margin-calculator":
    12        | search factor | initial factor | release factor |
    13        | 1.1           | 1.5            | 1.7            |
    14      And the fees configuration named "fees":
    15        | maker fee | infrastructure fee |
    16        | 0.0001    | 0.0003             |
    17      And the price monitoring named "price-monitoring":
    18        | horizon | probability | auction extension |
    19        | 43200   | 0.9999999   | 300               |
    20        | 21600   | 0.9999999   | 86400             |
    21      And the liquidity monitoring parameters:
    22        | name       | triggering ratio | time window | scaling factor | auction extension |
    23        | lqm-params | 0.1              | 3600s       | 0.05           | 1                 |
    24      And the liquidity sla params named "sla":
    25        | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
    26        | 0.03        | 0.85                         | 1                             | 0.5                    |
    27      And the perpetual oracles from "0xCAFECAFE1":
    28        | name        | asset | settlement property | settlement type | schedule property | schedule type  | margin funding factor | interest rate | clamp lower bound | clamp upper bound | quote name | settlement decimals |
    29        | perp-oracle | TUSDT | eth.price           | TYPE_INTEGER    | perp.funding.cue  | TYPE_TIMESTAMP | 0.9                   | 0.1095        | -0.0005           | 0.0005            | USDT       | 18                  |
    30      And the markets:
    31        | id            | quote name | asset | 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 | market type |
    32        | ETH/USDT-PERP | USDT       | TUSDT | log-normal-risk-model | margin-calculator | 3600             | fees | price-monitoring | perp-oracle        | 4              | 1                       | 0.001                  | 0                         | sla        | perp        |
    33      And the following network parameters are set:
    34        | name                           | value |
    35        | market.auction.minimumDuration | 30    |
    36        | limits.markets.maxPeggedOrders | 20    |
    37  
    38    Scenario: Check the resulting bounds
    39      
    40      Given the parties deposit on asset's general account the following amount:
    41        | party  | asset | amount          |
    42        | party1 | TUSDT | 10000000000000  |
    43        | party2 | TUSDT | 10000000000000  |
    44        | aux    | TUSDT | 100000000000000 |
    45        | aux2   | TUSDT | 100000000000000 |
    46        | lp     | TUSDT | 100000000000000 |
    47  
    48      When the parties submit the following liquidity provision:
    49        | id  | party | market id     | commitment amount | fee | lp type    |
    50        | lp1 | lp    | ETH/USDT-PERP | 90000000          | 0.1 | submission |
    51        | lp1 | lp    | ETH/USDT-PERP | 90000000          | 0.1 | submission |
    52      And the parties place the following pegged iceberg orders:
    53        | party | market id     | peak size | minimum visible size | side | pegged reference | volume     | offset |
    54        | lp    | ETH/USDT-PERP | 2         | 1                    | buy  | BID              | 50         | 100    |
    55        | lp    | ETH/USDT-PERP | 2         | 1                    | sell | ASK              | 50         | 100    |
    56      # place auxiliary orders so we always have best bid and best offer as to not trigger the liquidity auction
    57      And the parties place the following orders:
    58        | party | market id     | side | volume | price     | resulting trades | type       | tif     |
    59        | aux   | ETH/USDT-PERP | buy  | 1      | 1         | 0                | TYPE_LIMIT | TIF_GTC |
    60        | aux   | ETH/USDT-PERP | sell | 1      | 200000000 | 0                | TYPE_LIMIT | TIF_GTC |
    61        | aux2  | ETH/USDT-PERP | buy  | 1      | 29000000  | 0                | TYPE_LIMIT | TIF_GTC |
    62        | aux   | ETH/USDT-PERP | sell | 1      | 29000000  | 0                | TYPE_LIMIT | TIF_GTC |
    63      
    64      When the opening auction period ends for market "ETH/USDT-PERP"
    65      Then the market data for the market "ETH/USDT-PERP" should be:
    66        | horizon | ref price | min bound | max bound |
    67        | 43200   | 29000000  | 21545190  | 38915896  |
    68        | 21600   | 29000000  | 23511702  | 35715161  |