code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spots/SpotFunctionalTests/0080-SPOT-017.feature (about) 1 Feature: Spot Markets 2 3 Scenario: When going into auction a buy order requires any possible fees to be moved to the holding account in the case the order is matched. 4 If the party does not have sufficient funds in their general account to cover this transfer, the order should be cancelled (0080-SPOT-017). 5 6 Background: 7 Given the following network parameters are set: 8 | name | value | 9 | network.markPriceUpdateMaximumFrequency | 0s | 10 And the average block duration is "1" 11 Given the fees configuration named "fees-config-1": 12 | maker fee | infrastructure fee | 13 | 0.005 | 0.002 | 14 And the simple risk model named "my-simple-risk-model": 15 | long | short | max move up | min move down | probability of trading | 16 | 0.01 | 0.01 | 10 | -10 | 0.2 | 17 And the fees configuration named "my-fees-config": 18 | maker fee | infrastructure fee | 19 | 0.004 | 0.001 | 20 And the price monitoring named "price-monitoring": 21 | horizon | probability | auction extension | 22 | 3600 | 0.95 | 3 | 23 24 And the spot markets: 25 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | sla params | 26 | BTC/ETH | BTC/ETH | BTC | ETH | my-simple-risk-model | 1 | fees-config-1 | price-monitoring | default-basic | 27 # setup accounts 28 Given the parties deposit on asset's general account the following amount: 29 | party | asset | amount | 30 | party1 | ETH | 20000 | 31 | party2 | BTC | 100 | 32 | party3 | ETH | 1000 | 33 34 # place orders and generate trades 35 And the parties place the following orders: 36 | party | market id | side | volume | price | resulting trades | type | tif | reference | 37 | party1 | BTC/ETH | buy | 1 | 100 | 0 | TYPE_LIMIT | TIF_GFA | t1-b-1 | 38 | party2 | BTC/ETH | sell | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | t2-s-1 | 39 | party3 | BTC/ETH | buy | 10 | 100 | 0 | TYPE_LIMIT | TIF_GTC | bla-bla | 40 41 And the orders should have the following status: 42 | party | reference | status | 43 | party3 | bla-bla | STATUS_ACTIVE | 44 45 Then the opening auction period ends for market "BTC/ETH" 46 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH" 47 And the mark price should be "100" for the market "BTC/ETH" 48 When the network moves ahead "1" blocks 49 50 And the orders should have the following status: 51 | party | reference | status | 52 | party3 | bla-bla | STATUS_ACTIVE | 53 54 # Place an order outside the price range to trigger a price monitoring auction 55 And the parties place the following orders: 56 | party | market id | side | volume | price | resulting trades | type | tif | 57 | party1 | BTC/ETH | buy | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | 58 | party2 | BTC/ETH | sell | 2 | 191 | 0 | TYPE_LIMIT | TIF_GTC | 59 60 # Check the account details for party3 while in continuous trading 61 Then "party3" should have holding account balance of "1000" for asset "ETH" 62 Then "party3" should have general account balance of "0" for asset "ETH" 63 64 And the parties place the following orders: 65 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 66 | party1 | BTC/ETH | buy | 1 | 191 | 0 | TYPE_LIMIT | TIF_GTC | buy2 | | 67 68 When the network moves ahead "1" blocks 69 And the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "BTC/ETH" 70 71 # We have moved into monitoring auction and need to transfer more funds to the holding account but we do not have enough 72 # so we have to cancel the order 73 And the orders should have the following status: 74 | party | reference | status | 75 | party3 | bla-bla | STATUS_CANCELLED | 76 77 78 79