Calculation Methodology
All realized gains and losses are calculated using the First In, First Out (FIFO) method, required by Polish tax law (Art. 30b updof) for capital gains from securities. The oldest shares you bought are considered sold first.
Proceeds = Sell Qty × Sell Price
Cost Basis = Sell Qty × Weighted Avg Buy Price (FIFO lot)
Each sell transaction is matched against the earliest open buy lots until the sell quantity is fully consumed. Partial lot matches are supported.
Per Polish tax regulations, all USD amounts must be converted to PLN using the NBP Table A mid-rate from the last business day before the transaction date (not the transaction date itself). This is the legal requirement under Art. 11a updof. NBP Table A mid-rate last business day before the transaction date.
Proceeds (PLN) = Proceeds (USD) × NBP rate on day before sell date
Realized P/L (PLN) = Proceeds (PLN) − Cost Basis (PLN)
If no NBP rate exists within 7 calendar days before the transaction, the PLN conversion is marked as missing. USD values are always available and accurate.
The tool maps calculated stock transaction values directly to PIT-38 declaration fields: PIT-38:
Dividend income and withholding tax are shown separately - they must be declared in the flat-rate tax section of PIT-38 (or PIT-36) depending on your situation. Consult a tax advisor.
Dividends from IBKR are parsed from the "Dividends" and "Withholding Tax" sections of the activity statement. Each dividend is converted to PLN using the NBP rate from the business day before the payment date.
Net dividend = Gross dividend − Withholding tax paid abroad
Poland has a tax treaty with the US that caps withholding at 15%. The tool shows gross amounts - consult Art. 30a updof and Section G of the PIT declaration for foreign dividend treatment. Here are the specific fields for PIT-38: