code.vegaprotocol.io/vega@v0.79.0/core/integration/features/mark-price/0009-MRKP-002.feature (about) 1 Feature: Test setting of mark price 2 Background: 3 Given the following network parameters are set: 4 | name | value | 5 | network.markPriceUpdateMaximumFrequency | 0s | 6 And the liquidity monitoring parameters: 7 | name | triggering ratio | time window | scaling factor | 8 | lqm-params | 0.00 | 24h | 1e-9 | 9 And the simple risk model named "simple-risk-model": 10 | long | short | max move up | min move down | probability of trading | 11 | 0.1 | 0.1 | 100 | -100 | 0.2 | 12 And the markets: 13 | 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 | price type | decay weight | decay power | cash amount | source weights | source staleness tolerance | 14 | ETH/FEB23 | ETH | USD | lqm-params | simple-risk-model | default-margin-calculator | 1 | default-none | default-none | default-eth-for-future | 0.25 | 0 | default-futures | last trade | 0.1 | 0.5 | 0 | 0.1,0.2,0.3,0.6 | 3h0m0s,2s,24h0m0s,1h25m0s | 15 16 Scenario: 001 when network.markPriceUpdateMaximumFrequency=0s 17 Given the parties deposit on asset's general account the following amount: 18 | party | asset | amount | 19 | buySideProvider | USD | 100000000000 | 20 | sellSideProvider | USD | 100000000000 | 21 | party | USD | 48050 | 22 And the parties place the following orders: 23 | party | market id | side | volume | price | resulting trades | type | tif | reference | 24 | buySideProvider | ETH/FEB23 | buy | 10 | 14900 | 0 | TYPE_LIMIT | TIF_GTC | | 25 | buySideProvider | ETH/FEB23 | buy | 1 | 15000 | 0 | TYPE_LIMIT | TIF_GTC | | 26 | buySideProvider | ETH/FEB23 | buy | 3 | 15900 | 0 | TYPE_LIMIT | TIF_GTC | | 27 | party | ETH/FEB23 | sell | 3 | 15900 | 0 | TYPE_LIMIT | TIF_GTC | | 28 | party | ETH/FEB23 | sell | 2 | 15902 | 0 | TYPE_LIMIT | TIF_GTC | party-sell-2 | 29 | party | ETH/FEB23 | sell | 1 | 15904 | 0 | TYPE_LIMIT | TIF_GTC | party-sell-3 | 30 | sellSideProvider | ETH/FEB23 | sell | 1 | 100000 | 0 | TYPE_LIMIT | TIF_GTC | | 31 | sellSideProvider | ETH/FEB23 | sell | 10 | 100100 | 0 | TYPE_LIMIT | TIF_GTC | | 32 33 # AC 0009-MRKP-002 0009-MRKP-003 when network.markPriceUpdateMaximumFrequency=0s 34 When the network moves ahead "2" blocks 35 # Check mark-price matches the specification 36 Then the mark price should be "15900" for the market "ETH/FEB23" 37 38 And the parties should have the following margin levels: 39 | party | market id | maintenance | margin mode | 40 | party | ETH/FEB23 | 21465 | cross margin | 41 #margin = 3*15900*(0.25)+3*0.1*15900 + 3*0.1*15900=21465 42 43 Then the parties should have the following account balances: 44 | party | asset | market id | margin | general | 45 | party | USD | ETH/FEB23 | 25758 | 22292 | 46 47 And the parties place the following orders: 48 | party | market id | side | volume | price | resulting trades | type | tif | reference | 49 | buySideProvider | ETH/FEB23 | buy | 2 | 15902 | 1 | TYPE_LIMIT | TIF_GTC | | 50 51 Then the mark price should be "15900" for the market "ETH/FEB23" 52 When the network moves ahead "1" blocks 53 Then the mark price should be "15902" for the market "ETH/FEB23" 54 55 And the parties place the following orders: 56 | party | market id | side | volume | price | resulting trades | type | tif | reference | 57 | buySideProvider | ETH/FEB23 | buy | 1 | 15904 | 1 | TYPE_LIMIT | TIF_GTC | | 58 59 Then the mark price should be "15902" for the market "ETH/FEB23" 60 When the network moves ahead "1" blocks 61 Then the mark price should be "15904" for the market "ETH/FEB23"