Skip to content

Commit f596822

Browse files
committed
README: add details on supported asset classes, testing, and new settings in Basics.json
1 parent 204c4b7 commit f596822

File tree

1 file changed

+42
-7
lines changed

1 file changed

+42
-7
lines changed

README.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ sources of data.
1212
1313
It currently deals with the calculation of the following asset classes:
1414
- stocks (and ETFs of stocks)
15+
- capital gains and losses (CUMP, PEPS)
16+
- dividends
17+
- interests from security lending
18+
- interests from credit (i.e. cash) included here
1519
- crypto-currencies
20+
- capital gains and losses
1621

1722
> [!WARNING]
1823
> It has not been designed to process bonds, ETFs of bonds, or other financial assets, such as options, futures, etc.
@@ -21,7 +26,7 @@ It currently deals with the calculation of the following asset classes:
2126
2227
Check the [Prerequirements section](#Prerequirements) for more details on the prerequisites to use the software.
2328

24-
Check the [Build section](#Build) for more details on how to build and execute the software.
29+
Check the [Build and Test section](#Build-and-Test) for more details on how to build and execute the software.
2530

2631
Check the [Input and output section](#Input-and-output) for more details on how to use the software.
2732

@@ -34,7 +39,7 @@ The software is written in C# and requires the .NET 9.0 runtime to be installed
3439
The latest version of .NET 9.0 for all major Operating Systems (Linux, MacOS, Windows) can be downloaded from the
3540
[official site](https://dotnet.microsoft.com/download/dotnet/9.0).
3641

37-
## Build
42+
## Build and Test
3843

3944
The software can be built using the `dotnet` command-line tool on the three major Operating Systems.
4045

@@ -47,6 +52,13 @@ dotnet build
4752
dotnet run
4853
```
4954

55+
To run the tests, you can either be at root-level or at test-project-level:
56+
57+
```shell
58+
cd Taxes.Tests
59+
dotnet test
60+
```
61+
5062
## Input and output
5163

5264
It is designed to be used in **batch mode** (no UI provided).
@@ -82,8 +94,9 @@ It requires the following input:
8294
- however, BCE FX Rates should be used whenever available, so that simulation results are as close to actual taxes
8395
as possible
8496

85-
The output is emitted to the standard output. It shows the processing of the events, and the calculation of the taxes
86-
step-by-step, giving the state of the portfolio and the taxes due after each event.
97+
The output is a markdown file emitted to both standard output and a file.
98+
It shows the processing of the events, and the calculation of the taxes step-by-step, giving the state of the portfolio
99+
and the taxes due after each event.
87100

88101
Example of output:
89102

@@ -166,8 +179,12 @@ Make sure that `Basics.json` is up-to-date:
166179
- e.g. `0.01`, for two digits precision
167180
- define `BaseCurrency`, used as target currency for all financial calculations
168181
- for the time being only `EUR`, for EURO, is supported
182+
- define properties related to the period of interest for taxation:
183+
- `BeginTaxPeriodOfInterest`: the begin of the period, typically the 1st of January of the tax year
184+
- `EndTaxPeriodOfInterest`: the end of the period, typically the 31st of December of the tax year
185+
- `FilterTaxFormsByPeriodOfInterest`: whether to only emit tax forms for the period of interest (default: `true`)
169186
- define `Positions`, used in reporting of calculation results, as a string-to-object dictionary, mapping the Ticker of
170-
a financial asset, to the Country and ISIN of that asset. Both are mandatory.
187+
a financial asset, to the 2-letter id of the Country and ISIN of that asset. Both are mandatory.
171188
- e.g. `{ "AAPL" : { "Country": "US", "ISIN": "US0378331005" }, ... }`
172189
- `FR` is added to the list for all those products that are not considered "foreign" and are not subject to
173190
withholding tax, such as crypto and security lending programs
@@ -187,17 +204,20 @@ Make sure that `Basics.json` is up-to-date:
187204
- `CryptoPortfolioValuesFilePath`, as the path of the file containing the value of the entire crypto portfolio
188205
for each relevant day
189206
- data extraction from Revolut and format described in the [Setup crypto portfolio values section](#Setup-crypto-portfolio-values)
207+
- `MergeAllCryptos`: whether to consider all crypto-currencies as a single financial product or no (default: `true`)
190208
- define FX Rates settings:
191209
- `FXRatesFilePath`, as the path of the file that contains the FX Rates
192210
- data extraction from the web and format described in the [Setup FX Rates section](#Setup-FX-Rates)
211+
- define `WithholdingTaxes`, used in tax calculation, as a string-to-object dictionary, mapping the 2-letter id of a
212+
country, to its dividend and interest withholding rates
193213

194214
### Setup stock events
195215

196216
The stock events are exported from the Revolut app in CSV format.
197217

198218
An example of valid stock events file is the following:
199219

200-
```texts
220+
```text
201221
Date,Ticker,Type,Quantity,Price per share,Total Amount,Currency,FX Rate
202222
2022-03-30T23:48:44.882381Z,,CASH TOP-UP,,,"$3,000",USD,1.12
203223
2022-05-02T13:32:24.217636Z,TSLA,BUY - MARKET,1.018999,$861.63,$878,USD,01.06
@@ -214,6 +234,18 @@ Date,Ticker,Type,Quantity,Price per share,Total Amount,Currency,FX Rate
214234
2023-12-18T14:37:36.664Z,ORCL,BUY - MARKET,20,$104.24 ,"$2,084.90 ",USD,1.0947
215235
```
216236

237+
The file can be generated by:
238+
- opening the Revolut App
239+
- going to the Invest section
240+
- More -> Documents
241+
- Select "Brokerage" account
242+
- Select "Account statement"
243+
- Select "Excel" as export format
244+
- Select the appropriate period type: e.g. "Tax year"
245+
- Select the appropriate period: e.g. "2024"
246+
- Click on "Generate"
247+
- Open with Excel, or any other application able to visualize the CSV
248+
217249
### Setup crypto events
218250

219251
The crypto events are exported from the Revolut app in CSV format.
@@ -261,7 +293,7 @@ BTC,Sell,0.02,"EUR 62,671.63","EUR 1,253.4426",EUR 12.41,"Mar 8, 2024, 9:32:39 P
261293

262294
The file can be generated by:
263295
- opening the Revolut App
264-
- going to the Cryto section
296+
- going to the Crypto section
265297
- More -> Documents
266298
- Select "Account statement"
267299
- Select "Excel" as export format
@@ -331,6 +363,9 @@ A reset event, however, is different from simply removing all the events of the
331363
allows to keep the history of all the events, and match, for example, sell events within the year of interest to buy
332364
events in previous years, according CUMP and PEPS methodologies.
333365

366+
Because all non-ticker-related events are taken into account for each ticker-specific processing, and because reset is
367+
a non-ticker-related event, you only need two reset events per year: one for the stocks and one for the crypto.
368+
334369
#### Stocks reset event
335370

336371
A reset event for stocks looks like the following:

0 commit comments

Comments
 (0)