Margin, futures and perpetual trading records do not behave like ordinary spot trades. One position can produce collateral transfers, partial closes, realized profit or loss, funding payments, interest, fees and a forced liquidation. CoinLedger can reconcile supported derivatives activity or accept a manual Margin Gain/Loss, but accurate reporting begins with understanding what the exchange export actually contains.

Last reviewed: October 28, 2026. This guide focuses on U.S. federal tax recordkeeping and CoinLedger workflows. Tax treatment depends on the contract, venue, taxpayer and current law. The IRS has not provided comprehensive guidance for every crypto derivative, and CoinLedger integrations change over time. This article is educational and is not tax, legal, accounting or investment advice. Consult a qualified tax professional before filing.

Quick answer: preserve the exchange’s raw realized-PnL, funding, fee, interest, liquidation and transfer records. Check CoinLedger’s integration-specific guide before importing. If a position result is not supported automatically, CoinLedger may allow a standalone Margin Gain/Loss entry. Reconcile monthly totals and ending balances, avoid importing unrealized PnL, and never add a manual result that the integration already imported.

Why derivatives need separate reconciliation

A spot disposal normally connects an identifiable asset quantity with proceeds and cost basis. A derivative can create price exposure without transferring the underlying coin. The platform may settle only the net profit or loss in USDT, USDC, USD or cryptocurrency.

The ledger can include orders, fills, positions and settlements that describe different stages of one economic trade. Importing every row as a spot purchase or sale can invent asset movements that never occurred. Importing only deposits and withdrawals can omit the trading result entirely.

A correct workflow separates execution records from tax-relevant outcomes, then preserves enough detail to explain how each outcome was calculated.

Margin, futures and perpetuals are different products

Product Basic mechanism Recordkeeping focus
Spot margin Borrowed funds support purchases, sales or short positions. Asset disposals, borrowing, interest, repayment and collateral liquidation.
Dated futures A derivative contract settles or expires on a defined date. Contract classification, realized settlement and applicable reporting regime.
Perpetual futures A derivative without scheduled expiry, commonly using recurring funding. Position closes, flips, funding, fees and settlement asset.
Options A right or obligation connected to a strike and expiration. Premium, exercise, assignment, sale and expiry.
Leveraged token A tradable token whose value reflects managed leverage. Token buys, sales, swaps and associated basis, not an ordinary futures ledger.
DeFi derivative A smart-contract position using on-chain collateral and settlement. Wallet transactions plus contract-level PnL and uncertain tax character.

Do not choose a CoinLedger classification solely from a product’s marketing name. Read the contract and platform statement, then confirm tax character with a professional where rules are uncertain.

Realized PnL versus unrealized PnL

Unrealized PnL is the changing estimate for an open position. Realized PnL is the result recognized when exposure is closed, reduced, flipped, settled or liquidated under the platform’s rules.

Daily snapshots of unrealized PnL should not be imported repeatedly as income or disposal records. Doing so can count the same market movement every day. The final realized record should be reconciled with the actual settlement and fees.

Some dashboards label a figure “realized PnL” while including trading fees and funding; others show those items separately. Confirm the platform definition before adding separate fee or funding transactions.

Events that can realize a result

  • a complete manual close;
  • a partial close or reduce-only fill;
  • flipping from long to short or short to long;
  • contract expiration or delivery;
  • cash or crypto settlement;
  • forced liquidation;
  • auto-deleveraging or another risk-engine reduction.

An opening order generally creates exposure rather than a final net result. A canceled order creates neither exposure nor a realized trading outcome, although a separate fee is possible on some systems.

How CoinLedger uses Margin Gain/Loss

CoinLedger’s help documentation describes a Margin Gain classification for a realized profit or loss from margin and certain derivative positions. When an integration does not support the activity automatically, users may enter a standalone result rather than reconstructing fictional spot trades.

A manual entry commonly needs:

  • the UTC realization timestamp;
  • the exchange or derivatives subaccount;
  • the settlement asset;
  • the amount gained or lost;
  • a reference to the position, statement or close ID.

