code.vegaprotocol.io/vega@v0.79.0/core/integration/docs/positions.md (about)

     1  ## Verifying positions and PnL
     2  
     3  At its heart, we are testing a trading platform. Therefore, we need to have the ability to verify the positions held by traders, and their realised or unrealised profit and loss (PnL). The data-node component implements a positions API which collates data events sent out when parties trade, positions are marked to market or settled, when perpetual markets process a funding payment, etc...
     4  The integration test framework implements a number of steps to verify whether or not a trade took place, verifying [individual transfer data](transfers.md). In addition to this, the integration test framework implements a step that allows us to verify the position data analogous to the data-node API.
     5  
     6  ```cucumber
     7  Then the parties should have the following profit and loss:
     8    | market id | party      | volume | unrealised pnl | realised pnl | status                        | taker fees | taker fees since | maker fees | maker fees since | other fees | other fees since | funding payments | funding payments since |
     9    | ETH/DEC19 | trader2    | 0      | 0              | 0            | POSITION_STATUS_ORDERS_CLOSED | 0          | 0                | 0          | 0                | 0          | 0                | 0                | 0                      |
    10    | ETH/DEC19 | trader3    | 0      | 0              | -162         | POSITION_STATUS_CLOSED_OUT    | 0          | 0                | 0          | 0                | 0          | 0                | 0                | 0                      |
    11    | ETH/DEC19 | auxiliary1 | -10    | -900           | 0            |                               | 0          | 0                | 0          | 0                | 0          | 0                | 0                | 0                      |
    12    | ETH/DEC19 | auxiliary2 | 5      | 475            | 586          |                               | 0          | 0                | 0          | 0                | 1          | 0                | 0                | 0                      |
    13   ```
    14  
    15   Where the fields are defined as follows:
    16  
    17   ```
    18   | name                   | type           | required |
    19   |------------------------|----------------|----------|
    20   | market id              | string         | no       |
    21   | party                  | string         | yes      |
    22   | volume                 | int64          | yes      |
    23   | unrealised pnl         | Int            | yes      |
    24   | realised pnl           | Int            | yes      |
    25   | status                 | PositionStatus | no       |
    26   | taker fees             | Uint           | no       |
    27   | maker fees             | Uint           | no       |
    28   | other fees             | Uint           | no       |
    29   | taker fees since       | Uint           | no       |
    30   | maker fees since       | Uint           | no       |
    31   | other fees since       | Uint           | no       |
    32   | funding payments       | Int            | no       |
    33   | funding payments since | Int            | no       |
    34   | is amm                 | bool           | no       |
    35   ```
    36  
    37  Details for the [`PositionStatus` type](types.md#Position-status)
    38