code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spots/SpotFunctionalTests/TC-0008-Spot-PartialFill.feature (about) 1 Feature: Spot order gets filled partially among three parties 2 3 Scenario: Spot Order gets filled partially among three parties 4 5 Background: 6 7 Given 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 spot markets: 17 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | sla params | 18 | BTC/ETH | BTC/ETH | BTC | ETH | my-simple-risk-model | 1 | fees-config-1 | default-none | default-basic | 19 20 # setup accounts 21 Given the parties deposit on asset's general account the following amount: 22 | party | asset | amount | 23 | party1 | ETH | 100000000 | 24 | party2 | BTC | 5 | 25 | party3 | ETH | 1000000000 | 26 27 # place orders and generate trades 28 And the parties place the following orders: 29 | party | market id | side | volume | price | resulting trades | type | tif | reference | 30 | party1 | BTC/ETH | buy | 1 | 750000 | 0 | TYPE_LIMIT | TIF_GFA | party-order1 | 31 | party2 | BTC/ETH | sell | 5 | 1000000 | 0 | TYPE_LIMIT | TIF_GTC | party-order2 | 32 | party3 | BTC/ETH | buy | 5 | 700000 | 0 | TYPE_LIMIT | TIF_GTC | party-order3 | 33 34 And the opening auction period ends for market "BTC/ETH" 35 36 Then "party1" should have holding account balance of "750000" for asset "ETH" 37 Then "party2" should have holding account balance of "5" for asset "BTC" 38 Then "party3" should have holding account balance of "3500000" for asset "ETH" 39 40 And "party1" should have general account balance of "99250000" for asset "ETH" 41 And "party2" should have general account balance of "0" for asset "BTC" 42 And "party3" should have general account balance of "996500000" for asset "ETH" 43 44 # Force a partial fill to make sure the assets in the holding account are reduced (0080-SPOT-009) 45 And the parties amend the following orders: 46 | party | reference | price | size delta | tif | 47 | party2 | party-order2 | 750000 | 0 | TIF_GTC | 48 49 Then "party1" should have holding account balance of "750000" for asset "ETH" 50 Then "party2" should have holding account balance of "5" for asset "BTC" 51 Then "party3" should have holding account balance of "3500000" for asset "ETH" 52 53 And the opening auction period ends for market "BTC/ETH" 54 55 And the following trades should be executed: 56 | buyer | price | size | seller | 57 | party1 | 750000 | 1 | party2 | 58 59 # holding account is reduced when the order is partially filled (0080-SPOT-013) 60 Then "party1" should have holding account balance of "0" for asset "ETH" 61 Then "party2" should have holding account balance of "4" for asset "BTC" 62 Then "party3" should have holding account balance of "3500000" for asset "ETH" 63 64 And "party1" should have general account balance of "99250000" for asset "ETH" 65 And "party1" should have general account balance of "1" for asset "BTC" 66 And "party2" should have general account balance of "0" for asset "BTC" 67 And "party3" should have general account balance of "996500000" for asset "ETH" 68 69 And the parties amend the following orders: 70 | party | reference | price | size delta | tif | 71 | party2 | party-order2 | 700000 | 0 | TIF_GTC | 72 73 And the following trades should be executed: 74 | buyer | price | size | seller | 75 | party3 | 700000 | 4 | party2 | 76 77 Then "party1" should have holding account balance of "0" for asset "ETH" 78 Then "party2" should have holding account balance of "0" for asset "BTC" 79 Then "party3" should have holding account balance of "700000" for asset "ETH" 80 Then "party1" should have general account balance of "99250000" for asset "ETH" 81 Then "party1" should have general account balance of "1" for asset "BTC" 82 Then "party2" should have general account balance of "3530400" for asset "ETH" 83 Then "party2" should have general account balance of "0" for asset "BTC" 84 Then "party3" should have general account balance of "996514000" for asset "ETH" 85 Then "party3" should have general account balance of "4" for asset "BTC"