Kointax.ioKointax.io

Leveraged Trading: Gains and Losses in IRPF

How to report gains and losses from leveraged crypto trading in Spain. Futures, margin trading, and contracts for difference (CFDs).

Equipo declaracrypto·April 15, 2026·7 min read

Leveraged Trading: Gains and Losses in IRPF

Leveraged trading —futures, margin trading, and CFDs— is increasingly common in the crypto ecosystem. Its tax treatment has important nuances that are worth understanding well.

Crypto Futures

Futures contracts are agreements to buy or sell an asset at a set price on a future date. When closing the position (or upon settlement), a gain or loss is realized.

Tax Classification:
Crypto futures are taxed as capital gains or losses (ganancias o pérdidas patrimoniales) in the savings base when the position is closed.

Taxable Event Timing: At the closing of the position, not when opening the contract.

Calculation Base:

  • Closing price − Opening price (adjusted for fees and financing).

Perpetual Swaps and Funding Rates

Perpetual contracts have no expiry date but periodically charge or pay a "funding rate" between long and short positions.

  • Funding rate received: Investment income (rendimiento del capital mobiliario).
  • Funding rate paid: Deductible expense of the operation (reduces the gain).

Margin Trading (Collateral and Liquidations)

In margin trading, you use your crypto as collateral to trade with more capital than you have.

Tax Aspects:

  1. Using collateral to open a margin position does not trigger a taxable event.
  2. Gains and losses from positions are capital gains/losses upon closing.
  3. If the exchange liquidates your position (margin call), the liquidation is the closing date → gain or loss at that moment.
  4. Interest paid for the borrowed margin is not deductible for individuals.

CFDs on Cryptocurrencies

CFDs are contracts for difference where you never own the underlying asset. The gain is the difference between the opening and closing price.

Classification: Capital gain or loss, same as futures.

Important: Many CFD providers are based abroad. Gains must still be reported, even if there is no withholding tax.

Offsetting Leverage Losses

Losses from futures, margin, and CFDs are capital losses in the savings base and are offset against other capital gains (including spot crypto gains) following the same rules we already know.

Taxation of Operations on Derivative Exchanges

Most major crypto derivative exchanges (Binance Futures, Bybit, OKX…) are not established in Spain and do not apply withholding tax. The responsibility to report gains lies entirely with the taxpayer.

Summary

InstrumentClassificationTaxable Event Timing
FuturesCapital gain/lossUpon closing position
PerpetualsCapital gain/lossUpon closing position
Funding rate receivedInvestment incomePeriodically
CFDsCapital gain/lossUpon closing position
Margin call (liquidation)Capital gain/lossUpon being liquidated

Conclusion

Leveraged trading can generate both large gains and large losses, and both must be reported. Keeping a detailed record of every operation —opening price, closing price, fees, and funding— is essential to correctly calculate the tax result.

Ready to calculate your crypto taxes?

Connect your exchanges, import your history and generate your IRPF report in minutes.

Start free — no card needed