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