The classification is a software representation, not a legal ruling that every contract produces capital gain. Confirm the reporting treatment separately.

Automatic import versus manual entry

CoinLedger support varies by platform and import method. One integration may import margin activity through API but not CSV. Another may support perpetual closes while skipping internal account transfers. A generic “integration available” badge does not prove that every product is supported.

Use this decision sequence:

  1. Open CoinLedger’s current guide for the exact exchange or blockchain.
  2. Identify supported and explicitly unsupported transaction types.
  3. Choose the documented API, wallet or CSV method.
  4. Import a limited period first.
  5. Compare imported realized PnL with the platform statement.
  6. Add manual entries only for confirmed gaps.

Never combine a full automatic derivative import with a second set of manual net results without checking for duplicates.

Hyperliquid as an integration example

CoinLedger’s current Hyperliquid guide illustrates how product-specific support can work. It classifies closed or flipped perpetual positions as Margin Gain/Loss. Opening longs and shorts contribute to the position calculation, while the realized result is produced on close or flip.

The guide also says certain internal movements—such as transfers between the user’s spot and perpetual accounts or subaccounts—can be skipped because they do not represent an external asset movement. This behavior is specific to the current integration and should not be projected onto every exchange.

Export the complete evidence package

Before importing, download and preserve:

  • order history;
  • trade and fill history;
  • position and realized-PnL history;
  • funding received and paid;
  • borrowing and interest records;
  • trading and liquidation fees;
  • liquidation or ADL records;
  • deposits and withdrawals;
  • transfers among Spot, Margin, Futures and subaccounts;
  • beginning and ending balance statements.

Keep the original files unchanged. Spreadsheet software can alter timestamps, identifiers and scientific notation. Work from a copy when preparing reconciliation tables.

Orders, fills and positions are not interchangeable

An order is an instruction. A fill is executed quantity. A position aggregates exposure. A realized-PnL row records an outcome. These files can contain overlapping information about the same activity.

A limit order for 1 BTC that fills only 0.4 BTC should not be recorded as a 1 BTC position. A canceled remainder is not a separate loss. Use fills to confirm quantity and position history to confirm how the platform calculated the close.

Partial closes

Consider a 1 BTC long reduced in three stages:

  1. 0.25 BTC closed with a realized result;
  2. 0.50 BTC closed later at another price;
  3. the remaining 0.25 BTC closed finally.

The exchange may provide three results or one summarized statement. Use one consistent level of detail. Importing all three closes and the aggregate result would double count the same PnL.

Reconcile the sum of partial results, fees and funding to the position-level total. Note whether the platform uses average entry, lot-level matching or another method internally.

Position flips

A change from long 1 BTC to short 0.5 BTC contains two economic steps: closing the 1 BTC long and opening a new 0.5 BTC short. The close realizes the old position’s result; the new short remains open.

CoinLedger’s supported integration may calculate this automatically. In a manual workflow, record the realized old-side result once. Do not treat the entire 1.5 BTC execution as a spot disposal of BTC unless the product actually transferred that asset.

Funding payments

Perpetual funding is a recurring transfer intended to keep the contract near its reference market. A trader can receive or pay funding several times per day. The exchange may settle it in stablecoin, underlying crypto or account collateral.

Tax character for offshore and decentralized perpetual funding is not comprehensively settled by IRS guidance. Preserve the raw history and ask a tax professional whether the amounts should follow the position treatment, be reported separately or receive another classification.

For reconciliation, determine whether funding is:

  • already included in the platform’s net realized PnL;
  • shown as an independent credit or debit;
  • paid in an asset with its own cost basis;
  • accrued while the position remains open.

Trading fees and borrowing interest

Trading fees can be embedded in net PnL or presented separately. A fee paid in cryptocurrency can also involve a disposal of that asset. Use the platform’s definitions and ensure the same fee is not subtracted twice.

Margin interest is different from perpetual funding. It compensates a lender for borrowed assets. Any possible deduction depends on how borrowed funds were used, taxpayer status and applicable limitations. Do not label all margin interest deductible without professional review.

How liquidations affect records

