code.vegaprotocol.io/vega@v0.79.0/core/integration/features/liquidity-provision/0044-LIME-060.feature (about) 1 Feature: LP can always remove commitment 2 3 # For a market that is in continuous trading and a single LP has committed liquidity: 4 # The LP can cancel their commitment at any time (though this may involve incurring a penalty) (0044-LIME-060) 5 6 Background: 7 Given the following network parameters are set: 8 | name | value | 9 | market.liquidity.bondPenaltyParameter | 1 | 10 | network.markPriceUpdateMaximumFrequency | 0s | 11 | limits.markets.maxPeggedOrders | 2 | 12 | validators.epoch.length | 5s | 13 | market.liquidity.earlyExitPenalty | 0.25 | 14 | market.liquidity.stakeToCcyVolume | 1.0 | 15 | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.19 | 16 | market.liquidity.sla.nonPerformanceBondPenaltyMax | 1 | 17 And the liquidity monitoring parameters: 18 | name | triggering ratio | time window | scaling factor | 19 | lqm-params | 0.1 | 24h | 1 | 20 And the average block duration is "1" 21 And the simple risk model named "simple-risk-model-1": 22 | long | short | max move up | min move down | probability of trading | 23 | 0.1 | 0.1 | 60 | 50 | 0.2 | 24 And the fees configuration named "fees-config-1": 25 | maker fee | infrastructure fee | 26 | 0.004 | 0.001 | 27 And the price monitoring named "price-monitoring-1": 28 | horizon | probability | auction extension | 29 | 1 | 0.99 | 5 | 30 And the liquidity sla params named "SLA": 31 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 32 | 0.01 | 0.5 | 1 | 1.0 | 33 And the markets: 34 | 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 | 35 | 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 | 36 And the parties deposit on asset's general account the following amount: 37 | party | asset | amount | 38 | party1 | ETH | 100000000 | 39 | party3 | ETH | 100000000 | 40 | party4 | ETH | 100000000 | 41 And the parties submit the following liquidity provision: 42 | id | party | market id | commitment amount | fee | lp type | 43 | lp1 | party1 | ETH/DEC21 | 1000 | 0.001 | submission | 44 And the parties place the following orders: 45 | party | market id | side | volume | price | resulting trades | type | tif | reference | 46 | party3 | ETH/DEC21 | buy | 1000 | 900 | 0 | TYPE_LIMIT | TIF_GTC | p3b1 | 47 | party3 | ETH/DEC21 | buy | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | p3b2 | 48 | party4 | ETH/DEC21 | sell | 1000 | 1100 | 0 | TYPE_LIMIT | TIF_GTC | p4s1 | 49 | party4 | ETH/DEC21 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | p4s2 | 50 51 Scenario: 001, In a continuous market, the single LP can cancel their commitment 52 When the opening auction period ends for market "ETH/DEC21" 53 And the auction ends with a traded volume of "10" at a price of "1000" 54 Then the market data for the market "ETH/DEC21" should be: 55 | mark price | trading mode | target stake | supplied stake | open interest | best static bid price | static mid price | best static offer price | 56 | 1000 | TRADING_MODE_CONTINUOUS | 1000 | 1000 | 10 | 900 | 1000 | 1100 | 57 # Place LIMIT orders to cover our commitment 58 And the parties place the following orders: 59 | party | market id | side | volume | price | resulting trades | type | tif | reference | 60 | party1 | ETH/DEC21 | buy | 10 | 999 | 0 | TYPE_LIMIT | TIF_GTC | party1-order1 | 61 | party1 | ETH/DEC21 | sell | 10 | 1001 | 0 | TYPE_LIMIT | TIF_GTC | party1-order2 | 62 When the network moves ahead "1" blocks 63 Then the liquidity provisions should have the following states: 64 | id | party | market | commitment amount | status | 65 | lp1 | party1 | ETH/DEC21 | 1000 | STATUS_ACTIVE | 66 And the parties should have the following account balances: 67 | party | asset | market id | margin | general | bond | 68 | party1 | ETH | ETH/DEC21 | 1200 | 99997800 | 1000 | 69 And the insurance pool balance should be "0" for the market "ETH/DEC21" 70 71 # Now the party try to cancel their commitment 72 When party "party1" cancels their liquidity provision for market "ETH/DEC21" 73 When the network moves ahead "3" blocks 74 75 # Until we end the epoch the LP remains pending 76 Then the liquidity provisions should have the following states: 77 | id | party | market | commitment amount | status | 78 | lp1 | party1 | ETH/DEC21 | 0 | STATUS_PENDING | 79 80 And the parties should have the following account balances: 81 | party | asset | market id | margin | general | bond | 82 | party1 | ETH | ETH/DEC21 | 1200 | 99997800 | 1000 | 83 And the insurance pool balance should be "0" for the market "ETH/DEC21" 84 85 # Now the epoch is over we should see a cancelled LP and 86 # 25% of the bond is given to the insurance pool 87 When the network moves ahead "3" blocks 88 Then the liquidity provisions should have the following states: 89 | id | party | market | commitment amount | status | 90 | lp1 | party1 | ETH/DEC21 | 0 | STATUS_CANCELLED | 91 And the parties should have the following account balances: 92 | party | asset | market id | margin | general | bond | 93 | party1 | ETH | ETH/DEC21 | 1200 | 99998550 | 0 | 94 And the insurance pool balance should be "250" for the market "ETH/DEC21"