code.vegaprotocol.io/vega@v0.79.0/core/integration/features/liquidity-provision/0044-LIME-013.feature (about)

     1  Feature: Check not penalty if time on book amount is high enough
     2  
     3  # If a liquidity provider has fraction_of_time_on_book >= market.liquidity.committmentMinTimeFraction,
     4  # no penalty will be taken from their bond account (0044-LIME-013)
     5  
     6    Background:
     7      
     8      Given the following network parameters are set:
     9        | name                                                  | value |
    10        | market.liquidity.bondPenaltyParameter                 | 1     |
    11        | network.markPriceUpdateMaximumFrequency               | 0s    |
    12        | limits.markets.maxPeggedOrders                        | 2     |
    13        | validators.epoch.length                               | 5s    |
    14        | market.liquidity.earlyExitPenalty                   | 0.25  |
    15        | market.liquidity.stakeToCcyVolume                   | 1.0   |
    16        | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.19  |
    17        | market.liquidity.sla.nonPerformanceBondPenaltyMax   | 1     |
    18      And the liquidity monitoring parameters:
    19        | name               | triggering ratio | time window | scaling factor |
    20        | lqm-params         | 0.10             | 24h         | 1              |  
    21      
    22      And the average block duration is "1"
    23      And the simple risk model named "simple-risk-model-1":
    24        | long | short | max move up | min move down | probability of trading |
    25        | 0.1  | 0.1   | 60          | 50            | 0.2                    |
    26      And the fees configuration named "fees-config-1":
    27        | maker fee | infrastructure fee |
    28        | 0.004     | 0.001              |
    29      And the price monitoring named "price-monitoring-1":
    30        | horizon | probability | auction extension |
    31        | 1       | 0.99        | 5                 |
    32      And the liquidity sla params named "SLA":
    33        | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
    34        | 0.01        | 0.5                          | 1                             | 1.0                    |
    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/DEC21 | ETH        | ETH   | lqm-params           | simple-risk-model-1 | default-margin-calculator | 1                | fees-config-1 | price-monitoring-1 | default-eth-for-future | 0.5                    | 0                         | SLA        |
    38       And the following network parameters are set:
    39        | name                                               | value |
    40        | market.liquidity.providersFeeCalculationTimeStep | 5s    |
    41  
    42      And the parties deposit on asset's general account the following amount:
    43        | party  | asset | amount  |
    44        | party1 | ETH   | 100000000  |
    45        | party3 | ETH   | 100000000  |
    46        | party4 | ETH   | 100000000  |
    47      And the parties submit the following liquidity provision:
    48        | id  | party  | market id | commitment amount | fee   | lp type     |
    49        | lp1 | party1 | ETH/DEC21 | 1000              | 0.001 | submission  |
    50      And the parties place the following orders:
    51        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference     |
    52        | party3 | ETH/DEC21 | buy  | 1000   | 900   | 0                | TYPE_LIMIT | TIF_GTC | p3b1          |
    53        | party3 | ETH/DEC21 | buy  | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC | p3b2          |
    54        | party4 | ETH/DEC21 | sell | 1000   | 1100  | 0                | TYPE_LIMIT | TIF_GTC | p4s1          |
    55        | party4 | ETH/DEC21 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC | p4s2          |
    56        | party1 | ETH/DEC21 | buy  | 20000  | 999   | 0                | TYPE_LIMIT | TIF_GTC | party1-order1 |
    57        | party1 | ETH/DEC21 | sell | 20000  | 1001  | 0                | TYPE_LIMIT | TIF_GTC | party1-order2 |
    58  
    59    Scenario: 001, LP gets no penalty for 3/5 blocks of LP provision (0044-LIME-013)
    60      When the opening auction period ends for market "ETH/DEC21"
    61      And the auction ends with a traded volume of "10" at a price of "1000"
    62      Then the market data for the market "ETH/DEC21" should be:
    63        | mark price | trading mode            | target stake | supplied stake | open interest | best static bid price | static mid price | best static offer price |
    64        | 1000       | TRADING_MODE_CONTINUOUS | 1000         | 1000           | 10            | 999                   | 1000             | 1001                    |
    65  
    66      And the parties should have the following account balances:
    67        | party  | asset | market id | margin  | general  | bond |
    68        | party1 | ETH   | ETH/DEC21 | 2402400 | 97596600 | 1000 |    
    69  
    70      # Move forward an epoch and make sure the accounts do not change as we have 5/5 blocks covered
    71      When the network moves ahead "7" blocks
    72      Then the liquidity provisions should have the following states:
    73        | id  | party  | market    | commitment amount | status           |
    74        | lp1 | party1 | ETH/DEC21 | 1000              | STATUS_ACTIVE    |
    75      And the parties should have the following account balances:
    76        | party  | asset | market id | margin  | general  | bond |
    77        | party1 | ETH   | ETH/DEC21 | 2402400 | 97596600 | 1000 |    
    78      And the insurance pool balance should be "0" for the market "ETH/DEC21"
    79  
    80      # Move forward 6 blocks and then cancel the commitment covering order
    81      When the network moves ahead "6" blocks
    82      # Cancel the order so we are no longer covering our commitment
    83      Then the parties cancel the following orders:
    84        | party   | reference      |
    85        | party1  | party1-order1  |
    86        | party1  | party1-order2  |
    87  
    88      # Move forward 1 block to end the epoch and make sure we still do not get punished as we covered 4/5 blocks (0.8 coverage > 0.5 required)
    89      When the network moves ahead "1" blocks
    90      And the parties should have the following account balances:
    91        | party  | asset | market id | margin | general  | bond |
    92        | party1 | ETH   | ETH/DEC21 | 0      | 99999000 | 1000 |    
    93      And the insurance pool balance should be "0" for the market "ETH/DEC21"
    94  
    95      # Now move forward 7 more blocks to complete another epoch and to show we do get punished
    96      When the network moves ahead "7" blocks
    97      Then the market data for the market "ETH/DEC21" should be:
    98        | mark price | trading mode            | target stake | supplied stake | open interest | best static bid price | static mid price | best static offer price |
    99        | 1000       | TRADING_MODE_CONTINUOUS | 1000         | 810            | 10            | 900                   | 1000             | 1100                    |
   100      And the parties should have the following account balances:
   101        | party  | asset | market id | margin | general  | bond |
   102        | party1 | ETH   | ETH/DEC21 | 0      | 99999000 | 810  |    
   103      And the insurance pool balance should be "190" for the market "ETH/DEC21"
   104