How to Calculate P&L in Crypto Trading?

1Token

In corporate accounting, a profit and loss (P&L) statement is a type of financial statement that shows the amount of money made and spent over a certain period. The activity of P&L calculation is called P&L accounting. However, in the crypto / digital asset market, P&L accounting is in general similar to the traditional market but has additional complexity. In this article, 1Token will share insights on the calculation of P&L in crypto trading.

What is P&L?

In corporate accounting, a profit and loss (P&L) statement is a type of financial statement that shows the amount of money made and spent over a certain period. The activity of P&L calculation is called P&L accounting.

For financial market participants, such as funds, and asset managers..., profit and loss is the amount of money made (or lost) from trading activities. P&L could come from buying and selling, holding a position, derivatives expiry/delivery, interest payment… and can be classified into realized / unrealized P&L.

In traditional finance, most companies calculate their trading account’s P&L from 2 perspectives:

  • Real-time P&L, calculated by intra-day trades from OEMS, with a bottom-up approach
  • End-of-day P&L, calculated by the actual clearing and settlement results from the broker with a top-down approach, meanwhile has to be reconciled by the executed trades from OEMS

Let’s deep dive into the topic of how P&L accounting can be done in crypto trading.

Methodology

In the crypto / digital asset market, P&L accounting is in general similar to the traditional market but has additional complexity.

Similarly, P&L can be calculated by top-down (end-of-day P&L) and bottom-up (real-time) approaches.

While crypto exchanges are trading 7*24, also crypto exchanges have covered the role of OEMS and brokers that clear and settle trades instantly without an 'end-of-day' concept, so the settled balance can be retrieved from exchanges in real-time for free. Traders can track real-time and end-of-day P&L with both top-down and bottom-up approaches, so the primary classification in crypto P&L accounting will be top-down and bottom-up.

Top-down

The overall P&L is by comparing the difference of asset (equity and cash) balance.

Balance (t1) – Balance (t0) – Net asset transfer (between t0 and t1) = Trading P&L (between t0 and t1)

Let’s explain with an example:

Suppose at t1, market price for BTC is $30k, ETH is $2k, USDT is $1 

P&L (t0-t1) = 0.6 * 30k + 1 * 2k - 13k = 7k USD

The P&L is measured by calculating the total asset (equity) balance’s movement, doesn't matter if the original acquiring cost is $30k or $40k.

It’s simple because there are no transaction details in the calculation, and it’s accurate because there’s no way of mistaking it.

Bottom-up

Let’s continue the above example. 

Basic 

E.g., starting from t0, the balance is 50k USDT, suppose USDT in this case equals USD (which in reality it’s different) 

Between t0 and t1, the below trades are executed (taking trading fees out for simplicity)

  • Buy 0.5 BTC at $18k
  • Sell 0.4 BTC at $25k
  • Buy 1 ETH at $3k
  • Buy 0.5 BTC at $22k 

Suppose at t1, the market price for BTC is $30k, ETH is $2k, and USDT is $1 

With bottom-up calculation, the total profit of 7k can be further divided by: 

FIFO

  • Realized P&L on BTC = $2.8k (taking the 1st BTC trade as realized)
  • Unrealized P&L on BTC = $5.2k
  • Unrealized P&L on ETH = $-1k 

LIFO

  • Realized P&L on BTC = $1.2k (taking the 2nd BTC trade as realized)
  • Unrealized P&L on BTC = $6.8k
  • Unrealized P&L on ETH = $-1k

Above is a simple version, there can be further complications in crypto transaction-based P&L.

Let's first explain a major difference between the traditional stock market and the crypto market.

In the traditional stock market, equities can only be traded against fiat (e.g., NASDAQ: TSLA / USD), not against another equity (e.g., NASDAQ: TSLA / NASDAQ: AAPL), and equity cannot be transferred to another account/broker.

But in the crypto market, there are both stablecoins and coins. Stablecoins like USDT and USDC, are similar to fiat because there's a stable value (and pegging mechanism behind), while coins like BTC and ETH, are similar to equities in that they have a price against fiat. However, the difference between coins and equities, is that coin trades do not necessarily go through fiat or stablecoin. In the crypto spot market, trades can be coin to coin (e.g., ETH/BTC). In the crypto derivatives market, margin currency can be coins (e.g., BTC/USD perpetual swap settled in BTC). Also, coins can be transferred directly from one account or one venue to another. Those differences bring complexity to P&L accounting in crypto trading.

Coin-Coin Cross Pairs

E.g., in the previous example

  • Buy 0.5 BTC at $18k
  • Sell 0.4 BTC at $25k
  • Buy 1 ETH at $3k
  • Buy 0.5 BTC at $22k 

