In your Ledger history, there are three values you need to look for:
|Margin profits/losses (not including fees)||Margin||Amount|
|Margin opening & closing fees||Margin||Fee|
|Margin rollover fees||Rollover||Fee|
Note: Ledger entries where "type" is "Trade" only apply to non-margin trades.
What is it? Margin profit/loss is determined by the size of your spot position on margin and the price difference between the price when you opened the position and the price when you closed the position. Profits/losses are not directly determined by your level of leverage.
How to count it? For all Ledger entries where the "type" is "Margin", sum up the values in the "Amount" column.
If amount =0, it's a trade that opened a spot position on margin (and therefore no profit/loss yet).
If amount is >0 (positive), it's a profit from closing all or part of a spot position on margin.
If amount is <0 (negative), it's a loss from closing all or part of a spot position on margin.
Note: profit/loss amounts do not include fees.
2. Opening & closing fees
What is it? Opening & closing fees are charged when your currency purchase or sale order is executed (matched with another client's order) and a spot position on margin is opened or closed as a result.
How to count it? For all Ledger entries where the "type" is "Margin", sum up the values in the "Fee" column.
Note: opening & closing fees do not include margin opening and rollover fees.
3. Rollover fees
What is it? Rollover fees are charged every 4 hours that your spot position on margin is held open.
How to count it? For all Ledger entries where the "type" is "Rollover", sum up the values in the "Fee" column.
Note: The "amount" column should always be 0 for rollover fees.
IMPORTANT: Countries differ on how cryptocurrency transactions, trades and holdings are taxed (if at all) and how they view cryptocurrencies in general (e.g. as money, as property, as a commodity, etc). Please consult a local accountant, tax lawyer and/or government official for advice.