2019-09-21 00:27:13 +00:00
|
|
|
# Examples for using cryptools
|
2019-09-01 04:28:17 +00:00
|
|
|
|
|
|
|
The sample input files and the resulting reports are in the `/examples/resources/` directory.
|
|
|
|
|
2019-09-21 18:41:11 +00:00
|
|
|
(Note: new reports have been added since the write-up below was written.
|
2019-10-28 01:25:23 +00:00
|
|
|
Nevertheless, evaluating the reports should mostly be self-explanatory.
|
2020-10-13 04:22:21 +00:00
|
|
|
Pass a -p flag from the command line to be presented a full list of available
|
|
|
|
reports to select from once the import has taken place.)
|
2019-09-21 18:41:11 +00:00
|
|
|
|
2019-09-21 22:11:26 +00:00
|
|
|
## 1. Using the wizard
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2019-09-21 18:41:11 +00:00
|
|
|
##### First, preview the input file `faker1__sample_input.csv` in your editor/viewer of choice.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
|
|
|
(You'll see it is the same (or roughly the same) as the README example.)
|
|
|
|
|
|
|
|
##### We're going to pass in that file as a command-line argument (no flags are required).
|
|
|
|
Enter the following:
|
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
##### `cargo run -- examples/resources/faker1__sample_input.csv`
|
2019-09-01 04:28:17 +00:00
|
|
|
|
|
|
|
(Substitute a Windows-style file path, if necessary.)
|
|
|
|
|
2019-09-21 18:41:11 +00:00
|
|
|
Running the command above takes you through the wizard.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2019-09-21 22:11:26 +00:00
|
|
|
(Note: You can simply run **`cargo run`** instead,
|
2020-10-13 04:22:21 +00:00
|
|
|
in which case after answering 'yes' to "Shall we proceed," you will have to enter the path of the input file.)
|
2019-09-01 04:28:17 +00:00
|
|
|
|
|
|
|
##### Type `<Enter>` to accept default responses to the first three prompts, which are:
|
|
|
|
|
|
|
|
* Shall we proceed?
|
|
|
|
* Choose the lot inventory costing method.
|
|
|
|
* Continue without like-kind treatment?
|
|
|
|
|
|
|
|
##### The final question asks if and where you'd like to save the reports.
|
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
The default is the current directory, which may be undesirable.
|
2019-09-01 04:28:17 +00:00
|
|
|
Type `c` and `<Enter>` to change the directory.
|
2020-10-13 04:22:21 +00:00
|
|
|
Then tab-complete your way through `/Users/<your-username>/Documents`, for example, and then `<Enter>`.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
|
|
|
\* This would be different for Windows, of course.
|
|
|
|
|
|
|
|
##### Now the program has ended, and you should have reports in the directory you provided.
|
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
The reports should generally match those in the `examples/resources` directory,
|
|
|
|
but additional (newer) reports will be generated too.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2019-09-21 22:11:26 +00:00
|
|
|
## 2. Skipping the wizard
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
Enter the following:
|
|
|
|
|
|
|
|
##### `cargo run -- -a examples/resources/faker1__sample_input.csv`
|
|
|
|
|
|
|
|
(Substitute a Windows-style file path, if necessary.)
|
|
|
|
|
|
|
|
This will have quickly and automatically exported all the reports into the current directory.
|
|
|
|
Go delete them before you forget (or feel free to take a look at them first).
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
## 3. Using an input file with a slash (`/`) as the date separator
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
##### Preview the input file `faker2__sample_input.csv`.
|
|
|
|
|
|
|
|
You'll see it's similar to the first example, though with a wider variety of transactions,
|
2019-09-21 22:11:26 +00:00
|
|
|
plus the memos are more descriptive.
|
2020-10-13 04:22:21 +00:00
|
|
|
More importantly, the date column uses a different format `/` instead of `-`.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
Run:
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
##### `DATE_SEPARATOR=s cargo run -- -a -o ~/Documents ./examples/resources/faker2__sample_input.csv`
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2019-09-21 22:11:26 +00:00
|
|
|
\* Substitute `~/Documents` with your desired output directory.
|
|
|
|
Substitute a Windows-style file path, if necessary.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
It worked correctly, right?
|
|
|
|
Note that we set an enviroment variable so the program knew how to parse the date column correctly.
|
|
|
|
An easier way to do this would be to create a `.env` file and set it there.
|
|
|
|
This is described in the README (though there isn't much to it).
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2019-12-30 05:23:30 +00:00
|
|
|
###### Try once more. This time, after `-a`, type `-p`, to be presented a "print menu" for choosing individual reports.
|
|
|
|
|
2020-10-13 04:22:21 +00:00
|
|
|
## To recap:
|
2019-09-01 04:28:17 +00:00
|
|
|
|
|
|
|
The only "required" parameter is the input file.
|
|
|
|
All other parameters have default values.
|
|
|
|
The default values may not be desirable for your use case, however.
|
2019-09-21 18:41:11 +00:00
|
|
|
For example, you may want FIFO instead of LIFO,
|
|
|
|
or you may set your home currency to EUR instead of USD.
|
|
|
|
Or maybe you may want to apply like-kind exchange treatment through a particular date.
|
2020-10-13 04:22:21 +00:00
|
|
|
These parameters can all be set via environment variables (or in a `.env` file).
|
|
|
|
See the `--help` screen for command line options and .env.example for information on environment variables.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
2019-10-28 01:25:23 +00:00
|
|
|
As mentioned above, pass the -p flag to be presented with a list of available reports.
|
|
|
|
|
2019-09-01 04:28:17 +00:00
|
|
|
## Notes on the reports
|
|
|
|
|
|
|
|
There are two style of reports: Accounts and Transactions.
|
|
|
|
|
|
|
|
### Accounts
|
|
|
|
|
|
|
|
* This style of report shows you what you have.
|
2019-09-21 18:41:11 +00:00
|
|
|
* *Account* reports reflect the balances in each account along with the cost basis of those holdings.
|
|
|
|
(The exception being the home currency accounts.
|
|
|
|
In that case, it merely reflects the net of how much was deposited/spent.)
|
|
|
|
* Future reports will be written that provide details of every deposit and every withdrawal,
|
|
|
|
on a movement-by-movement basis, into and out of every lot, for each account.
|
|
|
|
Some of these reports already exist.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
|
|
|
### Transactions
|
|
|
|
|
|
|
|
* This style of report show you how your holdings performed (not including unrealized gains/losses).
|
2019-09-21 18:41:11 +00:00
|
|
|
* *Transaction* reports reflect the result of each transaction
|
|
|
|
(specifically, each transaction which results in a gain/loss or income/expense).
|
|
|
|
* Future reports will be written that provide more detailed breakdowns of the income/expense/gain/loss
|
|
|
|
from every movement (or possibly a more summarized version, too).
|
2019-09-05 02:53:16 +00:00
|
|
|
For example, maybe the exchange rate will be included so you can quickly spot check whether the input file was correct.
|
2019-09-01 04:28:17 +00:00
|
|
|
|
|
|
|
#### Other notes and limitations
|
|
|
|
|
|
|
|
* There is no place where transaction fees are recorded.
|
2019-09-05 02:53:16 +00:00
|
|
|
Whether in an exchange transaction or when sending to yourself, in the input file you simply reflect the net amount
|
|
|
|
leaving one account and the other net amount entering the other account.
|
|
|
|
That "cost" (the transaction fee or exchange fee) simply remains as cost basis until the holding is disposed.
|
2019-09-01 04:28:17 +00:00
|
|
|
* Transactions in which cryptocurrency is spent reflect a gain/loss ***and*** an expense.
|
2019-09-05 02:53:16 +00:00
|
|
|
Perhaps your goverment does not require you to reflect any gain or loss resulting from purchases,
|
|
|
|
in which case you would presumably manually separate expense those rows from the rest.
|
2019-09-01 04:28:17 +00:00
|
|
|
* There is currently no way to provide sub-classifications for income and expenses.
|
2019-09-05 02:53:16 +00:00
|
|
|
For example, in `faker2`, there is mining income and there is remote tech support income.
|
|
|
|
Also, there is a coffee mug purchase and a donation.
|
2019-09-01 04:28:17 +00:00
|
|
|
The details are easily found in the memo field, but it is up to the user to "parse" those items for their use.
|
|
|
|
* As noted in the README, adjustments occasionally may need to be made to the output reports.
|
|
|
|
For example, in `faker2`, a donation was made.
|
2019-09-21 22:11:26 +00:00
|
|
|
Your accountant may decide that this transaction (#11) is analogous to donating an appreciated security.
|
2019-09-05 02:53:16 +00:00
|
|
|
In that case, you may decide to manually adjust the **Proceeds** to match the **Cost basis**,
|
|
|
|
and then update the **Gain/loss** to be zero.
|
2019-09-01 04:28:17 +00:00
|
|
|
* You can't spend or exchange something that you don't have.
|
|
|
|
The program is designed to crash if you try to do this.
|
|
|
|
That is, the program is unable to function properly if your holdings appear to go negative.
|
|
|
|
The only accounts that are permitted to go negative are home currency accounts.
|
|
|
|
The balances of all other currencies **must** remain greater than or equal to 0.
|
|
|
|
(The exception to this is margin accounts, since the liability reflects as a negative balance.)
|