Let’s change trade #2 and #3 a bit to be

  • Buy 0.5 BTC at $18k
  • Buy 0.333 ETH with 0.4 BTC
  • Buy 0.667 ETH at $3k
  • Buy 0.5 BTC at $22k

How to calculate how much is realized/ unrealized in BTC and ETH? A standard way is to split the trade into 3 virtual trades (BTC to USD, and USD to ETH, and a virtual trade of trading fee)

Trading Fee and Rebate

Unlike traditional finance, fees are charged with fiat (like USD), in crypto trading trading fees are usually charged on the ‘output’ coin, i.e. a trade to sell CoinA (BTC) to buy CoinB (ETH), fee is usually in CoinB (ETH).

Some exchanges encourage traders to use the exchange's native token for fee deduction

https://www.binance.com/en/support/faq/how-to-use-bnb-to-pay-for-fees-and-earn-25-discount-115000583311

i.e. a trade to sell CoinA (BTC) to buy CoinB (ETH), fee is usually in CoinB (ETH), but can also be in CoinC (BNB)

Extra complexity would be rebates. Some exchange rebate fees in batch hourly/daily or even weekly / monthly, which is not settled in real-time with the trade.

Coin-Margined Futures

In crypto, there are USD(S)-margined futures, which are easier to calculate P&L because the mechanism is close to margin trading.

However, there are Coin-margined futures, e.g., BTCUSD futures settled in BTC.

Extra complexity would be a multi-collateral margin model, e.g., trading BTCUSD futures settled in BTC, but with collateral in ETH. If there’s a loss in BTC, there will be an interest.

Advantages and Applications

Top-down and bottom-up should result in the same total P&L (there should be a reconciliation process to make sure the results match), while there are different advantages, and hence applications.

Top-down

Top-down P&L has its advantage in low latency, accuracy, and efficiency.

Low latency – Exchanges support frequent queries and return the whole info

Accuracy - there’s very little chance of mistaking, and the data is very easy to be verified.

Efficiency - the calculation is simple and quick.

While top-down P&L is accurate and efficient, it has limitations in granularity.

  • Realized and unrealized P&L on the spot. (derivatives unrealized P&L info is usually provided by exchanges)
  • P&L attributions from instruments if there are multiple instruments trading mixed in one account (e.g., trading BTC/USDT and ETH/USDT spot in the same account).
  • Accounting strategies like FIFO/LIFO

So the main application is in front office (trading team), where low latency is the most important consideration, and also in middle office (operations team) to reconcile NAV with fund admin results because of its accuracy.

Bottom-up

Bottom-up P&L has its advantage in granularity, because P&L by position, realized/ unrealized P&L… must come from bottom-up trading analysis.

Bottom-up P&L calculation provides the full audit trial history, so auditors can verify if transactions are complete, and build their own calculations with all the transactions they collected.

While bottom-up P&L has limitations on accuracy and efficiency, especially for high-frequency trading, because missing any trade record will cause incorrect P&L results.

So the main application is in the middle/back office (operations team, fund admin), where accuracy and audit trial are the most important considerations.

Reconciling Top-down and Bottom-up Results

In traditional finance, hedge funds need to reconcile between brokers and OEMS results every day.

Similarly, crypto hedge funds, depending on their trading frequency, need to reconcile regularly between exchange transactions (execution log) and settlement results (balance and position info).

This is a huge task due to various challenges of exchange infra, e.g., fast developing business, incomplete API endpoints, and different logic and data from each exchange...

Besides reconciliation on centralized exchanges, more and more funds are using DeFi and the data on DeFi can be more non-standardized compared to centralized exchanges.

1Token’s Service

Rooted in crypto quant trading, 1Token has the unique trading know-how and technology capabilities to build:

  • Up-to-date and high-confidence connection to all crypto trading venues, across DeFi and CeFi
  • Top-down, Bottom-up P&L calculations, and reconciliation of top-down and bottom-up results
  • Real-time trading metrics calculation, monitoring and alerts
  • T+0 shadow NAV accounting system with subscription, redemption, dividend, cost accruals...

1Token has been serving global digital asset managers, fund platforms, fund admins, and auditors, to enable them to conduct crypto-related business without any concern for technology.

1Token is undertaking SOC2 audits and provides on-premise deployment to regulated clients.

Tools

1Token

1Token is a financial software company for crypto institutions, supporting front-to-back-office business operations, digital & traditional assets, and connectivity to 100+ CeFi / DeFi trading venues. Having served 40+ top crypto institutions globally, we are pleased to share with you insights into the latest trends and innovations in Web 3 Finance.

delate
Use TokenInsight App All Crypto Insights Are In Your Hands
Open