code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/liquidity_provision/0044-LIME-056.feature (about) 1 Feature: Spot market SLA 2 3 Scenario: 0044-LIME-056, The LP can cancel their commitment at any time (though this may involve incurring a penalty) 4 Given the fees configuration named "fees-config-1": 5 | maker fee | infrastructure fee | 6 | 0 | 0 | 7 Given the log normal risk model named "lognormal-risk-model-1": 8 | risk aversion | tau | mu | r | sigma | 9 | 0.001 | 0.01 | 0 | 0.0 | 1.2 | 10 11 And the price monitoring named "price-monitoring-1": 12 | horizon | probability | auction extension | 13 | 360000 | 0.999 | 300 | 14 15 And the liquidity sla params named "SLA-1": 16 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 17 | 0.001 | 0.1 | 2 | 0.2 | 18 19 Given the following assets are registered: 20 | id | decimal places | 21 | ETH | 1 | 22 | BTC | 1 | 23 24 And the following network parameters are set: 25 | name | value | 26 | network.markPriceUpdateMaximumFrequency | 2s | 27 | market.liquidity.earlyExitPenalty | 0.25 | 28 | market.liquidity.bondPenaltyParameter | 0 | 29 | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.5 | 30 | market.liquidity.sla.nonPerformanceBondPenaltyMax | 0.2 | 31 | market.liquidity.maximumLiquidityFeeFactorLevel | 0.4 | 32 | validators.epoch.length | 2s | 33 34 Given time is updated to "2023-07-20T00:00:00Z" 35 36 And the spot markets: 37 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | sla params | 38 | BTC/ETH | BTC/ETH | BTC | ETH | lognormal-risk-model-1 | 1 | fees-config-1 | price-monitoring-1 | SLA-1 | 39 And the following network parameters are set: 40 | name | value | 41 | market.liquidity.providersFeeCalculationTimeStep | 1s | 42 43 Given the parties deposit on asset's general account the following amount: 44 | party | asset | amount | 45 | party1 | ETH | 10000 | 46 | party2 | BTC | 50 | 47 | lpprov1 | ETH | 4000 | 48 | lpprov1 | BTC | 60 | 49 | lpprov2 | ETH | 4000 | 50 | lpprov2 | BTC | 60 | 51 52 And the average block duration is "1" 53 54 Given the liquidity monitoring parameters: 55 | name | triggering ratio | time window | scaling factor | 56 | updated-lqm-params | 0.2 | 20s | 0.8 | 57 58 When the spot markets are updated: 59 | id | liquidity monitoring | linear slippage factor | quadratic slippage factor | 60 | BTC/ETH | updated-lqm-params | 0.5 | 0.5 | 61 62 When the parties submit the following liquidity provision: 63 | id | party | market id | commitment amount | fee | lp type | 64 | lp1 | lpprov1 | BTC/ETH | 2000 | 0.1 | submission | 65 | lp2 | lpprov2 | BTC/ETH | 2000 | 0.1 | submission | 66 67 Then the network moves ahead "1" blocks 68 And the network treasury balance should be "0" for the asset "ETH" 69 And the party "lpprov1" lp liquidity fee account balance should be "0" for the market "BTC/ETH" 70 Then the party "lpprov1" lp liquidity bond account balance should be "2000" for the market "BTC/ETH" 71 72 Then the market data for the market "BTC/ETH" should be: 73 | mark price | trading mode | auction trigger | target stake | supplied stake | open interest | 74 | 0 | TRADING_MODE_OPENING_AUCTION | AUCTION_TRIGGER_OPENING | 3200 | 4000 | 0 | 75 76 # place orders and generate trades 77 And the parties place the following orders: 78 | party | market id | side | volume | price | resulting trades | type | tif | reference | only | 79 | party1 | BTC/ETH | buy | 1 | 12 | 0 | TYPE_LIMIT | TIF_GTC | party-order1 | | 80 | party2 | BTC/ETH | sell | 1 | 19 | 0 | TYPE_LIMIT | TIF_GTC | party-order2 | | 81 | party1 | BTC/ETH | buy | 1 | 15 | 0 | TYPE_LIMIT | TIF_GTC | party-order3 | | 82 | party2 | BTC/ETH | sell | 1 | 15 | 0 | TYPE_LIMIT | TIF_GTC | party-order4 | | 83 | lpprov1 | BTC/ETH | buy | 6 | 8 | 0 | TYPE_LIMIT | TIF_GTC | lp-order1 | | 84 | lpprov1 | BTC/ETH | sell | 6 | 24 | 0 | TYPE_LIMIT | TIF_GTC | lp-order2 | | 85 86 When the network moves ahead "1" blocks 87 88 Then the market data for the market "BTC/ETH" should be: 89 | mark price | trading mode | auction trigger | target stake | supplied stake | open interest | 90 | 15 | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 3200 | 4000 | 0 | 91 92 And the parties should have the following account balances: 93 | party | asset | market id | general | 94 | lpprov1 | BTC | BTC/ETH | 0 | 95 | lpprov1 | ETH | BTC/ETH | 1520 | 96 97 When party "lpprov1" cancels their liquidity provision for market "BTC/ETH" 98 99 Then the network moves ahead "7" blocks 100 101 Then the liquidity provisions should have the following states: 102 | id | party | market | commitment amount | status | 103 | lp1 | lpprov1 | BTC/ETH | 0 | STATUS_CANCELLED | 104 105 Then the market data for the market "BTC/ETH" should be: 106 | mark price | trading mode | auction trigger | target stake | supplied stake | 107 | 15 | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 3200 | 2000 | 108 # since earlyExitPenalty=0.25, so bond slashed is: 1200*0.25=300 109 And the network treasury balance should be "300" for the asset "ETH" 110 111