DeFi Transactions Pre-Classification for Accounting

Intro

Accounting professionals providing digital asset accounting & tax services for individuals investing in cryptocurrencies and/or firms dealing with digital assets (treasury and/or investments), need to understand the raw on-chain transaction data from a DeFi activity perspective in order to build the proper financial reporting in compliance with the applicable jurisdiction.

Access to raw DeFi data is fairly easy, but understanding the kind of DeFi activity behind that raw data (farming, staking, LP deposits, …) often requires further processing & efforts, which is not the core of their business proposal. Advice on the correct regulatory tax event to declare for these actions, profit optimisation, cost-basis computation, … depending on the applicable jurisdiction, are the main values proposed by Accounting Service Providers and/or accounting Platform Providers to their end-clients. 

For this reason, the DeFi transactions data provided by MERLIN API P&L has been enhanced with a clear classification of the DeFi action which lays behind each transaction. MERLIN understands all DeFi strategies, and knows whether the wallets interact with other wallets or with Smart Contracts (DeFi protocols).

MERLIN transaction pre-classification

Retrieving on-chain raw transaction data is fairly easy, but understanding the kind of DeFi activity behind that raw data requires further analysis and data processing. Which is where MERLIN comes in. 

MERLIN’s understanding of all DeFi strategies and knowledge of all wallet’s interactions (with other wallets or smart contracts – DeFi protocols) has been translated into enhanced DeFi transaction classification, to provide the following additional information: 

  • the type of interaction (with wallet or smart contract), 
  • the type of movement (deposit, withdraw, send, receive, reward collection, liquidation, repay, …) – type of transaction, 
  • the type of DeFi action/investment (lending, liquidity pool, staking, farming, …), 
  • and to render the data exhaustive and transparent: the precise smart contract name and function (method) 

Thanks to this MERLIN data, DeFi transactions can be pre-classified: save time and manual tasks to accounting professionals & end-users in the process of generating financial reports for accounting, audit, tax, … . 

Based on the knowledge of their end-clients’ portfolio (wallets), accounting platform & service providers can finalize the reconciliation: the transactions classifications following the accounting/tax standards and the purpose of the financial reports to generate.

How it works

MERLIN API provides several endpoints to retrieve the transaction list by user (wallet) or by user position in a given DeFi protocol. For exhaustive API endpoints description, please refer to the dedicated MERLIN API documentation

The transaction response object details the DeFi movement in terms of:

  • Sender/receiver, interaction with wallet or smart contract (protocol)
  • Execution time, 
  • Moved token(s), 
  • Transaction fees, 
  • P&L for DeFi movements, 
  • Classification of DeFi movements from a DeFi action standpoint  

The DeFi movement classification is spread across several parameters:

    • tyType: type of transaction (movement) with possible values: Deposit, Withdraw, Borrow, Repay, Liquidation, Collect, Exchange, Send, Receive, Transfer, Receive Rewards, Migration, … 
    • txAction: type of DeFi investment with possible values: Liquidity Pool, Lending, Liquid Staking, Farming, Leveraged Farming, Yield, Locked, Vesting, Options Seller, Options Buyer, Insurance Seller, Insurance Buyer, Investment, Governance
  • Smart contract name
  • Smart contract function name
  • Protocol