Account_position

The account_position table provides a detailed ledger of trading activity and position adjustments for each account in the XCore system, following a First-In-First-Out (FIFO) methodology. It records an array of transaction-related data, such as the type of transaction, financial instrument identifiers (Symbol), and sequence numbers (Seq), which are unique per Account and form a chronological order of position records. Importantly, it also tracks overflows, realized profits or losses, and any comments associated with position adjustments. In XCore, account positions are updated based on the executed deals.
| Attributes | Description |
|---|---|
| Account | Account name in XCore. |
| Seq | Unique position record identifier. |
| Prev | ‘Seq’ of the previous transaction. |
| Pos_seq | ‘Seq’ of the oldest record whose position change is still open (the head of the FIFO queue). A record that flattens or reverses the position points to itself. |
| Pos_delta | How much of the ‘Pos_seq’ record’s position change is no longer open, specified in absolute value. For instance, if there’s an existing position with a base of -1000 and an incoming order of +5000, the pos_delta will be 1000, as this amount depletes the initial position. A further +5000 in the same direction leaves pos_seq and pos_delta unchanged; later closing trades add the amount they close from that record (for example, a -2000 raises pos_delta to 3000). |
| Time | Timestamp of the position operation (epoch format). |
| Symbol | Symbol name in XCore. |
| Type | Source of the position record: 0 = maker (provider) deal, 1 = taker (connector) deal, 2 = P&L settlement, 3 = position expiry, 4 = external adjustment. |
| Vd | Value date of the position (epoch format). |
| Base | Total position in the symbol base currency at the current ‘Seq’. |
| Quote | Volume exposure in quote currency. Quote equals the realized PnL if the Base=0. |
| Closed_pl | Accumulated net profit or loss from closed positions, following FIFO principle, until settlement; each record shows the running total. Expressed in Quote currency. |
| Overflow | Hedged trade volume exceeding exposure limit. For RISK accounts only. |
| Comment | Field containing order ID that triggered a position change or comment marking external adjustment. |