CoinTaxman icon indicating copy to clipboard operation
CoinTaxman copied to clipboard

Implement Kucoin Exchange

Open Griffsano opened this issue 2 years ago • 5 comments

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

Griffsano avatar Dec 05 '21 19:12 Griffsano

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

scientes avatar Dec 13 '21 12:12 scientes

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?

Griffsano avatar Dec 13 '21 12:12 Griffsano

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 avatar Dec 13 '21 12:12 scientes

  • 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

scientes avatar Jan 07 '22 17:01 scientes

binance api issue #59

provinzio avatar Apr 08 '22 21:04 provinzio