code.vegaprotocol.io/vega@v0.79.0/core/integration/features/debug.feature (about) 1 Feature: Simple example of successor markets 2 Background: 3 Given the following assets are registered: 4 | id | decimal places | 5 | ETH | 0 | 6 | USD | 0 | 7 And the log normal risk model named "lognormal-risk-model-fish": 8 | risk aversion | tau | mu | r | sigma | 9 | 0.001 | 0.01 | 0 | 0.0 | 1.2 | 10 And the margin calculator named "margin-calculator-1": 11 | search factor | initial factor | release factor | 12 | 1.2 | 1.5 | 2 | 13 And the liquidity monitoring parameters: 14 | name | triggering ratio | time window | scaling factor | 15 | lqm-params | 0.01 | 10s | 10 | 16 17 And the average block duration is "1" 18 # Create some oracles 19 ## oracle for parent 20 And the oracle spec for settlement data filtering data from "0xCAFECAFE1" named "ethDec19Oracle": 21 | property | type | binding | 22 | prices.ETH.value | TYPE_INTEGER | settlement data | 23 And the oracle spec for trading termination filtering data from "0xCAFECAFE1" named "ethDec19Oracle": 24 | property | type | binding | 25 | trading.terminated | TYPE_BOOLEAN | trading termination | 26 And the settlement data decimals for the oracle named "ethDec19Oracle" is given in "5" decimal places 27 ## oracle for a successor 28 And the following network parameters are set: 29 | name | value | 30 | network.markPriceUpdateMaximumFrequency | 0s | 31 | market.auction.minimumDuration | 1 | 32 | market.fee.factors.infrastructureFee | 0.001 | 33 | market.fee.factors.makerFee | 0.004 | 34 | market.value.windowLength | 60s | 35 | market.liquidity.bondPenaltyParameter | 0.2 | 36 | market.liquidity.stakeToCcyVolume | 1 | 37 | market.liquidity.successorLaunchWindowLength | 1h | 38 | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.19 | 39 | market.liquidity.sla.nonPerformanceBondPenaltyMax | 1 | 40 | validators.epoch.length | 2s | 41 | market.liquidity.providersFeeCalculationTimeStep | 2s | 42 And the liquidity sla params named "SLA": 43 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 44 | 1.0 | 0.5 | 1 | 1.0 | 45 # Add as many parties as needed here 46 And the parties deposit on asset's general account the following amount: 47 | party | asset | amount | 48 | lpprov1 | USD | 2000000000 | 49 | lpprov2 | USD | 20000000000 | 50 | lpprov3 | USD | 20000000000 | 51 | lpprov4 | USD | 20000000000 | 52 | trader1 | USD | 2000000 | 53 | trader2 | USD | 2000000 | 54 | trader3 | USD | 2000000 | 55 | trader4 | USD | 2000000 | 56 | trader5 | USD | 22000 | 57 58 @SLADebug 59 Scenario: Reproduce opening auction without LP 60 Given the markets: 61 | id | quote name | asset | liquidity monitoring | risk model | margin calculator | auction duration | fees | price monitoring | data source config | linear slippage factor | quadratic slippage factor | decimal places | position decimal places | parent market id | insurance pool fraction | successor auction | sla params | 62 | ETH/DEC19 | ETH | USD | lqm-params | lognormal-risk-model-fish | margin-calculator-1 | 1 | default-none | default-none | ethDec19Oracle | 0.1 | 0 | 0 | 0 | | | | SLA | 63 When the parties place the following orders: 64 | party | market id | side | volume | price | resulting trades | type | tif | 65 | trader1 | ETH/DEC19 | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 66 | trader2 | ETH/DEC19 | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 67 #When the network moves ahead "2" blocks 68 Then the market data for the market "ETH/DEC19" should be: 69 | trading mode | auction trigger | target stake | supplied stake | open interest | 70 | TRADING_MODE_OPENING_AUCTION | AUCTION_TRIGGER_OPENING | 4878 | 0 | 0 | 71 72 When the parties submit the following liquidity provision: 73 | id | party | market id | commitment amount | fee | lp type | 74 | lp1 | lpprov1 | ETH/DEC19 | 9000 | 0.1 | submission | 75 76 And the market data for the market "ETH/DEC19" should be: 77 | mark price | trading mode | target stake | supplied stake | open interest | 78 | 0 | TRADING_MODE_OPENING_AUCTION | 4878 | 9000 | 0 | 79 Then the opening auction period ends for market "ETH/DEC19" 80 And the network moves ahead "20" blocks 81 #And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 82 And the market data for the market "ETH/DEC19" should be: 83 | mark price | trading mode | auction trigger | target stake | supplied stake | open interest | 84 | 1000 | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 4878 | 3140 | 1 | 85 86 Then the following transfers should happen: 87 | from | to | from account | to account | market id | amount | asset | 88 | lpprov1 | market | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_INSURANCE | ETH/DEC19 | 1710 | USD | 89 | lpprov1 | market | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_INSURANCE | ETH/DEC19 | 1385 | USD | 90 | lpprov1 | market | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_INSURANCE | ETH/DEC19 | 1121 | USD | 91 | lpprov1 | market | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_INSURANCE | ETH/DEC19 | 908 | USD | 92 | lpprov1 | market | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_INSURANCE | ETH/DEC19 | 736 | USD | 93