coinsync 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE.txt +21 -0
  3. data/README.md +255 -0
  4. data/bin/coinsync +78 -0
  5. data/doc/importers.md +201 -0
  6. data/lib/coinsync.rb +18 -0
  7. data/lib/coinsync/balance.rb +19 -0
  8. data/lib/coinsync/balance_task.rb +65 -0
  9. data/lib/coinsync/build_task.rb +43 -0
  10. data/lib/coinsync/builder.rb +32 -0
  11. data/lib/coinsync/config.rb +94 -0
  12. data/lib/coinsync/crypto_classifier.rb +27 -0
  13. data/lib/coinsync/currencies.rb +35 -0
  14. data/lib/coinsync/currency_converter.rb +65 -0
  15. data/lib/coinsync/currency_converters/all.rb +1 -0
  16. data/lib/coinsync/currency_converters/base.rb +46 -0
  17. data/lib/coinsync/currency_converters/cache.rb +34 -0
  18. data/lib/coinsync/currency_converters/fixer.rb +36 -0
  19. data/lib/coinsync/currency_converters/nbp.rb +38 -0
  20. data/lib/coinsync/formatter.rb +44 -0
  21. data/lib/coinsync/import_task.rb +37 -0
  22. data/lib/coinsync/importers/all.rb +1 -0
  23. data/lib/coinsync/importers/ark_voting.rb +121 -0
  24. data/lib/coinsync/importers/base.rb +35 -0
  25. data/lib/coinsync/importers/binance_api.rb +210 -0
  26. data/lib/coinsync/importers/bitbay20.rb +144 -0
  27. data/lib/coinsync/importers/bitbay_api.rb +224 -0
  28. data/lib/coinsync/importers/bitcurex.rb +71 -0
  29. data/lib/coinsync/importers/bittrex_api.rb +81 -0
  30. data/lib/coinsync/importers/bittrex_csv.rb +75 -0
  31. data/lib/coinsync/importers/changelly.rb +57 -0
  32. data/lib/coinsync/importers/circle.rb +58 -0
  33. data/lib/coinsync/importers/default.rb +90 -0
  34. data/lib/coinsync/importers/etherdelta.rb +93 -0
  35. data/lib/coinsync/importers/kraken_api.rb +134 -0
  36. data/lib/coinsync/importers/kraken_common.rb +137 -0
  37. data/lib/coinsync/importers/kraken_csv.rb +28 -0
  38. data/lib/coinsync/importers/kucoin_api.rb +172 -0
  39. data/lib/coinsync/importers/lisk_voting.rb +110 -0
  40. data/lib/coinsync/outputs/all.rb +1 -0
  41. data/lib/coinsync/outputs/base.rb +32 -0
  42. data/lib/coinsync/outputs/list.rb +123 -0
  43. data/lib/coinsync/outputs/raw.rb +45 -0
  44. data/lib/coinsync/outputs/summary.rb +48 -0
  45. data/lib/coinsync/request.rb +31 -0
  46. data/lib/coinsync/run_command_task.rb +20 -0
  47. data/lib/coinsync/source.rb +43 -0
  48. data/lib/coinsync/source_filter.rb +10 -0
  49. data/lib/coinsync/table_printer.rb +29 -0
  50. data/lib/coinsync/transaction.rb +125 -0
  51. data/lib/coinsync/version.rb +3 -0
  52. metadata +95 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 59e420867e256a9ed7fef1d87ae08279e7e4dfcc