A liquidation can close the derivative position, sell collateral, charge a liquidation fee and repay borrowed amounts. Those are separate ledger components even when they happen within seconds.

CoinLedger’s tax guide states that collateral sold during liquidation can be a taxable disposal even when the user never receives the proceeds. The gain or loss depends on the collateral’s basis and value when disposed of, not solely on whether the leveraged strategy lost money.

After liquidation, collect the final position settlement, collateral sale, debt repayment, fees and ending balance. A single red “liquidated” status is not enough to reconstruct the report.

Collateral can produce a gain during a losing strategy

Suppose collateral originally cost $6,000 and is sold for $8,000 during liquidation. The collateral disposal can contain a $2,000 gain before applicable adjustments, even if the derivative position produced a larger loss.

The derivative result and collateral disposal should not be merged without analysis. They can have different records and potentially different reporting treatment. This example is simplified and does not determine the appropriate form.

Auto-deleveraging and insurance adjustments

Auto-deleveraging can reduce a profitable or losing position under a platform’s risk rules. Insurance-fund credits or clawbacks may also appear separately. Preserve the exchange explanation and ledger code rather than relabeling the result as an ordinary close without evidence.

Check quantity reduced, execution or settlement price, realized result, fee and final position. If CoinLedger does not recognize the record, document the manual correction and obtain tax advice for its character.

Internal transfers usually need matching endpoints

Moving assets between accounts controlled by the same owner—such as Spot to Futures or main account to subaccount—may be a non-disposal transfer. Incomplete imports can make it appear as an unmatched withdrawal or unexplained deposit.

Preserve both sides with asset, amount, UTC timestamp and internal transfer ID. Link them when the software supports it. Do not create income merely to eliminate an unexplained deposit.

Stablecoin-margined contracts

USDT-M or USDC-margined contracts make the result easier to read in dollar-like units, but the settlement asset remains a digital asset. Fees paid with it, depeg-related changes and later disposals may need their own records.

Reconcile stablecoin beginning balance, deposits, withdrawals, net PnL, funding, fees and ending balance. A one-dollar assumption can hide discrepancies when large volumes or depegs are involved.

Coin-margined contracts

A Coin-M contract may pay profit in BTC, ETH or another cryptocurrency. Record the quantity received and fair market value at realization. That received asset obtains a basis for a later disposal under the selected tax treatment.

Funding and fees paid in the same coin change the quantity as well. Dollar PnL alone cannot reconcile the account; a unit-level balance equation is also necessary.

Section 1256 requires contract-specific analysis

IRS Form 6781 covers qualifying Section 1256 contracts and straddles. Applicable Section 1256 contracts use mark-to-market rules and generally divide capital results 60% long-term and 40% short-term, regardless of holding period.

Do not automatically apply that treatment to every crypto perpetual. Whether a product is a regulated futures contract under the tax rules depends on its legal and trading structure. Offshore exchange perpetuals and DeFi derivatives can present unresolved questions. CoinLedger’s Margin Gain classification does not make a contract Section 1256.

Form 8949, Schedule D and Form 6781

IRS Form 8949 reports sales and exchanges of capital assets and feeds applicable totals to Schedule D. Current instructions include digital-asset reporting categories and require basis, proceeds, dates and adjustments where applicable.

Form 6781 serves Section 1256 contracts and straddles. Other types of income or business activity may belong elsewhere. The correct form follows the legal character of the transaction, not simply the export filename.

Form 1099-DA is not the complete ledger

An information return may omit basis, unsupported products, offshore activity or transactions outside the reporting broker. IRS guidance requires taxpayers to report taxable digital-asset transactions even when no information form was received.

Reconcile every 1099-DA amount with CoinLedger and raw platform records. Do not delete a valid internal record just to force software totals to equal an incomplete form. Document and resolve differences according to current form instructions.

