code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spots/SpotFunctionalTests/spot-decimal-positions.feature (about) 1 Feature: Simple Spot Order between two parties match successfully 2 Background: 3 Given the following assets are registered: 4 | id | decimal places | 5 | ETH | 3 | 6 | BTC | 5 | 7 And the fees configuration named "fees-config-1": 8 | maker fee | infrastructure fee | 9 | 0.005 | 0.002 | 10 And the simple risk model named "my-simple-risk-model": 11 | long | short | max move up | min move down | probability of trading | 12 | 0.08628781058136630000 | 0.09370922348428490000 | -1 | -1 | 0.2 | 13 And the fees configuration named "my-fees-config": 14 | maker fee | infrastructure fee | 15 | 0.004 | 0.001 | 16 And the following network parameters are set: 17 | name | value | 18 | market.fee.factors.makerFee | 0.001 | 19 | network.markPriceUpdateMaximumFrequency | 0s | 20 | market.auction.minimumDuration | 1 | 21 | validators.epoch.length | 60s | 22 | limits.markets.maxPeggedOrders | 4 | 23 | referralProgram.minStakedVegaTokens | 0 | 24 25 @SDP2 26 Scenario Outline: Simple Spot Order matches with counter party using different combinations of decimal places. 27 28 Given the spot markets: 29 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | decimal places | position decimal places | sla params | 30 | BTC/ETH | BTC/ETH | BTC | ETH | my-simple-risk-model | 1 | fees-config-1 | default-none | <ETH decimals> | <BTC decimals> | default-basic | 31 # setup accounts 32 And the parties deposit on asset's general account the following amount: 33 | party | asset | amount | 34 | party1 | ETH | 10000000 | 35 | party2 | BTC | 10000000 | 36 | party3 | ETH | 10000000 | 37 | party4 | BTC | 10000000 | 38 # place orders and generate trades 39 When the parties place the following orders: 40 | party | market id | side | volume | price | resulting trades | type | tif | reference | 41 | party1 | BTC/ETH | buy | <volume> | <price> | 0 | TYPE_LIMIT | TIF_GFA | t1-b-1111 | 42 | party2 | BTC/ETH | sell | <volume> | <price> | 0 | TYPE_LIMIT | TIF_GTC | t2-s-1111 | 43 44 Then "party2" should have holding account balance of "100000" for asset "BTC" 45 And "party1" should have holding account balance of "10000" for asset "ETH" 46 47 And the orders should have the following states: 48 | party | market id | side | volume | remaining | price | status | 49 | party1 | BTC/ETH | buy | <volume> | <volume> | <price> | STATUS_ACTIVE | 50 | party2 | BTC/ETH | sell | <volume> | <volume> | <price> | STATUS_ACTIVE | 51 52 When the opening auction period ends for market "BTC/ETH" 53 Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH" 54 And the mark price should be "<mark price>" for the market "BTC/ETH" 55 56 And the following trades should be executed: 57 | buyer | price | size | seller | 58 | party1 | <price> | <volume> | party2 | 59 And "party2" should have holding account balance of "0" for asset "BTC" 60 And "party1" should have holding account balance of "0" for asset "ETH" 61 When the parties place the following orders: 62 | party | market id | side | volume | price | resulting trades | type | tif | reference | 63 | party3 | BTC/ETH | buy | <volume2> | <price2> | 0 | TYPE_LIMIT | TIF_GTC | p3-b-1 | 64 | party4 | BTC/ETH | sell | <volume2> | <price2> | 1 | TYPE_LIMIT | TIF_GTC | p4-s-1 | 65 And the network moves ahead "1" blocks 66 Then the following trades should be executed: 67 | buyer | price | size | seller | 68 | party3 | <price2> | <volume2> | party4 | 69 And the mark price should be "<mark price 2>" for the market "BTC/ETH" 70 And the following transfers should happen: 71 | from | from account | to | to account | market id | amount | asset | type | 72 | party4 | ACCOUNT_TYPE_GENERAL | | ACCOUNT_TYPE_FEES_MAKER | BTC/ETH | <maker fee> | ETH | TRANSFER_TYPE_MAKER_FEE_PAY | 73 | party4 | ACCOUNT_TYPE_GENERAL | | ACCOUNT_TYPE_FEES_INFRASTRUCTURE | BTC/ETH | <infra fee> | ETH | TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY | 74 | party4 | ACCOUNT_TYPE_GENERAL | | ACCOUNT_TYPE_FEES_LIQUIDITY | BTC/ETH | <liquidity fee> | ETH | TRANSFER_TYPE_LIQUIDITY_FEE_PAY | 75 | | ACCOUNT_TYPE_FEES_MAKER | party3 | ACCOUNT_TYPE_GENERAL | BTC/ETH | <receive fee> | ETH | TRANSFER_TYPE_MAKER_FEE_RECEIVE | 76 # Some permutations of position/market decimals within the possible ranges. 77 Examples: 78 | ETH decimals | BTC decimals | volume | price | mark price | volume2 | price2 | mark price 2 | maker fee | infra fee | liquidity fee | receive fee | 79 | 2 | 1 | 10 | 1000 | 1000 | 1 | 110 | 110 | 1 | 1 | 0 | 1 | 80 | 1 | 1 | 10 | 100 | 100 | 10 | 110 | 110 | 11 | 22 | 0 | 11 | 81 | 1 | 2 | 100 | 100 | 100 | 10 | 11 | 11 | 1 | 1 | 0 | 1 | 82 | 3 | 0 | 1 | 10000 | 10000 | 1 | 11000 | 11000 | 11 | 22 | 0 | 11 | 83 | 0 | 3 | 1000 | 10 | 10 | 2000 | 11 | 11 | 22 | 44 | 0 | 22 | 84 | 0 | 0 | 1 | 10 | 10 | 1 | 11 | 11 | 11 | 22 | 0 | 11 |