code.vegaprotocol.io/vega@v0.79.0/core/integration/features/liquidity-provision/0044-LIME-115.feature (about) 1 Feature: Test change of SLA market parameter 2 3 Background: 4 5 Given the margin calculator named "margin-calculator-1": 6 | search factor | initial factor | release factor | 7 | 1.2 | 1.5 | 1.7 | 8 Given the log normal risk model named "log-normal-risk-model": 9 | risk aversion | tau | mu | r | sigma | 10 | 0.000001 | 0.1 | 0 | 0 | 1.0 | 11 And the following network parameters are set: 12 | name | value | 13 | market.value.windowLength | 60s | 14 | network.markPriceUpdateMaximumFrequency | 0s | 15 | limits.markets.maxPeggedOrders | 6 | 16 | market.auction.minimumDuration | 1 | 17 | market.fee.factors.infrastructureFee | 0.001 | 18 | market.fee.factors.makerFee | 0.004 | 19 And the liquidity monitoring parameters: 20 | name | triggering ratio | time window | scaling factor | 21 | lqm-params | 1.0 | 20s | 1 | 22 #risk factor short:3.5569036 23 #risk factor long:0.801225765 24 And the following assets are registered: 25 | id | decimal places | 26 | ETH | 0 | 27 And the fees configuration named "fees-config-1": 28 | maker fee | infrastructure fee | 29 | 0.0004 | 0.001 | 30 And the price monitoring named "price-monitoring": 31 | horizon | probability | auction extension | 32 | 3600 | 0.99 | 3 | 33 34 And the liquidity sla params named "SLA-22-1": 35 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 36 | 0.9 | 0.6 | 1 | 1.0 | 37 And the liquidity sla params named "SLA-22-2": 38 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 39 | 0.1 | 0.6 | 1 | 1.0 | 40 41 And the liquidity sla params named "SLA-22": 42 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 43 | 0.5 | 0.6 | 1 | 1.0 | 44 45 And the spot markets: 46 | id | name | base asset | quote asset | liquidity monitoring | risk model | auction duration | fees | price monitoring | sla params | 47 | BTC/ETH | BTC/ETH | BTC | ETH | lqm-params | log-normal-risk-model | 2 | fees-config-1 | price-monitoring | SLA-22 | 48 49 And the following network parameters are set: 50 | name | value | 51 | market.liquidity.bondPenaltyParameter | 0.2 | 52 | validators.epoch.length | 5s | 53 | market.liquidity.stakeToCcyVolume | 1 | 54 | market.liquidity.successorLaunchWindowLength | 1h | 55 | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.7 | 56 | market.liquidity.sla.nonPerformanceBondPenaltyMax | 0.6 | 57 | validators.epoch.length | 10s | 58 | market.liquidity.earlyExitPenalty | 0.25 | 59 60 Given the average block duration is "1" 61 62 @Now 63 Scenario: 001: lp1 and lp2 on the market BTC/ETH, 0044-LIME-091, 0044-LIME-115 64 Given the parties deposit on asset's general account the following amount: 65 | party | asset | amount | 66 | lp1 | ETH | 200000 | 67 | lp2 | ETH | 200000 | 68 | party1 | ETH | 100000 | 69 | party2 | ETH | 100000 | 70 | party3 | ETH | 100000 | 71 | ptbuy | ETH | 100000 | 72 | ptsell | ETH | 100000 | 73 | lp1 | BTC | 200000 | 74 | lp2 | BTC | 200000 | 75 | party1 | BTC | 100000 | 76 | party2 | BTC | 100000 | 77 | party3 | BTC | 100000 | 78 | ptbuy | BTC | 100000 | 79 | ptsell | BTC | 100000 | 80 81 And the parties submit the following liquidity provision: 82 | id | party | market id | commitment amount | fee | lp type | 83 | lp_1 | lp1 | BTC/ETH | 4000 | 0.02 | submission | 84 | lp_2 | lp2 | BTC/ETH | 4000 | 0.015 | submission | 85 86 When the network moves ahead "11" blocks 87 88 And the parties place the following pegged iceberg orders: 89 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | reference | 90 | lp1 | BTC/ETH | 1 | 1 | buy | BID | 12 | 200 | lp-b-1 | 91 | lp1 | BTC/ETH | 1 | 1 | sell | ASK | 12 | 200 | lp-s-1 | 92 | lp2 | BTC/ETH | 1 | 1 | buy | BID | 12 | 200 | lp-b-1 | 93 | lp2 | BTC/ETH | 1 | 1 | sell | ASK | 12 | 200 | lp-s-1 | 94 95 Then the parties place the following orders: 96 | party | market id | side | volume | price | resulting trades | type | tif | reference | 97 | party1 | BTC/ETH | buy | 10 | 910 | 0 | TYPE_LIMIT | TIF_GTC | best-buy | 98 | party1 | BTC/ETH | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | | 99 | party2 | BTC/ETH | sell | 10 | 1110 | 0 | TYPE_LIMIT | TIF_GTC | best-sell | 100 | party2 | BTC/ETH | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | | 101 102 Then the opening auction period ends for market "BTC/ETH" 103 And the following trades should be executed: 104 | buyer | price | size | seller | 105 | party1 | 1000 | 1 | party2 | 106 107 And the market data for the market "BTC/ETH" should be: 108 | mark price | trading mode | target stake | supplied stake | 109 | 1000 | TRADING_MODE_CONTINUOUS | 8000 | 8000 | 110 And the liquidity fee factor should be "0.02" for the market "BTC/ETH" 111 112 ##0044-LIME-091: price range in SLA parameter is getting wider, changes from 0.5 to 0.9 113 Then the spot markets are updated: 114 | id | risk model | price monitoring | data source config | sla params | 115 | BTC/ETH | log-normal-risk-model | price-monitoring | default-eth-for-future | SLA-22-1 | 116 117 Then the network moves ahead "2" epochs 118 119 #0044-LIME-115:price range in SLA parameter is getting narrower, changes from 0.5 to 0.1 120 Then the spot markets are updated: 121 | id | risk model | price monitoring | data source config | sla params | 122 | BTC/ETH | log-normal-risk-model | price-monitoring | default-eth-for-future | SLA-22-2 | 123 Then the network moves ahead "3" epochs 124 125 Then the following transfers should happen: 126 | from | to | from account | to account | market id | amount | asset | 127 | lp1 | market | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_NETWORK_TREASURY | BTC/ETH | 2400 | ETH | 128 | lp2 | market | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_NETWORK_TREASURY | BTC/ETH | 2400 | ETH | 129 And the network treasury balance should be "6720" for the asset "ETH" 130 131 When the parties place the following orders: 132 | party | market id | side | volume | price | resulting trades | type | tif | 133 | ptbuy | BTC/ETH | buy | 2 | 970 | 0 | TYPE_LIMIT | TIF_GTC | 134 | ptsell | BTC/ETH | sell | 2 | 970 | 0 | TYPE_LIMIT | TIF_GTC | 135 | ptbuy | BTC/ETH | sell | 1 | 990 | 0 | TYPE_LIMIT | TIF_GTC | 136 | ptsell | BTC/ETH | buy | 1 | 900 | 0 | TYPE_LIMIT | TIF_GTC | 137 138 Then the market data for the market "BTC/ETH" should be: 139 | mark price | trading mode | auction trigger | target stake | supplied stake | auction end | 140 | 1000 | TRADING_MODE_MONITORING_AUCTION | AUCTION_TRIGGER_PRICE | 8000 | 1280 | 3 | 141 142 When the parties submit the following liquidity provision: 143 | id | party | market id | commitment amount | fee | lp type | 144 | lp_1 | lp1 | BTC/ETH | 4000 | 0.02 | amendment | 145 | lp_2 | lp2 | BTC/ETH | 4000 | 0.015 | amendment | 146 147 #0044-LIME-115:during auction the parties place orders within the price range: 0.1 which should count as SLA 148 And the parties place the following orders: 149 | party | market id | side | volume | price | resulting trades | type | tif | 150 | lp1 | BTC/ETH | buy | 12 | 998 | 0 | TYPE_LIMIT | TIF_GTC | 151 | lp1 | BTC/ETH | sell | 12 | 1002 | 0 | TYPE_LIMIT | TIF_GTC | 152 | lp2 | BTC/ETH | buy | 12 | 998 | 0 | TYPE_LIMIT | TIF_GTC | 153 | lp2 | BTC/ETH | sell | 12 | 1002 | 0 | TYPE_LIMIT | TIF_GTC | 154 Then the network moves ahead "4" blocks 155 156 Then the parties should have the following account balances: 157 | party | asset | market id | general | bond | 158 | lp1 | ETH | BTC/ETH | 171056 | 4000 | 159 | lp2 | ETH | BTC/ETH | 171088 | 4000 | 160 When the network moves ahead "11" blocks 161 And the network treasury balance should be "6780" for the asset "ETH" 162 163 And the market data for the market "BTC/ETH" should be: 164 | mark price | trading mode | target stake | supplied stake | 165 | 994 | TRADING_MODE_CONTINUOUS | 8000 | 8000 | 166 167 Then the parties should have the following account balances: 168 | party | asset | market id | general | bond | 169 | lp1 | ETH | BTC/ETH | 171056 | 4000 | 170 | lp2 | ETH | BTC/ETH | 171088 | 4000 | 171 172