4
+ data.tar.gz: 69fbe095ab411e0a0a65223063bb30267af81682
5
+ SHA512:
6
+ metadata.gz: fa574e1fcecefe950ab83f576754e24ae4a867bf913ff2ea34cdf0673149e6787edc75663d6500500dec5e8e668fb5a6e34163e0ee106395296d6beef721cc11
7
+ data.tar.gz: 8f60e49910ffc061406cf20f7186f31bd0246e2c663b69753f343daf87c5b155b2a82d0039095c36ebf1ccea0bf559cba4b9c3b2eaacf8cbcbbd273206bc670b
data/MIT-LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Kuba Suder
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,255 @@
1
+ # CoinSync
2
+
3
+ CoinSync is a command-line tool for crypto traders written in Ruby that helps you import data like your transaction histories from multiple exchanges, convert it into a single unified format and process it in various ways.
4
+
5
+
6
+ ## IMPORTANT ⚠️
7
+
8
+ These tools are provided without any warranty (just like the license says), and I cannot guarantee that they work correctly. The project is currently in an alpha stage, so a lot of parts might be incomplete, might not do error handling properly, not take various edge cases into account, and generally might fail in unexpected ways. And don't even look at the test suite…
9
+
10
+ Basically, please verify and double-check any data you get from these scripts before you use it for anything remotely serious. You take full responsibility for any problems you might run into if you use them e.g. for your crypto tax calculations.
11
+
12
+
13
+ ## Assumptions
14
+
15
+ The tool makes several assumptions about how it calculates things - if they are different than what you expect, you might have to work around them by writing some code yourself based on the provided classes. For example:
16
+
17
+ - fiat amounts are rounded to 2 decimal digits (4 digits for numbers smaller than 10), and crypto amounts are rounded to 8 digits
18
+ - exchange fees are simply added/subtracted from the amounts, i.e. they're treated as if you simply bought less units of an asset or paid more for it
19
+ - withdrawal fees are ignored
20
+ - for crypto-to-crypto transactions (also called "swaps" here), the base currency is determined automatically if possible, e.g. for a BTC-XMR pair XMR will always be the asset you buy/sell and BTC the currency you buy/sell it for
21
+
22
+
23
+ ## Installation
24
+
25
+ You're going to need some version of Ruby installed, but any fairly recent version should do.
26
+
27
+ To just install the gem in the system, call:
28
+
29
+ $ gem install coinsync
30
+
31
+ You might need to add `sudo` if you don't use any Ruby version manager like [RVM](https://rvm.io), though it's better if you get one.
32
+
33
+ ### Installing with a Gemfile
34
+
35
+ Alternatively, you can add it to your application's Gemfile:
36
+
37
+ ```ruby
38
+ gem 'coinsync'
39
+ ```
40
+
41
+ And then call `bundle` to install it, and `bundle exec coinsync` to run it.
42
+
43
+ You can also create a project directory with a Gemfile specifically for CoinSync:
44
+
45
+ ```
46
+ gem install bundle
47
+ mkdir mycrypto
48
+ cd mycrypto
49
+ bundle init
50
+ echo "gem 'coinsync'" >> Gemfile
51
+ bundle
52
+ bundle exec coinsync
53
+ ```
54
+
55
+ This also lets you install the gem locally in that directory, by adding a path argument to `bundle`, e.g. `bundle --path ./bundle`.
56
+
57
+ ### Installing development version
58
+
59
+ To use the latest development version, check out the repository to a local directory:
60
+
61
+ ```
62
+ git clone git@github.com:mackuba/coinsync.git
63
+ ```
64
+
65
+ And then run `bin/coinsync` from inside that directory.
66
+
67
+
68
+ ## Configuration
69
+
70
+ To use CoinSync, you will need to create a config file first. By default it looks for the config file at `config.yml` in the current directory, though you can specify a different path with `-c path/to/config`.
71
+
72
+ The config uses the [YAML format](http://yaml.org), and the expected structure is:
73
+
74
+ ```
75
+ sources:
76
+ bittrex:
77
+ type: bittrex
78
+ file: data/bittrex.csv
79
+ kraken:
80
+ type: kraken
81
+ file: data/kraken-ledgers.csv
82
+ bitbay_api:
83
+ file: data/bitbay.json
84
+ api_public_key: 12345-678-90abc
85
+ api_private_key: 45678-90a-bcdef
86
+ settings:
87
+ timezone: Europe/Warsaw
88
+ time_format: "%Y-%m-%d %H:%M"
89
+ column_separator: ";"
90
+ decimal_separator: ","
91
+ convert_to: PLN
92
+ include:
93
+ - extras.rb
94
+ ```
95
+
96
+ ### Sources
97
+
98
+ The `sources` list is a map of { key => definition } entries which lists the exchanges from which you want to import the transaction history and other data. There are generally two types of sources:
99
+
100
+ - those that import a CSV file that you've downloaded yourself from your profile on the exchange, and don't connect to the exchange API at all
101
+ - those that can connect to an exchange's API and download its transaction history and other data like current balances
102
+
103
+ The key is any valid identifier you want to use to refer to this source, and the definition is a list of parameters:
104
+
105
+ - `type` specifies which importer module to use
106
+ - `file` specifies from where it should load a file you've downloaded, or where it should save the transaction history it imports itself
107
+
108
+ Depending on the exchange, some sources might allow or require additional parameters like API keys or addresses. You can have more than one source of the same type, if you want to import multiple transaction histories from one exchange.
109
+
110
+ If the type of the importer is the same as the source key, the `type` parameter might be skipped. If no other parameters are needed, you can also use a shorthand format, passing just a filename instead of a full hash:
111
+
112
+ kraken: kraken-ledgers.csv
113
+
114
+ See the separate ["Importers"](doc/importers.md) doc file for a full list of supported exchanges.
115
+
116
+ ### Settings
117
+
118
+ `settings` is an optional section that lets you change the behavior of the tool in various ways. Here's the list of currently supported keys:
119
+
120
+ - `base_cryptocurrencies`: an array listing which cryptocurrencies might be considered the base currency for a trading pair; if both sides of the pair are included in the list, the one earlier in the list takes priority (default: `['USDT', 'BTC', 'ETH', 'BNB', 'KCS', 'LTC', 'BCH', 'NEO']`)
121
+ - `column_separator`: what character is used to separate columns in saved CSV files (default: `","`)
122
+ - `convert_to`: what fiat currency should fiat amounts be converted to (default: none)
123
+ - `convert_with`: what currency converter module should be used to do the currency conversions (default: `fixer`)
124
+ - `decimal_separator`: what character is used to separate decimal digits in numbers (default: `"."`)
125
+ - `time_format`: the [time format string](http://ruby-doc.org/core-2.5.0/Time.html#method-i-strftime) to use when printing dates (default: `"%Y-%m-%d %H:%M:%S"`)
126
+ - `timezone`: an explicit timezone to use for printing dates and currency conversion (default: system timezone)
127
+
128
+ ### Includes
129
+
130
+ If you want to extend the tool with support for additional importers, build tasks, currency converters etc., you can add an `include` key to the config and list there any local Ruby files you want to be loaded when CoinSync runs.
131
+
132
+
133
+ ### Currency conversion
134
+
135
+ If you make transactions in multiple fiat currencies (e.g. USD on Bitfinex, EUR on Kraken) and you want to have all values converted to one currency (for example, to calculate profits for tax purposes), use the `convert_to` and `convert_with` options in the settings. Currency conversion is done using pluggable modules that load currency rates from specific sources. Currently, two are available:
136
+
137
+ - `fixer` loads exchange rates from [fixer.io](http://fixer.io) API (note: they've now decided to deprecate this API in June and the new one requires an API key, let me know if you know any better option)
138
+ - `nbp` loads rates from [Polish National Bank](http://www.nbp.pl/home.aspx?f=/statystyka/kursy.html) (this will be moved to a separate gem)
139
+
140
+ You can always write another module that connects to your preferred source and plug it in using `include`.
141
+
142
+
143
+ ## Using the tool
144
+
145
+ Once you have a config file, you can run one of the commands described below to import or process your data:
146
+
147
+
148
+ ### Balance
149
+
150
+ ```
151
+ coinsync balance [sources...]
152
+ ```
153
+
154
+ This connects to the exchange APIs using any importers that support it (and where you've provided the keys), downloads the wallet balances, and prints them in a list like this:
155
+
156
+ ```
157
+ Coin | binance kucoin | TOTAL
158
+ -------------------------------------------------------
159
+ BTC | 0.1 (+) 0.1 | 0.2
160
+ ETH | 10.5 | 10.5
161
+ LTC | 20 | 20
162
+ NANO | 15 25 | 40
163
+ XMR | 33 1.8 | 34.8
164
+ ```
165
+
166
+ The "(+)" means that some amount of funds is locked in an open order.
167
+
168
+ You can filter the list of sources by listing one or more source names as arguments, or by listing source names with a '^' symbol (e.g. `^kucoin`) to *exclude* them.
169
+
170
+
171
+ ### Import
172
+
173
+ ```
174
+ coinsync import [sources...]
175
+ ```
176
+
177
+ This connects to the exchange APIs using any importers that support it (and where you've provided the keys) and downloads the transaction histories to specified files, which are later used in the build tasks below. Again, you can choose or exclude specific sources as above.
178
+
179
+
180
+ ### Build
181
+
182
+ ```
183
+ coinsync build <task>
184
+ ```
185
+
186
+ The build tasks process all downloaded transaction history files, combine them into a single chronologically sorted list in memory, and then output it in a selected format or run some additional calculations on it:
187
+
188
+
189
+ #### Build List
190
+
191
+ ```
192
+ coinsync build list
193
+ ```
194
+
195
+ This will just print all your transactions to a single unified CSV file (in `build/list.csv`).
196
+
197
+
198
+ #### Build Raw
199
+
200
+ ```
201
+ coinsync build raw
202
+ ```
203
+
204
+ This prints a list of transactions in a way similar to `build list`, but in the same format as CoinSync stores transactions internally in memory: each transaction, no matter the type or source, is stored in exactly the same way - the amount and code of the fiat or crypto currency received (bought) and the amount & code of the fiat/crypto currency paid (sold). This means that when e.g. buying BTC for USD, the bought currency will be BTC and the sold one will be USD, and when selling BTC for USD, it will be the other way around (bought: USD, sold: BTC).
205
+
206
+ This output is mostly meant if you intend to use it as input for some other tools written in other languages and process the data further there.
207
+
208
+ The columns in the CSV are:
209
+
210
+ - exchange: name of the exchange or source
211
+ - date: transaction date
212
+ - bought amount: amount of the bought (received) asset/currency
213
+ - bought currency: code of the bought (received) asset/currency
214
+ - sold amount: amount of the asset/currency you sold (paid in)
215
+ - sold currency: code of the asset/currency you sold (paid in)
216
+
217
+
218
+ #### Build Summary
219
+
220
+ ```
221
+ coinsync build summary
222
+ ```
223
+
224
+ This will calculate how much of each traded asset you're supposed to have right now (this will differ more or less from the actual amounts because of transaction and withdrawal fees paid, payments/donations or mined coins you haven't counted, etc.):
225
+
226
+ ```
227
+ Coin Amount
228
+ ---------------------
229
+ BTC 0.5
230
+ BCH 0
231
+ ETH 12.5
232
+ LTC 40
233
+ NEO 15
234
+ IOTA 1800
235
+ ```
236
+
237
+ #### Custom build tasks
238
+
239
+ You can output a compiled transactions list in any other format you specifically need, by creating a custom output class inheriting from `CoinSync::Outputs::Base` based on the [provided output classes](lib/coinsync/outputs) and loading it with the `include` option in the config.
240
+
241
+
242
+ ### Run command
243
+
244
+ ```
245
+ coinsync run <source> <command> [args...]
246
+ ```
247
+
248
+ Some importers (currently only Binance) may have custom commands implemented that only make sense for a given importer. This allows you to run these commands from the command line. See the ["Importers"](doc/importers.md) doc for more info.
249
+
250
+
251
+ ## Credits & contributing
252
+
253
+ Copyright © 2018 [Kuba Suder](https://mackuba.eu). Licensed under [MIT License](http://opensource.org/licenses/MIT).
254
+
255
+ If anything doesn't work as expected, please [file a bug report](https://github.com/mackuba/coinsync/issues), and any contributions in the form of pull requests (especially adding support for new exchanges) are [very welcome](https://github.com/mackuba/coinsync/pulls).
data/bin/coinsync ADDED
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'optparse'
5
+
6
+ require 'coinsync/config'
7
+ require 'coinsync/balance_task'
8
+ require 'coinsync/build_task'
9
+ require 'coinsync/import_task'
10
+ require 'coinsync/run_command_task'
11
+ require 'coinsync/source_filter'
12
+
13
+ def load_config(options)
14
+ CoinSync::Config.load_from_file(options[:config_file])
15
+ end
16
+
17
+ options = {}
18
+
19
+ OptionParser.new do |opts|
20
+ opts.on('-cCONFIG', '--config CONFIG') { |c| options[:config_file] = c }
21
+
22
+ opts.parse!
23
+ end
24
+
25
+ command = ARGV.shift
26
+
27
+ case command
28
+ when nil
29
+ puts "Usage:"
30
+ puts " coinsync balance [source1 source2 ^excluded_source...]"
31
+ puts " - imports and prints wallet balances from all or selected sources"
32
+ puts
33
+ puts " coinsync import [source1 source2 ^excluded_source...]"
34
+ puts " - imports transaction histories from all or selected sources to files listed in the config"
35
+ puts
36
+ puts " coinsync build list"
37
+ puts " - merges all transaction histories into a single list and saves it to build/list.csv"
38
+ puts
39
+ puts " coinsync build fifo"
40
+ puts " - merges all transaction histories into a single list, calculates transaction"
41
+ puts " profits using FIFO and saves the result to build/fifo.csv"
42
+ puts
43
+ puts " coinsync build summary"
44
+ puts " - merges all transaction histories into a single list and calculates how many"
45
+ puts " units of each token you should have in total now"
46
+ puts
47
+ puts " coinsync run <source> <command> [args]"
48
+ puts " - executes a custom action from one of the configured importers (see docs for more info)"
49
+ puts
50
+ puts " * add -c file.yml / --config file.yml to use a custom config path instead of config.yml"
51
+ puts
52
+
53
+ when 'balance'
54
+ selected, except = CoinSync::SourceFilter.new.parse_command_line_args(ARGV)
55
+ task = CoinSync::BalanceTask.new(load_config(options))
56
+ task.run(selected, except)
57
+
58
+ when 'import'
59
+ selected, except = CoinSync::SourceFilter.new.parse_command_line_args(ARGV)
60
+ task = CoinSync::ImportTask.new(load_config(options))
61
+ task.run(selected, except)
62
+
63
+ when 'build'
64
+ output_name = ARGV.shift
65
+ task = CoinSync::BuildTask.new(load_config(options))
66
+ task.run(output_name, ARGV)
67
+
68
+ when 'run'
69
+ source = ARGV.shift or (puts "Usage: coinsync run <source> <command> [args]"; exit 1)
70
+ command = ARGV.shift or (puts "Usage: coinsync run <source> <command> [args]"; exit 1)
71
+
72
+ task = CoinSync::RunCommandTask.new(load_config(options))
73
+ task.run(source, command, ARGV)
74
+
75
+ else
76
+ raise "Unknown command #{command}"
77
+
78
+ end
data/doc/importers.md ADDED
@@ -0,0 +1,201 @@
1
+ ## Supported exchanges / importers
2
+
3
+ ### Ark Voting Rewards (`ark_voting`)
4
+
5
+ Connects to the API: **YES**
6
+
7
+ Parameters:
8
+
9
+ - file: path where the transaction history will be saved
10
+ - address: your Ark address
11
+
12
+ The importer loads a list of transactions sent to a given address from the Ark explorer, picks those that are voting rewards sent from the delegates, and saves them as purchases made with zero cost.
13
+
14
+ ### Binance API (`binance_api`)
15
+
16
+ Connects to the API: **YES**
17
+
18
+ Parameters:
19
+
20
+ - file: path where the transaction history will be saved
21
+ - api_key: API key
22
+ - secret_key: secret API key
23
+ - traded_pairs: a list of all pairs you trade there
24
+
25
+ Create the API keys on your Binance profile page. Only the "Read Info" permission is required.
26
+
27
+ Unfortunately, the Binance API currently doesn't allow loading transaction history for all pairs in one go, and checking all possible pairs would take too much time, so you need to explicitly specify the list of pairs to be downloaded, in such format:
28
+
29
+ ```
30
+ traded_pairs:
31
+ - XRPBTC
32
+ - ETHBTC
33
+ - NANOETH
34
+ - BTCUSDT
35
+ - LTCUSDT
36
+ ```
37
+
38
+ The Binance importer has a custom command that you can use to generate this list. This task scans all available trading pairs and finds those with some trades present on your account. It may take about 5-10 minutes to complete, that's why this isn't done automatically during the import.
39
+
40
+ ```
41
+ coinsync run binance_api find_all_pairs
42
+ ```
43
+
44
+
45
+ ### BitBay API (`bitbay_api`)
46
+
47
+ Connects to the API: **YES**
48
+
49
+ Parameters:
50
+
51
+ - file: path where the transaction history will be saved
52
+ - api_public_key: API public key
53
+ - api_private_key: API secret key
54
+
55
+ Create the API keys on your BitBay profile page. You will need to select the "History" permission for transaction history, and "Crypto deposit" + "Updating a wallets list" for downloading balances.
56
+
57
+ ### BitBay 2.0 (`bitbay20`)
58
+
59
+ Connects to the API: **NO**
60
+
61
+ Parameters:
62
+
63
+ - file: path from where the transaction history will be loaded
64
+
65
+ This is meant for importing transaction history from the older version of BitBay (before September 2017), available at <https://old.bitbay.net>.
66
+
67
+ ### Bitcurex (`bitcurex`)
68
+
69
+ Connects to the API: **NO**
70
+
71
+ Parameters:
72
+
73
+ - file: path from where the transaction history will be loaded
74
+
75
+ This is used to import transaction history from the late Polish Bitcurex exchange (RIP in peace), in case you happen to have downloaded one before the owners disappeared with all the money.
76
+
77
+ ### Bittrex API (`bittrex_api`)
78
+
79
+ Connects to the API: **YES**
80
+
81
+ Parameters:
82
+
83
+ - api_key: API public key
84
+ - api_secret: API secret key
85
+
86
+ Note: this importer can **_only_** import wallet balances. Unfortunately, the "get order history" endpoint in the Bittrex API has the same problem as the "Orders" page on your profile page: it only lists orders from last month or so, and any older orders are cleaned up. This makes it pretty much useless for our purposes. The only way to download a complete transaction history seems to be by manually pressing the (captcha-protected) "Load All" button on the site, which returns a CSV file that can be parsed with the `bittrex_csv` importer.
87
+
88
+ The API key can be created on your Bittrex profile page - you only need the "Read Info" permission.
89
+
90
+ ### Bittrex CSV (`bittrex_csv`)
91
+
92
+ Connects to the API: **NO**
93
+
94
+ Parameters:
95
+
96
+ - file: path from where the transaction history will be loaded
97
+
98
+ This parses the full transaction history CSV, downloaded using the "Load All" button on the History page.
99
+
100
+ ### Changelly (`changelly`)
101
+
102
+ Connects to the API: **NO**
103
+
104
+ Parameters:
105
+
106
+ - file: path from where the transaction history will be loaded
107
+
108
+ Download the history from the My Account / History page, using the "Export .csv" button.
109
+
110
+ ### Circle (`circle`)
111
+
112
+ Connects to the API: **NO**
113
+
114
+ Parameters:
115
+
116
+ - file: path from where the transaction history will be loaded
117
+
118
+ You can get the transaction history from the Settings / Advanced page - it will be sent to you via email.
119
+
120
+ ### Default (`default`)
121
+
122
+ Connects to the API: **NO**
123
+
124
+ Parameters:
125
+
126
+ - file: path from where the transaction history will be loaded
127
+
128
+ This is a generic CSV format that you can use to import a list of random transactions from any other sources.
129
+
130
+ The expected columns in the CSV are:
131
+
132
+ - number: an incrementing integer number (ignored, it's just to make the file more readable)
133
+ - exchange: name of the exchange or source
134
+ - type: "Purchase" or "Sale"
135
+ - date: date in a recognizable format
136
+ - amount: amount of the asset bought or sold (uses decimal separator defined in the settings)
137
+ - value: amount received or paid for the asset (as above)
138
+ - currency: currency in which you've paid for the asset
139
+
140
+ Any other columns after that are ignored.
141
+
142
+ To list crypto-to-crypto transactions in the CSV (e.g. BTC-NANO), put the base currency in the "currency" column with a "$" prefix (e.g. `$BTC`) and the other one as asset.
143
+
144
+ Airdrops and mined coins can be listed as a purchase with value 0 and an empty "currency" field.
145
+
146
+ ### EtherDelta / ForkDelta (`etherdelta`)
147
+
148
+ Connects to the API: **NO**
149
+
150
+ Parameters:
151
+
152
+ - file: path from where the transaction history will be loaded
153
+
154
+ To download a transaction history, use the [DeltaBalances tool](https://deltabalances.github.io), look up your transactions on the History page specifying the time range you need, and then download the "Default" CSV in the top-right section.
155
+
156
+ ### Kraken API (`kraken_api`)
157
+
158
+ Connects to the API: **YES**
159
+
160
+ Parameters:
161
+
162
+ - file: path where the transaction history will be saved
163
+ - api_key: API public key
164
+ - private_key: API secret key
165
+
166
+ Create the API key on your Kraken profile page. Select the "Query Funds" permission to import balances and "Query Ledger Entries" to import transactions.
167
+
168
+ ### Kraken CSV (`kraken_csv`)
169
+
170
+ Connects to the API: **NO**
171
+
172
+ Parameters:
173
+
174
+ - file: path from where the transaction history will be loaded
175
+
176
+ The Kraken importer expects a "Ledgers" CSV file downloaded from the Kraken's History page.
177
+
178
+ ### Kucoin API (`kucoin`)
179
+
180
+ Connects to the API: **YES**
181
+
182
+ Parameters:
183
+
184
+ - file: path where the transaction history will be saved
185
+ - api_key: API public key
186
+ - api_secret: API secret key
187
+
188
+ Create the API keys on your Kucoin profile page.
189
+
190
+ **Warning**: there's currently no way to create an API key on Kucoin with partial permissions; any key you create will have full access to your account, including placing orders and making withdrawals. Be careful with it.
191
+
192
+ ### Lisk Voting Rewards (`lisk_voting`)
193
+
194
+ Connects to the API: **YES**
195
+
196
+ Parameters:
197
+
198
+ - file: path where the transaction history will be saved
199
+ - address: your Lisk address
200
+
201
+ The importer loads a list of transactions sent to a given address from the Lisk explorer, picks those that are voting rewards sent from the delegates, and saves them as purchases made with zero cost.