provinzio / CoinTaxman

Calculate your taxes from cryptocurrency gains
GNU Affero General Public License v3.0
141 stars 31 forks source link

Implement Kucoin Exchange #92

Open Griffsano opened 2 years ago

Griffsano commented 2 years ago

I propose to add Kucoin as new supported exchange.

The CSV export looks like this:

tradeCreatedAt orderId symbol side price size funds fee liquidity feeCurrency orderType
2021-12-01 00:00:00 abcde0123456 BTC-USDT buy 12345 0.123 1518.435 0.12345 maker USDT limit

The Kucoin API seems to support historic prices: https://docs.kucoin.com/#get-trade-histories And there is also an python SDK available: https://python-kucoin.readthedocs.io/en/latest/index.html

One problem that I currently see is that only the timestamp of order creation is available, not the timestamp of order execution. Therefore, we probably have to use the API: https://docs.kucoin.com/#list-fills

Edit: It may be possible to address this similarly as proposed for the Gate.io exchange https://github.com/provinzio/CoinTaxman/issues/91#issuecomment-986287245

scientes commented 2 years ago

Word of warning Kucoin currently only exports the spot history. it ignores trading bots and coin lending in the exports

Griffsano commented 2 years ago

From what I've seen in the CSV exports and API documentation, we probably have to access the API with a key anyways to get the timestamp of order execution. If we're doing this, we might as well pull all the information from the API and not use the CSV at all. What do you think?

scientes commented 2 years ago

yes i want to do this anyways for binance as well, because binance also ignores some actions in its exports (rewards from liquid swaps and even sometimes from staking)

scientes commented 2 years ago
provinzio commented 2 years ago

binance api issue #59