code.vegaprotocol.io/vega@v0.79.0/core/integration/features/fees/0042-LIQF-fees_settings.feature (about)

     1  Feature: Test liquidity fee settings, using 3 different methods
     2  
     3    Background:
     4  
     5      Given the simple risk model named "simple-risk-model-1":
     6        | long | short | max move up | min move down | probability of trading |
     7        | 0.1  | 0.1   | 500         | 500           | 0.1                    |
     8      And the fees configuration named "fees-config-1":
     9        | maker fee | infrastructure fee | liquidity fee method | liquidity fee constant |
    10        | 0.0004    | 0.001              | METHOD_CONSTANT      | 0.08                   |
    11      And the fees configuration named "fees-config-2":
    12        | maker fee | infrastructure fee | liquidity fee method | liquidity fee constant |
    13        | 0.0004    | 0.001              | METHOD_CONSTANT      | 0.01                   |
    14      And the fees configuration named "fees-config-3":
    15        | maker fee | infrastructure fee | liquidity fee method    | liquidity fee constant |
    16        | 0.0004    | 0.001              | METHOD_WEIGHTED_AVERAGE | 0.01                   |
    17      And the fees configuration named "fees-config-4":
    18        | maker fee | infrastructure fee | liquidity fee method | liquidity fee constant |
    19        | 0.0004    | 0.001              | METHOD_MARGINAL_COST | 0.01                   |
    20  
    21      And the price monitoring named "price-monitoring":
    22        | horizon | probability | auction extension |
    23        | 3600    | 0.99        | 3                 |
    24      Given the liquidity monitoring parameters:
    25        | name       | triggering ratio | time window | scaling factor |
    26        | lqm-params | 0.0              | 24h         | 1.0            |
    27      And the liquidity sla params named "SLA":
    28        | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
    29        | 1.0         | 0.5                          | 1                             | 1.0                    |
    30      And the following network parameters are set:
    31        | name                                    | value |
    32        | market.value.windowLength               | 1h    |
    33        | network.markPriceUpdateMaximumFrequency | 0s    |
    34        | limits.markets.maxPeggedOrders          | 12    |
    35      And the markets:
    36        | 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 |
    37        | ETH/MAR22 | USD        | USD   | lqm-params           | simple-risk-model-1 | default-margin-calculator | 2                | fees-config-1 | price-monitoring | default-eth-for-future | 0.2                    | 0                         | SLA        |
    38  
    39    Scenario: 001 Liquidity fee setting to METHOD_CONSTANT(0042-LIQF-058, 0042-LIQF-061), METHOD_MARGINAL_COST(0042-LIQF-062), and METHOD_WEIGHTED_AVERAGE(0042-LIQF-057, 0042-LIQF-056)
    40      # setup accounts
    41      Given the parties deposit on asset's general account the following amount:
    42        | party  | asset | amount     |
    43        | lp1    | USD   | 1000000000 |
    44        | lp2    | USD   | 1000000000 |
    45        | party1 | USD   | 100000000  |
    46        | party2 | USD   | 100000000  |
    47  
    48      And the parties submit the following liquidity provision:
    49        | id  | party | market id | commitment amount | fee   | lp type    |
    50        | lp1 | lp1   | ETH/MAR22 | 800               | 0.005 | submission |
    51        | lp2 | lp2   | ETH/MAR22 | 300               | 0.004 | submission |
    52  
    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   | ETH/MAR22 | 12        | 1                    | buy  | BID              | 12     | 2      |
    56        | lp1   | ETH/MAR22 | 12        | 1                    | buy  | MID              | 12     | 1      |
    57        | lp1   | ETH/MAR22 | 12        | 1                    | sell | ASK              | 12     | 2      |
    58        | lp1   | ETH/MAR22 | 12        | 1                    | sell | MID              | 12     | 1      |
    59  
    60      When the parties place the following orders:
    61        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    62        | party1 | ETH/MAR22 | buy  | 1      | 900   | 0                | TYPE_LIMIT | TIF_GTC |
    63        | party1 | ETH/MAR22 | buy  | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    64        | party2 | ETH/MAR22 | sell | 1      | 1100  | 0                | TYPE_LIMIT | TIF_GTC |
    65        | party2 | ETH/MAR22 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    66  
    67      Then the opening auction period ends for market "ETH/MAR22"
    68  
    69      And the following trades should be executed:
    70        | buyer  | price | size | seller |
    71        | party1 | 1000  | 10   | party2 |
    72  
    73      And the market data for the market "ETH/MAR22" should be:
    74        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    75        | 1000       | TRADING_MODE_CONTINUOUS | 3600    | 500       | 1500      | 1000         | 1100           | 10            |
    76  
    77      And the liquidity fee factor should be "0.08" for the market "ETH/MAR22"
    78  
    79      When the markets are updated:
    80        | id        | liquidity monitoring | linear slippage factor | quadratic slippage factor | liquidity fee settings |
    81        | ETH/MAR22 | lqm-params           | 1e-3                   | 0                         | fees-config-2          |
    82      Then the network moves ahead "1" blocks
    83      And the liquidity fee factor should be "0.01" for the market "ETH/MAR22"
    84  
    85      When the markets are updated:
    86        | id        | liquidity monitoring | linear slippage factor | quadratic slippage factor | liquidity fee settings |
    87        | ETH/MAR22 | lqm-params           | 1e-3                   | 0                         | fees-config-3          |
    88      Then the network moves ahead "1" blocks
    89      And the liquidity fee factor should be "0.0047272727272727" for the market "ETH/MAR22"
    90  
    91      When the parties submit the following liquidity provision:
    92        | id  | party | market id | commitment amount | fee   | lp type   |
    93        | lp1 | lp1   | ETH/MAR22 | 800               | 0.006 | amendment |
    94      Then the network moves ahead "1" blocks
    95      And the liquidity fee factor should be "0.0054545454545455" for the market "ETH/MAR22"
    96  
    97      # Use the MARGINAL COST to calculate the liquidity fee. This value with be one of the LP fee values (0042-LIQF-059)
    98      When the markets are updated:
    99        | id        | liquidity monitoring | linear slippage factor | quadratic slippage factor | liquidity fee settings |
   100        | ETH/MAR22 | lqm-params           | 1e-3                   | 0                         | fees-config-4          |
   101  
   102      When the parties submit the following liquidity provision:
   103        | id  | party | market id | commitment amount | fee    | lp type   |
   104        | lp1 | lp1   | ETH/MAR22 | 800               | 0.0375 | amendment |
   105      Then the network moves ahead "1" blocks
   106      And the liquidity fee factor should be "0.0375" for the market "ETH/MAR22"