code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0024-OSTA-030.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 | party1 | BTC | 1000 | 34 | party2 | ETH | 100000 | 35 | party2 | BTC | 1000 | 36 | party3 | ETH | 100000 | 37 | party5 | BTC | 1000 | 38 And the average block duration is "1" 39 40 # 0024-OSTA-039, Place some orders to get out of auction, GFN order should be rejected during auction 41 And the parties place the following orders: 42 | party | market id | side | volume | price | resulting trades | type | tif | error | 43 | party1 | BTC/ETH | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GFA | | 44 | party5 | BTC/ETH | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | | 45 | party5 | BTC/ETH | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GFN | gfn order received during auction trading | 46 47 And the opening auction period ends for market "BTC/ETH" 48 When the network moves ahead "1" blocks 49 Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH" 50 51 Scenario: 0024-OSTA-030,0024-OSTA-031, 0024-OSTA-032 FOK, IOC and GTC order on spot market 52 53 And the parties place the following orders: 54 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 55 | party1 | BTC/ETH | buy | 2 | 996 | 0 | TYPE_LIMIT | TIF_GTC | p1-buy1 | | 56 | party1 | BTC/ETH | buy | 2 | 997 | 0 | TYPE_LIMIT | TIF_GTC | p1-buy2 | | 57 | party1 | BTC/ETH | buy | 2 | 998 | 0 | TYPE_LIMIT | TIF_GTC | p1-buy3 | | 58 | party1 | BTC/ETH | buy | 2 | 999 | 0 | TYPE_LIMIT | TIF_GTC | p1-buy4 | | 59 | party2 | BTC/ETH | sell | 1 | 999 | 1 | TYPE_LIMIT | TIF_FOK | p2-sell1 | | 60 | party2 | BTC/ETH | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_FOK | p2-sell2 | | 61 When the network moves ahead "1" blocks 62 63 # GTC order no filled, partially filled 64 And the orders should have the following status: 65 | party | reference | status | 66 | party1 | p1-buy1 | STATUS_ACTIVE | 67 | party1 | p1-buy2 | STATUS_ACTIVE | 68 | party1 | p1-buy3 | STATUS_ACTIVE | 69 | party2 | p2-sell1 | STATUS_FILLED | 70 | party2 | p2-sell2 | STATUS_STOPPED | 71 72 And the order book should have the following volumes for market "BTC/ETH": 73 | side | price | volume | 74 | buy | 999 | 1 | 75 76 And the parties place the following orders: 77 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 78 | party2 | BTC/ETH | sell | 1 | 999 | 1 | TYPE_LIMIT | TIF_GTC | p2-sell3 | | 79 #GTC order filled 80 And the orders should have the following status: 81 | party | reference | status | 82 | party1 | p1-buy4 | STATUS_FILLED | 83 84 And the order book should have the following volumes for market "BTC/ETH": 85 | side | price | volume | 86 | buy | 999 | 0 | 87 88 And the parties place the following orders: 89 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 90 | party2 | BTC/ETH | sell | 1 | 998 | 1 | TYPE_LIMIT | TIF_GTC | p2-sell3 | | 91 #GTC order partially filled 92 And the orders should have the following status: 93 | party | reference | status | 94 | party1 | p1-buy3 | STATUS_ACTIVE | 95 96 And the order book should have the following volumes for market "BTC/ETH": 97 | side | price | volume | 98 | buy | 998 | 1 | 99 100 Then the parties amend the following orders: 101 | party | reference | price | size delta | tif | 102 | party1 | p1-buy3 | 998 | -1 | TIF_GTC | 103 #GTC partially filled is canclled by trader 104 And the orders should have the following status: 105 | party | reference | status | 106 | party1 | p1-buy3 | STATUS_CANCELLED | 107 108 #GTC order rejected by system 109 And the parties place the following orders: 110 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 111 | party5 | BTC/ETH | sell | 5000 | 998 | 0 | TYPE_LIMIT | TIF_GTC | p5-sell2 | party does not have sufficient balance to cover the trade and fees | 112 113 And the parties place the following orders: 114 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 115 | party2 | BTC/ETH | sell | 1 | 997 | 1 | TYPE_LIMIT | TIF_IOC | p2-sell4 | | 116 117 #IOC order filled 118 And the orders should have the following status: 119 | party | reference | status | 120 | party2 | p2-sell4 | STATUS_FILLED | 121 122 And the parties place the following orders: 123 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 124 | party2 | BTC/ETH | sell | 2 | 997 | 1 | TYPE_LIMIT | TIF_IOC | p2-sell5 | | 125 126 #IOC order partially filled and stopped 127 And the orders should have the following status: 128 | party | reference | status | 129 | party2 | p2-sell5 | STATUS_PARTIALLY_FILLED | 130 131 And the order book should have the following volumes for market "BTC/ETH": 132 | side | price | volume | 133 | sell | 997 | 0 | 134 135 #IOC order un-filled and stopped 136 And the parties place the following orders: 137 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 138 | party2 | BTC/ETH | sell | 2 | 997 | 0 | TYPE_LIMIT | TIF_IOC | p2-sell5 | | 139 140 And the orders should have the following status: 141 | party | reference | status | 142 | party2 | p2-sell5 | STATUS_STOPPED | 143 144 And the order book should have the following volumes for market "BTC/ETH": 145 | side | price | volume | 146 | sell | 997 | 0 |