code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/liquidity_provision/0044-LIME-102.feature (about)

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