🤑PnL and ROI

In perpetual futures trading, key metrics like Return on Investment (ROI) and Profit and Loss (PnL) are essential. These metrics serve as critical indicators of a trader's performance and financial outcomes. This documentation aims to elucidate the concepts of ROI and PnL, focusing on both realized and unrealized aspects, and underscores the impact of fees, including open/close position fees, funding fees, and rollover fees.

Return on Investment (ROI)

ROI is a fundamental metric employed in trading to assess the profitability of an investment. It quantifies the return generated relative to the initial capital invested. In perpetual futures trading, ROI is an invaluable tool for evaluating the efficacy of trading strategies.

The formula for calculating ROI is as follows:

ROI = ((Final Value - Initial Investment) / Initial Investment) * 100

In this context:

Initial Investment represents the capital allocated to a trading position. Final Value encompasses both realized and unrealized gains or losses.

Realized and Unrealized PnL

Profit and Loss (PnL) in perpetual futures trading can be categorized as realized and unrealized.

Realized PnL: This metric signifies the actual profits or losses realized upon closing a trading position. It factors in the difference between the entry price and exit price, accounting for associated fees, including open/close position fees, funding fees, and rollover fees. Realized PnL provides a precise depiction of the financial outcome of a particular trade.

Unrealized PnL: In contrast, unrealized PnL denotes the potential profits or losses linked to open positions that have not yet been closed. These gains or losses fluctuate with market price movements but remain unrealized until the position is closed. Unrealized PnL is a dynamic metric that responds to evolving market conditions.

Impact of Fees on PnL

Fees exert a significant influence on realized PnL. Notably, the following fees must be considered:

Open/Close Position Fees: These fees are incurred when initiating and closing positions, directly affecting the realized PnL of each trade.

Funding Fees: Perpetual futures contracts entail funding payments exchanged between long and short traders to maintain alignment with the underlying asset's market price. Funding fees contribute to realized PnL.

Rollover Fees: Rollover fees arise from maintaining open positions over time. These fees contribute to realized PnL.

Example: Computing unrealized and Realized PnL with Leverage and Fees

Example №1

Long Position (Borrowed capital to buy an asset):

  • Initial Investment: $10,000

  • Leverage: 10x

  • Asset: Bitcoin (BTC)

  • Entry Price: $45,000 per BTC

  • Current Market Price: $47,000 per BTC

Calculation of the protocol commission when opening a position::

  • Commission for opening a position = Collateral Amount * Leverage Amount * 0.12%

  • Commission for opening a position = 10,000 * 10 * 0.0012 = $120

Calculating Unrealized PnL:

  • Note that for a Long position and a Short position there is a difference in the calculation of the coefficient in the first part of the formula. For a Long position, since the profit comes with an increase in the price of the asset, we apply: (Current Market Price / Entry Price - 1). For a Short position, since the profit comes when the asset price decreases, we apply: (1 - Current Market Price / Entry Price).

  • Unrealized PnL = (Current Market Price / Entry Price - 1) * (Collateral amount - Opening fee) * Leverage size

  • Unrealized PnL = (47,000 / 45,000 - 1) * (10,000 - 120) * 10 = 4,391.11 $

Accounting for commission for holding a position (Rollover fee):

  • We assume that the position holding period was 48 hours:

  • Commission for holding a position = (Collateral Amount - Opening Commission) * 0.0034% * Number of hours

  • Rollover Fee = ((10,000 - 120) * 0.000034 * 48 = $16.12

Accounting for Funding fees:

  • We assume that the position holding period was 48 hours, and the volume of positions of those who held Short positions was greater than those who held Long positions, and the average Funding rate was 0.0018%, which went to the income of the holders Long positions. Therefore, this amount will go to us as a revenue portion. While if the market situation were the opposite, we would subtract this amount to calculate the final income:

  • Funding fee = (Collateral amount - Opening fee) * Leverage size * 0.0018% * Number of hours

  • Rollover Fee = ((10,000 - 120) * 10 * 0.000018 * 48 = $85.36

Calculation of the protocol commission when closing a position:

  • Commission for closing a position = ((Collateral Amount - Opening Commission) * Leverage Size + Unrealized PnL - Commission for holding a position + Funding Commission) * 0.12%

  • Commission for closing a position = ((10,000 - 120) * 10 + 4,391.11 - 16.12 + 85.36) * 0.0012 = $123.91

Calculation of realized PnL with commissions:

  • Realized PnL = Unrealized PnL - Closing fee - Holding fee + Funding fee

  • Realized PnL = 4,391.11 - 123.91 - 16.12 + 85.36 = $4,336.44

Example №2

Short Position (Borrowed asset to sell):

  • Initial Investment: $15,000

  • Leverage: 5x

  • Asset: Ethereum (ETH)

  • Entry Price: $3,000 per ETH

  • Current Market Price: $2,800 per ETH

Calculation of the protocol commission when opening a position:

  • Commission for opening a position = Collateral size * Leverage size * 0.12%

  • Commission for opening a position = 15,000 * 5 * 0.0012 = $90

Calculation of unrealized PnL:.

  • Unrealized PnL = (1 - Current Market Price / Entry Price) * (Collateral amount - Opening fee) * Leverage size

  • Unrealized PnL = (1 - 2800 / 3000) * (15 000 - 90) * 5 = 4 970 $

Accounting for commission for holding a position (Rollover fee):

  • We assume that the position holding period was 48 hours:

  • Commission for holding a position = (Collateral Amount - Opening Commission) * 0.0034% * Number of hours

  • Rollover Fee = ((15,000 - 90) * 0.000034 * 48 = $24.33

    Accounting for Funding fees:

  • Assume that the position holding period was 48 hours, and the position volume of those who held Short positions was larger than those who held Long positions, and the average Funding rate was 0.0018%, which was paid by the holders of Short positions. Therefore, this amount will go to us as an expense. Whereas if the market situation was the opposite, we would add this amount to calculate the total return:

  • Funding fee = (Collateral amount - Opening fee) * Leverage size * 0.0018% * Number of hours

  • Rollover Fee = ((15,000 - 90) * 5 * 0.000018 * 48 = $64.41

    Calculation of the protocol commission when closing a position:

  • Closing fee = ((Collateral amount - Opening fee) * Leverage size + Unrealized PnL - Position holding fee - Funding fee)) * 0.12%

  • Commission for closing a position = ((15,000 - 90) * 5 + 4,970 - 24.33 - 64.41) * 0.0012 = $95.31

    Calculation of realized PnL with commissions:

  • Realized PnL = Unrealized PnL - Closing fee - Holding fee - Funding fee

  • Realized PnL = 4,970 - 95.31 - 24.33 - 64.41 = $4,785.95

Last updated