Step-by-step CoinLedger workflow

  1. Download and preserve every raw exchange export.
  2. List all Spot, Margin, Futures and perpetual accounts.
  3. Read CoinLedger’s current guide for each exact integration.
  4. Import supported activity using the recommended method.
  5. Confirm the imported date range and timezone.
  6. Match deposits, withdrawals and internal transfers.
  7. Compare monthly realized PnL with exchange statements.
  8. Reconcile funding, fees and borrowing interest separately.
  9. Identify partial closes, flips, liquidations and ADL.
  10. Search for duplicate automatic and manual records.
  11. Add verified unsupported results using the appropriate CoinLedger classification.
  12. Compare expected and actual ending asset balances.
  13. Export the reconciliation and preserve supporting files.
  14. Ask a tax professional to review uncertain contract classifications.

Manual Margin Gain example

A hypothetical supported manual record may contain:

Timestamp 2026-05-14 18:42 UTC
Source account Example Exchange Futures
Settlement asset USDT
Margin gain 425 USDT
Reference Position close ID 12345

For a loss, use the loss field and amount required by the current CoinLedger interface. First verify that no automatic record already represents the same close.

Monthly PnL reconciliation

Month Exchange realized PnL CoinLedger Difference
January $1,250 $1,250 $0
February -$480 -$300 -$180
March $725 $725 $0

The February difference could be missing funding, a fee, an unsupported close, a liquidation or a timezone cutoff. Trace the discrepancy rather than adding an unexplained balancing transaction.

Year-end balance equation

A simplified control is:

Beginning balance + deposits − withdrawals + realized PnL + funding received − funding paid − fees − interest = expected ending balance

Adapt this equation to the exchange. Include rewards, rebates, conversions, collateral sales and adjustments when present. Reconcile each settlement asset in units as well as fiat value.

Common mistakes

  • Importing open or canceled orders as realized transactions.
  • Recording daily unrealized PnL as income.
  • Adding manual PnL already imported automatically.
  • Ignoring partial closes and position flips.
  • Using local time when the exchange statement uses UTC.
  • Counting funding or fees twice.
  • Recording a liquidation but omitting collateral disposal.
  • Treating internal transfers as income or sales.
  • Assuming every futures contract qualifies for Section 1256.
  • Relying only on Form 1099-DA.
  • Deleting source files after generating a tax report.

Frequently asked questions

Does CoinLedger support futures and perpetuals?

Support depends on the platform and import method. Some integrations classify supported closes automatically; other activity may require manual Margin Gain/Loss entries.

Should I import the opening of a position?

Preserve it for reconciliation, but do not automatically create a taxable spot trade. Follow the current integration’s documented treatment.

Is unrealized PnL taxable?

Ordinary open-position PnL is not the same as a realized settlement. Special mark-to-market regimes can differ, so contract classification matters.

How are partial closes recorded?

They can generate separate realized results. Ensure partial records are not duplicated by a later aggregate total.

How is perpetual funding taxed?

IRS guidance does not comprehensively classify every offshore or DeFi funding payment. Preserve separate records and obtain professional advice.

Are liquidations taxable?

A liquidation can realize the position and dispose of collateral. CoinLedger notes that collateral disposal can create gain or loss even when proceeds repay the platform.

Are transfers between my own subaccounts taxable?

A transfer without a change in beneficial ownership may be non-taxable, but both endpoints must be imported and linked correctly.

Are all crypto futures Section 1256 contracts?

No. Qualification depends on the contract and venue. Do not apply Form 6781 or 60/40 treatment solely because a product is called futures.

What if the API does not import derivatives?

Download the complete platform statement, follow CoinLedger’s manual Margin Gain guidance and reconcile totals before filing.

How do I prevent duplicates?

Filter by account, timestamp, settlement asset, amount and reference ID. Compare monthly CoinLedger totals with exchange realized PnL before adding anything manually.

Final takeaway

Derivatives tax reporting is a reconciliation problem before it is a form-generation problem. Preserve the complete ledger, identify actual realization events and separate position PnL from funding, fees, interest, collateral sales and internal transfers.

Use CoinLedger’s integration-specific documentation, verify every manual Margin Gain/Loss and keep an audit trail explaining adjustments. Software can organize the records; a qualified professional should decide uncertain legal classification.

Official sources