Lbank CSV export - should I merge trades

I’m building an automatic export for Lbank using their API. The reason why I’m doing it is that:

  • it takes a long time to get a CSV from lbank support
  • current implementation in Koinly is broken, and honestly I don’t see this being solved anytime soon due to the terrible quality of the Lbank API. I suspect it is just not possible to do.

My issues it that Lbank API reports trades as several transactions. I’m not sure if I should merge them together by order id, or leave them as separates trade. It doesn’t change much in Koinly, but I’m concerned about French regulations, because you need to keep track of to the price you buy the tokens.

Should I use merged transactions from a same order ID:
Amount=30 COIN, Total=300USD, Order Id = ABCD, Fee = 3 USD

Or leave them separated :
Amount=10 COIN, Total=100USD, Order Id = ABCD, Trade Id = A, Fee = 1 USD
Amount=5 COIN, Total=50USD, Order Id = ABCD, Trade Id = B, Fee = 0.5 USD
Amount=15 COIN, Total=150USD, Order Id = ABCD, Trade Id = C, Fee = 1.5 USD

EDIT: another concern is that dividing them could lead to register too many transactions and make you pass as a “Pro Trader” for the government, with higher taxes due.

(If you are interested in my script, I might share it on github, reply to this post if you want it.Python skills will be required to use it).

1 Like

Hmm fascinating topic :thinking:

I don’t have much to offer by way of opinion, but I would certainly be interested to see the end result! :sweat_smile:

I know that recently, our Binance CSVs are now aggregated to reduce the overall transaction count for users, so I think doing the same would be beneficial in this case.

If users could have the option for either, that would be awesome!

1 Like

I made some tests and it seems that if you put the same order ID, the trades are automatically merged so I’m doing it that way.

Apparently there is no way to get a list of past transactions without knowing what date you want. This is just stupid… This make using the script a pain, you have to specify the date AND the coin pairs you want to extract from trades. I could browse all dates from the starting point, but then I would hit the API limit very quickly and have to implement a delay to avoid that. That might be why Lbank sync takes ages in Koinly. Rewards are nowhere to be found in the history…

Even worth, they have typos in the API endpoints, like “coin” spelled “coid”, but not always. Worse API ever…

I just confirmed with the support, rewards only appear in the CSV you ask to the technical team. They say it takes 1 week, you need to send them a pictures with you id card and a text on a paper.

My advice if it’s not too late: don’t use LBANK. Not worth the trouble…

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.