code.vegaprotocol.io/vega@v0.79.0/core/integration/features/tick_size/0004-AMND-060.feature (about) 1 Feature: Price change amends specifying a new price which is not an integer multiple of the markets tick size should be rejected and the original order should be left in place 2 3 Background: 4 Given the following assets are registered: 5 | id | decimal places | 6 | ETH | 18 | 7 | USD | 0 | 8 And the perpetual oracles from "0xCAFECAFE1": 9 | name | asset | settlement property | settlement type | schedule property | schedule type | margin funding factor | interest rate | clamp lower bound | clamp upper bound | quote name | settlement decimals | source weights | source staleness tolerance | 10 | perp-oracle | ETH | perp.ETH.value | TYPE_INTEGER | perp.funding.cue | TYPE_TIMESTAMP | 0 | 0 | 0 | 0 | ETH | 18 | 1,0,0,0 | 100s,0s,0s,0s | 11 And the liquidity sla params named "SLA": 12 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 13 | 1.0 | 0.5 | 1 | 1.0 | 14 And the liquidity monitoring parameters: 15 | name | triggering ratio | time window | scaling factor | 16 | lqm-params | 0.01 | 10s | 5 | 17 18 And the markets: 19 | 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 | market type | sla params | tick size | 20 | ETH/DEC19 | ETH | ETH | lqm-params | default-st-risk-model | default-margin-calculator | 1 | default-none | default-none | perp-oracle | 0.1 | 0 | 5 | 5 | perp | SLA | 2 | 21 And the following network parameters are set: 22 | name | value | 23 | network.markPriceUpdateMaximumFrequency | 0s | 24 | market.auction.minimumDuration | 1 | 25 | market.fee.factors.infrastructureFee | 0.001 | 26 | market.fee.factors.makerFee | 0.004 | 27 | market.value.windowLength | 60s | 28 | market.liquidity.bondPenaltyParameter | 0.1 | 29 | validators.epoch.length | 5s | 30 | limits.markets.maxPeggedOrders | 2 | 31 | market.liquidity.providersFeeCalculationTimeStep | 5s | 32 33 And the average block duration is "1" 34 35 # All parties have 1,000,000.000,000,000,000,000,000 36 # Add as many parties as needed here 37 And the parties deposit on asset's general account the following amount: 38 | party | asset | amount | 39 | lpprov | ETH | 10000000000000000000000000 | 40 | trader1 | ETH | 10000000000000000000000000 | 41 | trader2 | ETH | 10000000000000000000000000 | 42 | trader3 | ETH | 10000000000000000000000000 | 43 | trader4 | ETH | 10000000000000000000000000 | 44 | trader5 | ETH | 10000000000000000000000000 | 45 46 Scenario: 001 Create a new market, leave opening auction, attempt to amend an order to an invalid price (0004-AMND-060) 47 # the amount ought to be 390,500.000,000,000,000,000,000 48 Given the parties submit the following liquidity provision: 49 | id | party | market id | commitment amount | fee | lp type | 50 | lp1 | lpprov | ETH/DEC19 | 3905000000000000 | 0.3 | submission | 51 And the parties place the following pegged iceberg orders: 52 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | reference | 53 | lpprov | ETH/DEC19 | 4000000000000000 | 3905000000000000 | buy | BID | 4000000000000000 | 2 | lp-ice-buy | 54 | lpprov | ETH/DEC19 | 4000000000000000 | 3905000000000000 | sell | ASK | 4000000000000000 | 2 | lp-ice-sell | 55 And the parties place the following orders: 56 | party | market id | side | volume | price | resulting trades | type | tif | reference | 57 | trader1 | ETH/DEC19 | buy | 5 | 902 | 0 | TYPE_LIMIT | TIF_GTC | t1-b-1 | 58 | trader1 | ETH/DEC19 | buy | 5 | 900 | 0 | TYPE_LIMIT | TIF_GTC | t1-b-2 | 59 | trader1 | ETH/DEC19 | buy | 5 | 976 | 0 | TYPE_LIMIT | TIF_GTC | t1-b-3 | 60 | trader2 | ETH/DEC19 | sell | 5 | 976 | 0 | TYPE_LIMIT | TIF_GTC | t2-s-1 | 61 | trader2 | ETH/DEC19 | sell | 1 | 100000 | 0 | TYPE_LIMIT | TIF_GTC | t2-s-2 | 62 | trader2 | ETH/DEC19 | sell | 5 | 990 | 0 | TYPE_LIMIT | TIF_GTC | t2-s-3 | 63 When the opening auction period ends for market "ETH/DEC19" 64 Then the market data for the market "ETH/DEC19" should be: 65 | mark price | trading mode | auction trigger | target stake | supplied stake | open interest | 66 | 976 | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 134907600000 | 3905000000000000 | 5 | 67 68 When the parties amend the following orders: 69 | party | reference | price | size delta | tif | error | 70 | trader1 | t1-b-1 | 903 | 0 | TIF_GTC | OrderError: price not in tick size | 71 And the network moves ahead "1" blocks 72 73 Then the orders should have the following states: 74 | party | market id | reference | side | volume | remaining | price | status | 75 | trader1 | ETH/DEC19 | t1-b-1 | buy | 5 | 5 | 902 | STATUS_ACTIVE |