Pnl Calculation

Pear Protocol calculates PnL at the basket/pair level, while Hyperliquid UI calculates PnL at the asset level. Because these models track entry prices differently, the PnL shown in Pear UI may differ from Hyperliquid UI until all related positions are closed.


Pear PnL Model (Pair-Level Accounting)

Pear records the entry price of each asset separately for each basket/pair.

PnL is calculated as:

direction Γ— (exit price βˆ’ pair-specific entry price) Γ— size
βˆ’ builder fee
βˆ’ Hyperliquid fee

Where:

  • direction = +1 for long positions

  • direction = -1 for short positions

  • Pair-specific entry price is the asset’s entry price within that basket/pair only

Each basket/pair maintains its own entry price for the asset, independent of the same asset held in other pairs.


Hyperliquid PnL Model (Asset-Level Accounting)

Hyperliquid aggregates all exposures of the same asset across all pairs and maintains a global average entry price for that asset. Any close uses this global average entry to compute PnL.


Example

A user opens the same asset in four different pairs:

Pair
Size
Entry Price

ASSET/OTHER-ASSET-A

149.47

33.446

ASSET/OTHER-ASSET-B

148.79

33.613

ASSET/OTHER-ASSET-C

147.61

33.879

ASSET/OTHER-ASSET-D

146.93

34.020

Hyperliquid computes a global average entry price:

If the user closes only ASSET/OTHER-ASSET-C at 34.298:

  • Pear uses the pair-specific entry (33.879).

  • Hyperliquid UI uses the global entry (33.74).

Different entry references lead to different displayed PnL for the same close.

Last updated