code.vegaprotocol.io/vega@v0.79.0/core/integration/features/0084-VDPR-014.feature (about)

     1  Feature: If a party does not qualify for the lowest tier, their volume_discount_factor is set to 0 (0084-VDPR-014)
     2  
     3    Background:
     4  
     5      Given the margin calculator named "margin-calculator-1":
     6        | search factor | initial factor | release factor |
     7        | 1.2           | 1.5            | 1.7            |
     8      Given the log normal risk model named "log-normal-risk-model":
     9        | risk aversion | tau | mu | r | sigma |
    10        | 0.000001      | 0.1 | 0  | 0 | 1.0   |
    11      Given the liquidity monitoring parameters:
    12        | name       | triggering ratio | time window | scaling factor |
    13        | lqm-params | 1.0              | 20s         | 1.0            |
    14      And the following network parameters are set:
    15        | name                                    | value |
    16        | market.value.windowLength               | 60s   |
    17        | network.markPriceUpdateMaximumFrequency | 0s    |
    18        | limits.markets.maxPeggedOrders          | 6     |
    19        | market.auction.minimumDuration          | 1     |
    20        | market.fee.factors.infrastructureFee    | 0.001 |
    21        | market.fee.factors.makerFee             | 0.004 |
    22  
    23      #risk factor short:3.5569036
    24      #risk factor long:0.801225765
    25      And the volume discount program tiers named "VDP-01":
    26        | volume | infra factor | liquidity factor | maker factor |
    27        | 3000   | 0.011        | 0.012            | 0.013        |
    28        | 4000   | 0.021        | 0.022            | 0.023        |
    29        | 5000   | 0.031        | 0.032            | 0.033        |
    30      And the volume discount program:
    31        | id  | tiers  | closing timestamp | window length |
    32        | id1 | VDP-01 | 0                 | 4             |
    33  
    34      And the following assets are registered:
    35        | id  | decimal places |
    36        | ETH | 0              |
    37      And the fees configuration named "fees-config-1":
    38        | maker fee | infrastructure fee |
    39        | 0.0004    | 0.001              |
    40      And the price monitoring named "price-monitoring":
    41        | horizon | probability | auction extension |
    42        | 3600    | 0.99        | 3                 |
    43  
    44      And the liquidity sla params named "SLA-22":
    45        | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
    46        | 0.5         | 0.6                          | 1                             | 1.0                    |
    47  
    48      And the markets:
    49        | id        | quote name | asset | liquidity monitoring | risk model            | margin calculator   | auction duration | fees          | price monitoring | data source config     | linear slippage factor | quadratic slippage factor | sla params |
    50        | ETH/MAR24 | ETH        | ETH   | lqm-params           | log-normal-risk-model | margin-calculator-1 | 2                | fees-config-1 | price-monitoring | default-eth-for-future | 1e0                    | 0                         | SLA-22     |
    51  
    52      And the following network parameters are set:
    53        | name                                                | value |
    54        | market.liquidity.bondPenaltyParameter               | 0.2   |
    55        | validators.epoch.length                             | 5s    |
    56        | market.liquidity.stakeToCcyVolume                   | 1     |
    57        | market.liquidity.successorLaunchWindowLength        | 1h    |
    58        | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.7   |
    59        | market.liquidity.sla.nonPerformanceBondPenaltyMax   | 0.6   |
    60        | validators.epoch.length                             | 10s   |
    61        | market.liquidity.earlyExitPenalty                   | 0.25  |
    62  
    63      Given the average block duration is "1"
    64    @Now
    65    Scenario: 001: If a trader doesn't touch or pass the first tier, they get no discount
    66      Given the parties deposit on asset's general account the following amount:
    67        | party  | asset | amount   |
    68        | lp1    | ETH   | 10000000 |
    69        | party1 | ETH   | 10000000 |
    70        | party2 | ETH   | 10000000 |
    71        | party3 | ETH   | 10000000 |
    72  
    73      And the parties submit the following liquidity provision:
    74        | id   | party | market id | commitment amount | fee  | lp type    |
    75        | lp_1 | lp1   | ETH/MAR24 | 100000            | 0.02 | submission |
    76  
    77      Then the parties place the following orders:
    78        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    79        | party1 | ETH/MAR24 | buy  | 10     | 900   | 0                | TYPE_LIMIT | TIF_GTC |
    80        | party1 | ETH/MAR24 | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    81        | lp1    | ETH/MAR24 | buy  | 100    | 990   | 0                | TYPE_LIMIT | TIF_GTC |
    82        | lp1    | ETH/MAR24 | sell | 100    | 1010  | 0                | TYPE_LIMIT | TIF_GTC |
    83        | party2 | ETH/MAR24 | sell | 10     | 1100  | 0                | TYPE_LIMIT | TIF_GTC |
    84        | party2 | ETH/MAR24 | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    85  
    86      Then the opening auction period ends for market "ETH/MAR24"
    87      And the following trades should be executed:
    88        | buyer  | price | size | seller |
    89        | party1 | 1000  | 1    | party2 |
    90      And the market data for the market "ETH/MAR24" should be:
    91        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    92        | 1000       | TRADING_MODE_CONTINUOUS | 3600    | 973       | 1027      | 3556         | 100000         | 1             |
    93      And the party "party3" has the following taker notional "0"
    94      And the party "party3" has the following discount infra factor "0"
    95  
    96      Then the parties place the following orders:
    97        | party  | market id | side | volume | price | resulting trades | type        | tif     |
    98        | party3 | ETH/MAR24 | buy  | 1      | 0     | 1                | TYPE_MARKET | TIF_IOC |
    99        | party3 | ETH/MAR24 | sell | 1      | 0     | 1                | TYPE_MARKET | TIF_IOC |
   100      And the market data for the market "ETH/MAR24" should be:
   101        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
   102        | 1000       | TRADING_MODE_CONTINUOUS | 3600    | 973       | 1027      | 7113         | 100000         | 1             |
   103      When the network moves ahead "1" epochs
   104      # The taker trades above are not enough for party3 to hit the first level of the discount tier
   105      # so we get a zero for the discount factor
   106      And the party "party3" has the following taker notional "2000"
   107      And the party "party3" has the following discount infra factor "0"