code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spots/SpotFunctionalTests/TC-0009-Spot-SamePartyTradesDontMatch.feature (about)

     1  Feature: Simple Spot Order between two parties do not match successfully
     2  
     3    Scenario: Simple Spot Order does not match with counter party
     4  
     5    Background:
     6      Given the fees configuration named "fees-config-1":
     7        | maker fee | infrastructure fee |
     8        | 0.005     | 0.002              |
     9      And the simple risk model named "my-simple-risk-model":
    10        | long                   | short                  | max move up | min move down | probability of trading |
    11        | 0.08628781058136630000 | 0.09370922348428490000 | -1          | -1            | 0.2                    |
    12      And the fees configuration named "my-fees-config":
    13        | maker fee | infrastructure fee |
    14        | 0.004     | 0.001              |
    15      And the spot markets:
    16        | id      | name    | base asset | quote asset | risk model           | auction duration | fees          | price monitoring | sla params    |
    17        | BTC/ETH | BTC/ETH | BTC        | ETH         | my-simple-risk-model | 1                | fees-config-1 | default-none     | default-basic |
    18      # setup accounts
    19      Given the parties deposit on asset's general account the following amount:
    20        | party  | asset | amount |
    21        | party1 | ETH   | 1000   |
    22        | party1 | BTC   | 100    |
    23      # place orders and generate trades
    24      And the parties place the following orders:
    25        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference |
    26        | party1 | BTC/ETH   | buy  | 1      | 100   | 0                | TYPE_LIMIT | TIF_GFA | t1-b-1    |
    27        | party1 | BTC/ETH   | sell | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | t2-s-1    |
    28      Then "party1" should have holding account balance of "1" for asset "BTC"
    29      Then "party1" should have holding account balance of "100" for asset "ETH"
    30  
    31      Then the orders should have the following states:
    32        | party  | market id | side | volume | remaining | price | status        |
    33        | party1 | BTC/ETH   | buy  | 1      | 1         | 100   | STATUS_ACTIVE |
    34        | party1 | BTC/ETH   | sell | 1      | 1         | 100   | STATUS_ACTIVE |
    35  
    36      Then the opening auction period ends for market "BTC/ETH"
    37  
    38      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
    39      And the mark price should be "100" for the market "BTC/ETH"
    40  
    41      # @vanitha the expectation here is wrong. Wash trades are allowed during auctions and only rejected in continuous trading
    42      # see https://github.com/vegaprotocol/specs/blob/95afe22b7807b47e6231b3cdab21f6196b7dab91/protocol/0024-OSTA-order_status.md#wash-trading
    43  
    44      Then the orders should have the following states:
    45        | party  | market id | side | volume | remaining | price | status        |
    46        | party1 | BTC/ETH   | buy  | 1      | 0         | 100   | STATUS_FILLED |
    47        | party1 | BTC/ETH   | sell | 1      | 0         | 100   | STATUS_FILLED |
    48  
    49  
    50      # now that we're in continuous trading, lets try to do a wash trade by part
    51      And the parties place the following orders:
    52        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference | error |
    53        | party1 | BTC/ETH   | buy  | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | t1-b-111  |       |
    54        | party1 | BTC/ETH   | sell | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | t2-s-112  |       |
    55  
    56      Then "party1" should have holding account balance of "100" for asset "ETH"
    57      Then "party1" should have holding account balance of "0" for asset "BTC"
    58  
    59      Then the orders should have the following states:
    60        | party  | market id | side | volume | remaining | price | status         | reference |
    61        | party1 | BTC/ETH   | buy  | 1      | 1         | 100   | STATUS_ACTIVE  | t1-b-111  |
    62        | party1 | BTC/ETH   | sell | 1      | 1         | 100   | STATUS_STOPPED | t2-s-112  |
    63