FIFO Lots, the 3-Year Rule and Daily ČNB Rates: An n8n Telegram Bot Works Out Czech Stock Taxes From a Broker CSV
- Level Advanced
- Setup1–3 hrs (estimated)
- Evidence Some evidence
- CostNot stated in source
- No-codeNo
What they did
An investor in Czechia sends his Trading 212 and Interactive Brokers CSV exports to a Telegram bot on his own n8n server. It matches every sale to the shares bought first (FIFO), checks the 3-year tax-free holding rule for each lot, converts every trade at that day's Czech National Bank rate, and can show the tax impact of a sale before he makes it, plus a yearly report grouped like the tax return. The workflow is free on GitHub.
How it went
A lot-by-lot tax table and yearly summary, ready to check with an adviser.
Worth knowing
- Built for Czech rules only, and he says it isn't tax advice. Needs a self-hosted n8n server and about 47 nodes; check results against your broker's own tax report.
Prompt
Cleaned version rewritten from the source — not a direct quote.
Here are my broker exports [CSV files] for [year]. Using [country]'s rules ([FIFO, holding-period exemption, yearly limit, currency conversion source]), match each sale to the lots bought, mark which are tax-free, convert amounts at the official rate for each date, and give me a table grouped the way my tax return asks for it. Flag anything you're unsure of for my tax adviser.
Recommended
Try it in Grok Bot
Grok Bot can do a one-off version: give it the CSVs and your country's rules and ask for the lot-by-lot table.
- Copy the prompt (button below).
- Open Grok Bot chat and paste it. Replace any [bracketed] placeholders.
- Connect the listed tools (Telegram, GitHub) as connectors when Grok Bot asks.
- If the task repeats, ask: "Make this a daily routine."
Alternatives: the same prompt works in n8n, Claude, ChatGPT Agent, OpenClaw.
Set it up
Tools: Telegram, GitHub · Stack: Self-hosted n8n + Telegram + broker CSV exports (Trading 212, IBKR)
- Read the original source for full context.
- Connect the tools your agent needs.
- Paste the prompt and replace [bracketed] placeholders.
- Run once manually and check the output before scheduling it.
Generic suggested steps, not from the source.
Evidence
Detailed Reddit post (r/n8n) with the rules handled and a public GitHub workflow and setup guide
Source: Reddit · 2026-10-13 · Verified by us: not yet · Report broken or outdated