code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0014-ORDT-081.feature (about) 1 Feature: Spot market 2 3 Background: 4 5 Given the following network parameters are set: 6 | name | value | 7 | network.markPriceUpdateMaximumFrequency | 0s | 8 | market.value.windowLength | 1h | 9 10 Given the following assets are registered: 11 | id | decimal places | 12 | ETH | 2 | 13 | BTC | 2 | 14 15 Given the fees configuration named "fees-config-1": 16 | maker fee | infrastructure fee | 17 | 0.01 | 0.03 | 18 Given the log normal risk model named "lognormal-risk-model-1": 19 | risk aversion | tau | mu | r | sigma | 20 | 0.001 | 0.01 | 0 | 0.0 | 1.2 | 21 And the price monitoring named "price-monitoring-1": 22 | horizon | probability | auction extension | 23 | 360000 | 0.999 | 1 | 24 25 And the spot markets: 26 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | decimal places | position decimal places | sla params | 27 | BTC/ETH | BTC/ETH | BTC | ETH | lognormal-risk-model-1 | 1 | fees-config-1 | price-monitoring-1 | 2 | 2 | default-basic | 28 29 # setup accounts 30 Given the parties deposit on asset's general account the following amount: 31 | party | asset | amount | 32 | party1 | ETH | 10000 | 33 | party2 | ETH | 10000 | 34 | party3 | ETH | 10000 | 35 | party5 | BTC | 100 | 36 And the average block duration is "1" 37 38 # Place some orders to get out of auction 39 And the parties place the following orders: 40 | party | market id | side | volume | price | resulting trades | type | tif | 41 | party1 | BTC/ETH | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GFA | 42 | party5 | BTC/ETH | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 43 44 And the opening auction period ends for market "BTC/ETH" 45 When the network moves ahead "1" blocks 46 Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH" 47 48 49 Scenario: Continuous trading a persistent (GTC) limit order that is not crossed with the order book is included on the order book 50 at limit order price at the back of the queue of orders at that price. No trades are generated. (0014-ORDT-081) 51 52 # Place some orders to get some price levels 53 And the parties place the following orders: 54 | party | market id | side | volume | price | resulting trades | type | tif | reference | 55 | party1 | BTC/ETH | buy | 1 | 999 | 0 | TYPE_LIMIT | TIF_GTC | buy1 | 56 | party2 | BTC/ETH | buy | 1 | 999 | 0 | TYPE_LIMIT | TIF_GTC | buy2 | 57 | party5 | BTC/ETH | sell | 1 | 1001 | 0 | TYPE_LIMIT | TIF_GTC | sell1 | 58 59 # Now place the persistent GTC order to rest on the book at the back of the price levels 60 # It will not trade 61 And the parties place the following orders: 62 | party | market id | side | volume | price | resulting trades | type | tif | reference | 63 | party3 | BTC/ETH | buy | 1 | 999 | 0 | TYPE_LIMIT | TIF_GTC | buy3 | 64 65 # Check that the order was placed at the back of the price level queue by 66 # matching against each order on that level in order 67 # Match 1 68 And the parties place the following orders: 69 | party | market id | side | volume | price | resulting trades | type | tif | 70 | party5 | BTC/ETH | sell | 1 | 999 | 1 | TYPE_LIMIT | TIF_GTC | 71 72 And the orders should have the following status: 73 | party | reference | status | 74 | party1 | buy1 | STATUS_FILLED | 75 | party2 | buy2 | STATUS_ACTIVE | 76 | party3 | buy3 | STATUS_ACTIVE | 77 78 # Match 2 79 And the parties place the following orders: 80 | party | market id | side | volume | price | resulting trades | type | tif | 81 | party5 | BTC/ETH | sell | 1 | 999 | 1 | TYPE_LIMIT | TIF_GTC | 82 83 And the orders should have the following status: 84 | party | reference | status | 85 | party1 | buy1 | STATUS_FILLED | 86 | party2 | buy2 | STATUS_FILLED | 87 | party3 | buy3 | STATUS_ACTIVE | 88 89 # Match 3 90 And the parties place the following orders: 91 | party | market id | side | volume | price | resulting trades | type | tif | 92 | party5 | BTC/ETH | sell | 1 | 999 | 1 | TYPE_LIMIT | TIF_GTC | 93 94 And the orders should have the following status: 95 | party | reference | status | 96 | party1 | buy1 | STATUS_FILLED | 97 | party2 | buy2 | STATUS_FILLED | 98 | party3 | buy3 | STATUS_FILLED | 99 100 101 Scenario: Continuous trading a persistent (GTT) limit order that is not crossed with the order book is included on the order book 102 at limit order price at the back of the queue of orders at that price. No trades are generated. (0014-ORDT-081) 103 104 # Place some orders to get some price levels 105 And the parties place the following orders: 106 | party | market id | side | volume | price | resulting trades | type | tif | reference | 107 | party1 | BTC/ETH | buy | 1 | 999 | 0 | TYPE_LIMIT | TIF_GTC | buy1 | 108 | party2 | BTC/ETH | buy | 1 | 999 | 0 | TYPE_LIMIT | TIF_GTC | buy2 | 109 | party5 | BTC/ETH | sell | 1 | 1001 | 0 | TYPE_LIMIT | TIF_GTC | sell1 | 110 111 # Now place the persistent GTT order to rest on the book at the back of the price levels 112 # It will not trade 113 And the parties place the following orders: 114 | party | market id | side | volume | price | resulting trades | type | tif | reference | expires in | 115 | party3 | BTC/ETH | buy | 1 | 999 | 0 | TYPE_LIMIT | TIF_GTT | buy3 | 3600 | 116 117 # Check that the order was placed at the back of the price level queue by 118 # matching against each order on that level in order 119 # Match 1 120 And the parties place the following orders: 121 | party | market id | side | volume | price | resulting trades | type | tif | 122 | party5 | BTC/ETH | sell | 1 | 999 | 1 | TYPE_LIMIT | TIF_GTC | 123 124 And the orders should have the following status: 125 | party | reference | status | 126 | party1 | buy1 | STATUS_FILLED | 127 | party2 | buy2 | STATUS_ACTIVE | 128 | party3 | buy3 | STATUS_ACTIVE | 129 130 # Match 2 131 And the parties place the following orders: 132 | party | market id | side | volume | price | resulting trades | type | tif | 133 | party5 | BTC/ETH | sell | 1 | 999 | 1 | TYPE_LIMIT | TIF_GTC | 134 135 And the orders should have the following status: 136 | party | reference | status | 137 | party1 | buy1 | STATUS_FILLED | 138 | party2 | buy2 | STATUS_FILLED | 139 | party3 | buy3 | STATUS_ACTIVE | 140 141 # Match 3 142 And the parties place the following orders: 143 | party | market id | side | volume | price | resulting trades | type | tif | 144 | party5 | BTC/ETH | sell | 1 | 999 | 1 | TYPE_LIMIT | TIF_GTC | 145 146 And the orders should have the following status: 147 | party | reference | status | 148 | party1 | buy1 | STATUS_FILLED | 149 | party2 | buy2 | STATUS_FILLED | 150 | party3 | buy3 | STATUS_FILLED | 151 152