CoinTaxman
CoinTaxman copied to clipboard
Implement Kucoin Exchange
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
Word of warning Kucoin currently only exports the spot history. it ignores trading bots and coin lending in the exports
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?
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)
-
for binance at the least we need to implement parts of the api connector lib because the current python libs for the api expose only spot and margin endpoints. But the endpoints for all other actions are present on the api side
-
and kucoin only has margin, spot and coin lend implemented on their api but no proper api lib
binance api issue #59