Skip to main content

Understanding Margin Transaction Imports: Realized P&L vs. Trades

Layla Huang avatar
Written by Layla Huang
Updated today

What You'll Learn

This article explains why margin trading transactions may be imported as 'Realized Profit' and 'Realized Loss' instead of a buy, sell, or trade that creates a capital gain event (or vice versa), and why this can not be easily switched around.

What is margin trading?

Borrowing funds from an exchange to buy or sell crypto assets in the spot market, using leverage to amplify your position.

Note: Margin trading transactions often appear in your Derivative Trading Report if they're categorized as Realized Profit/Loss or Margin Fees.

In this guide, you'll learn:

  • How your transactions are shown in the app depends on the data exchange provided

  • What you can do if your exchange data doesn't match your tax needs


Why Margin Transactions Import Differently

When you import margin trading activity from an exchange, Crypto Tax Calculator can only work with the data format your exchange provides. Exchanges handle margin trading data mainly in two different structures, and this determines how your transactions appear in the app.

How Exchanges Provide Margin Trading Data

Data Structure

Type 1

Type 2

Transaction Category

Realized Loss, Realized Profit, Margin Fee

Trade, Buy, Sell

Report

Derivative Trading Report

Capital Gains Report

Gain Type

Income

Capital gains

Data Structure Type 1: Aggregated Profit/Loss (P&L)

Some exchanges export margin trades as a single net profit or loss transaction. Your transactions would show as:

  • Category: Realized Profit or Realized Loss

  • Currency: Generally fiat (USD, AUD, etc.) or stablecoins (USDT, USDC, etc.).

What's included:

The final profit or loss after your position closed, sometimes with all fees already deducted.

What's missing:

Entry prices, exit prices, quantity, the specific crypto assets traded, and timestamps for when you opened the position.


Data Structure Type 2: Individual Trade Records

Other exchanges export margin trades as separate buy, sell, or trade transactions. Your transactions would show as:

  • Category: Buy, Sell, or Trade

  • Currency: Currencies you traded. Could be any.

What's included:

Time and prices you bought and sold, the specific crypto asset, quantity, and usually separate (margin) fee transactions.

What's available:

The data can be used to calculate cost basis, holding period, and capital gains.


Why This Matters for Tax Calculation

The data type your exchange provides determines what type of tax calculation is possible:

For Capital Gains Tax (CGT) calculation, you need:

  • Original purchase price (cost basis)

  • Sale price when position closed

  • Date acquired (to determine short-term vs long-term)

  • The specific crypto asset traded

For Income/P&L calculation, you need:

  • Net profit or loss amount

  • Date received

  • Currency (usually USD, your local currency, or stablecoin)

These require fundamentally different data structures. If your exchange only provides aggregated P&L data, we cannot retroactively calculate the individual cost basis entries needed for CGT treatment.


Common User Scenarios

Scenario 1: "My margin trading imported as Realized P&L, but I need them to be treated as a CGT event"

Example:

Users whose margin trading appears in the Derivative Trading Report as Realized gain and loss, which are treated as income, but they need it calculated as capital gains.

The Problem:

Your exchange provided data that looks like this:

Realized Profit: 850 USDT

To calculate this as capital gain, Crypto Tax Calculator needs information about the crypto that was traded (not USDT), when you bought/sold it and at what price. Sometimes information might be visible on your exchange account, but it's not provided via API or can not be exported as CSV. The calculation engine needs the underlying transaction details that your exchange didn't provide.

What You Can Do:

  1. Check if your exchange offers a different export format (see "What You Can Do" section below)

  2. Contact your exchange to request a detailed trade history

  3. Consult with your tax professional about whether P&L summaries are acceptable for CGT reporting in your jurisdiction, or what would be the workaround


Scenario 2: "My margin trades imported as buy/sell/trades, but I need them as realized P&L"

The Problem:

Your exchange provided detailed buy/sell records, and Crypto Tax Calculator imported them as buy/sell/trade transactions. Now you want them consolidated as Realized Profit/Loss.

Why This Happens:

When exchanges provide trade-level data, Crypto Tax Calculator treats them as regular spot trades because that's what the data structure indicates. The app doesn't automatically calculate these trades to a margin position.

What You Can Do:

  1. Check if your exchange offers a P&L summary export

  2. Work with your tax professional to determine how this can be calculated into realized P&L


What You Can Do

If your margin transactions aren't importing with the data structure needed for your tax treatment (i.e., importing as P&L when you need trades, or vice versa), here are the steps you can take:

Step 1: Obtain transaction data from the exchange

  • Exchanges might provide multiple export options. Check your exchange account for alternative export options or contact the exchange support team for guidance on where and how to export the file.

  • If you can not find the data you need in your exchange account, contact their support team and ask if they can provide the transaction data for you.

  • If there is no data that can be exported, check if you can see the data being displayed in your account. You can use the data for the custom CSV.

Alternative option: Work with Your Tax Professional

Your accountant may have solutions you haven't considered. Some countries have specific provisions for different types of trading activity, and your tax professional can advise on what's acceptable in your jurisdiction.


Step 2: Manually import data

Once you obtain the data or consult with your tax professional about the most suitable approach, you can use the custom CSV to import it or directly add transactions in the app.


Did this answer your question?