guest@tfb:~$ cat analysis/defi-lending-yield-tax.md
~/analysis/defi-lending-yield-tax.md

DeFi: lending, yield and decentralised protocols

Investment income from the transfer of capital (Article 25.2 LIRPF) · V0648-24 · V1766-22

A widespread misunderstanding should be cleared up at the outset. For years, the taxation of DeFi was presented as an absolute doctrinal vacuum, in which everything depended on an open assessment. That description is no longer accurate: ruling V0648-24 engages squarely with several common operations in the ecosystem. That said, its reach should not be overstated either. Its value lies in setting criteria for certain types of income and participation structures, while leaving aside core questions such as the acquisition and redemption of LP tokens. There is, therefore, useful doctrine, but of limited scope; and it is that combination that should order the analysis.

Collateralised loans: posting collateral is not, in itself, a disposal

When a taxpayer locks bitcoin, ether or another crypto-asset as collateral to obtain stablecoins or other assets lent by a protocol, the critical point is to determine whether there is a genuine disposal, with a change in net worth, or merely the same asset being pledged as security.

It is worth making clear that we are not moving here on prudence alone. V0648-24 itself, in the section devoted to lending operations, addresses this scenario and does not classify the delivery of crypto-assets as security as a disposal giving rise to a capital gain or loss: the collateral is returned to the taxpayer once they repay the loan. There is, therefore, directly applicable doctrine confirming the treatment as a security operation, and not a mere conjecture of the interpreter.

It should be recalled that this does not place the activity off the tax radar, and here a point the ecosystem tends to overlook deserves qualification. Where that collateral is contributed to the protocol’s liquidity reserves and generates income —the usual case in lending protocols, where the deposit is documented in assets of the type of Aave’s aTokens—, the DGT classifies that income as gross investment income from the transfer to third parties of one’s own capital (Article 25.2 LIRPF), to be included in the savings base. The taxable event therefore does not arise only on a possible forced liquidation: the mere receipt of yield on the collateral already gives rise to investment income. Three moments should be clearly separated: the locking of the asset as security, the income that asset may generate while it remains deposited, and the subsequent realisation of the collateral by the protocol or by third parties.

Lending and yield: where there is support for treating it as income

Where the income comes from the economic transfer of crypto-assets to a protocol or to third parties, the relevant administrative line points towards classifying it as investment income —the transfer to third parties of one’s own capital under Article 25.2 of the Personal Income Tax Act (LIRPF)— provided the activity does not amount to a self-directed organisation of means of production and human resources (Article 27.1 LIRPF). The distinction is no minor matter, and it is worth being precise about it, because the boundary is more poorly defined than is usually assumed: the DGT confirmed this classification even for a taxpayer acting as a validator, finding that the validation was carried out automatically and with minimal resources, without an organisation sufficient to constitute a business activity (V1766-22). The boundary, then, is not the existence of clients, but the degree of organisation of means. That ruling is the reference for staking, and V0648-24 confirms that the DGT operates within that same framework when analysing the income generated by more complex liquidity and lending structures.

In these cases two planes must be distinguished, and they should not be mixed. On one side, the income —periodic or one-off— obtained from the economic transfer of the assets, attributable to investment income. On the other, the possible subsequent capital gain or loss, when the tokens or crypto-assets received as income are disposed of.

Where that income is received in kind —tokens or crypto-assets—, it is measured at its market value in euros on the date it is received (Article 43.1 LIRPF); that same value constitutes the acquisition cost of the tokens received, which determines the capital gain or loss on their subsequent disposal.

Liquidity pools and LP tokens: what the doctrine resolves and what it leaves open

V0648-24 shows that the DGT has already engaged with the economics of liquidity pools and yield-optimisation platforms. But the ruling itself, according to the official extract available, expressly sets aside the acquisition and redemption of LP tokens —the tokens the protocol gives the liquidity provider to represent their share in the pool. That fact is decisive: the ruling supports the taxation of certain income, but does not in itself close the more delicate question, which is whether the initial contribution of assets to the pool and the receipt of LP tokens constitute a barter with immediate tax effect.

For that reason, neither of the two approaches should be presented as settled: neither the strict one —an immediate barter of the assets contributed for distinct LP tokens— nor the flexible one —a mere economic representation of the same position, with no relevant change in net worth until redemption. The correct course is to explain that there is useful doctrine on the income from liquidity provision, but that the initial swap into LP tokens and their subsequent redemption remain a focus of material uncertainty.

Liquid staking: a better-defined grey area, but still open

Liquid staking adds a layer of complexity, because the taxpayer not only receives income but usually also receives a representative token —stETH, rETH or others— that can circulate, be sold or be deployed in new strategies. As things stand, it cannot be asserted that there is a Spanish binding ruling that has specifically closed the treatment of that initial receipt in all its forms.

The available doctrine comfortably supports the taxation of the income generated by the transfer of assets. It does not yet settle, however, whether the receipt of the representative liquid token should be treated as an immediate barter or as a mere technical reflection of an underlying economic position. That distinction must be characterised, without circumlocution, as a genuine grey area.

Wrapping and bridging: reasoned opinion, not a settled criterion

In wrapping and bridging operations the taxpayer usually keeps the same economic exposure to the underlying, although they come to operate with a technically distinct version of the asset, on another network or contract. From an economic perspective, there are respectable arguments for defending neutrality in some cases of 1:1 conversion. From a strictly legal perspective, it can also be argued that they are formally distinct assets and therefore a potentially relevant barter.

There is, as things stand, no Spanish binding ruling that expressly closes the treatment of wrapping or bridging. In fact, V0648-24 expressly mentions bridges and wrapped tokens, but declines to rule on their treatment because the taxpayer did not provide the context and the specific operations in which they were used. We are not, then, faced with an absolute doctrinal silence, but with a question the DGT has not gone on to resolve owing to the insufficiency of the submission; a well-constructed request for a ruling could obtain an answer. The prudent course is to present both theses —economic neutrality or legally relevant barter— as defensible positions, and to note that we remain in the territory of reasoned opinion. These two operations are analysed in more detail in the dedicated analysis of wrapping and bridging.

DGT rulings — IRPF
  • V0648-24 — classifies as investment income (Article 25.2 LIRPF) the income obtained from the transfer of crypto-assets in liquidity and lending structures; expressly leaves aside the acquisition and redemption of LP tokens.
  • V1766-22 — reference for the classification as investment income of rewards for the transfer of one’s own capital.

Applicable legislation: Articles 25.2, 33.1, 34, 35, 37.1.h) and 43.1 LIRPF.

There is useful doctrine (V0648-24) for the income from lending and liquidity provision, reclassified as investment income. The initial swap into LP tokens, the receipt of the liquid-staking token and wrapping/bridging remain grey areas: defensible positions, with no closed administrative criterion.