XTB
PIT-38 from XTB: what the report contains and what it leaves out
XTB issues a cash operations report. It is not a finished tax return: some figures have to be derived from it, and some things it does not mention at all. Below is exactly what our engine reads.
Where to get the report
- Sign in to xStation and open History.
- Select a range covering the WHOLE tax year, 1 January to 31 December.
- Download the Cash Operations report as XLSX or CSV.
- If you also traded in earlier years, download those years too.
What is inside
- Metadata rows above the headers
- The XLSX starts with descriptive rows and only then the column headers. Opening it as a plain CSV gives noise instead of data.
- Semicolon as the separator
- In the Polish edition columns are separated by a semicolon, not a comma — the comma is the decimal mark. The opposite of most foreign reports.
- Ticker carries an exchange suffix
- Instruments appear as APPLE.US, PKOBP.PL — the name alone does not identify them.
- Currency comes from a column
- The account may be held in PLN, USD, EUR or a dozen other currencies, and operations may differ. The NBP rate is picked per operation.
- A separate closed-positions sheet
- For derivatives XTB reports open and close, purchase and sale value, commission and swap in a separate table.
Where it goes wrong
- Deposits and withdrawals are not transactions
- Funding the account and taking money out appear in the report but mean nothing for tax. We do not count them — neither toward the tax nor toward the package you pay for.
- Swap is a cost, not a loss
- Overnight financing is often mistaken for the result of the trade. It is a separate line and a separate column.
- Financial transaction tax
- On some exchanges XTB withholds FTT. It is a separate row, easy to confuse with dividend withholding tax — a completely different part of the return.
- CFDs have no per-unit acquisition cost
- For contracts for difference the report gives the result, not the purchase price of each unit. The calculation runs off the result column, unlike shares.
- The tax year is not the calendar year of the trade
- A sale in late December is assigned by the day income is realised. Exporting "January to December" can cut off exactly what is needed.
What we compute from it
- Shares and ETFs — section C/D
- FIFO separately per investment account, as art. 30b ust. 7 of the PIT Act requires.
- Dividends — section G
- Withholding tax credited up to the treaty limit, art. 30a ust. 9.
- Conversion to złoty
- NBP average rate from the last business day before the day income is realised, art. 11a ust. 1 — not the rate on the trade date.
- Losses from earlier years
- Carried five years, capped at half of that year’s loss, art. 9 ust. 3.
Run this once
claude mcp add --transport http taxroam https://taxroam.com/mcp --header "Authorization: Bearer $TAXROAM_KEY"Where this export usually goes wrong
- The NBP rate
- The trade-date rate
- FIFO per account
- One shared pile across all accounts
Questions about XTB
Is the XTB report enough?
For sales made during that year, yes. But if you sold something bought earlier, the reports from the purchase years are needed too: without them there is no acquisition cost and the tax comes out too high.
Do I have to retype anything by hand?
No. Your assistant reads the file on your own machine and sends us numbers only. The file itself never reaches us.
My account is in USD — is that a problem?
No. The currency is in a column and we pick the right NBP rate for each operation. A foreign-currency account changes nothing.
I traded CFDs. Is it computed the same way?
No. For CFDs the report gives the result rather than a per-unit purchase price, so the calculation runs off the result column. The tax outcome is the same: section C/D.