Skip to main content

Segment PnL and Lifetime PnL

Fairground separates a position’s recent performance from its performance over its entire lifecycle. Segment PnL focuses on the period since the position last changed, while Lifetime PnL carries across every change from original position open to full position close. Overall, Segment PnL is best used to understand position performance on a trade-by-trade basis, whereas Lifetime PnL is best used to understand overall position profitability.
A position’s current value is its margin plus unrealized PnL at the current price. This is the value that would be returned to the user if they closed the position at the current price.Vnow=M+σ(PnowPentry)SV_{\mathrm{now}} = M+\sigma\,(P_{\mathrm{now}}-P_{\mathrm{entry}})\,S Where:
  • MM is the margin currently backing the position
  • PentryP_{\mathrm{entry}} is the entry price and PnowP_{\mathrm{now}} is the current mark price
  • SS is the position size
  • σ=+1\sigma=+1 for a long and σ=1\sigma=-1 for a short
Vlast touch+V_{\mathrm{last\ touch}}^+ is what the current value of the position was at the time of the most recent margin or size change (the last “touch”).Segment PnL:SegmentPnL=VnowVlast touch+\mathrm{SegmentPnL} = V_{\mathrm{now}}-V_{\mathrm{last\ touch}}^+ Lifetime PnL:LifetimePnL=Vnow+CoutCin\mathrm{LifetimePnL} = V_{\mathrm{now}}+C_{\mathrm{out}}-C_{\mathrm{in}} Where:
  • VnowV_{\mathrm{now}} is the marked value defined above, taken as zero once the position closes
  • CoutC_{\mathrm{out}} is all cash credited back to your wallet from the position
  • CinC_{\mathrm{in}} is all cash debited from your wallet for the position (e.g. margin added)
Because deposits and withdrawals enter as cash flows (CinC_{\mathrm{in}} and CoutC_{\mathrm{out}}), adding margin alone doesn’t create a profit and removing margin alone doesn’t create a loss.

Segment PnL

Segment PnL is the gain or loss on the current segment of your position. A segment is the stretch of time during which the position hasn’t been interacted with by the trader. A new segment begins whenever you change the position’s margin or size. The first segment begins when the position opens. Later actions can start a new segment:

Lifetime PnL

Lifetime PnL is the total dollar gain or loss across the position’s complete lifecycle. It does not reset when you add or remove margin, increase the position, or partially close it.

Example

Say you open a long with $1,000 of margin at 10× leverage, giving you $10,000 of exposure at an entry price of $100. Your position value, the margin plus any unrealized profit or loss starts at $1,000, the same as your margin. Segment PnL and Lifetime PnL both start at $0.
1

Price rises 2% to $102 → position value $1,200

A 2% price move on 10× leverage is a 20% gain on margin. Unrealized PnL is +$200, lifting position value to $1,200
- Segment PnL: +$200 (+20%)
- Lifetime PnL: +$200 (+20%)
2

Add $300 margin → position value $1,500

Adding margin isn’t a “gain”, so it opens a fresh segment from the new $1,500 baseline and segment PnL resets to $0. The $300 is recorded as cash in, so Lifetime PnL stays at +$200. Your leverage also drops: the same ~$10,000 of exposure now sits on more margin, taking you from 10× to about 6.8×.
- Segment PnL: + $0 (+0%)
- Lifetime PnL: +$200 (+15.4%)
3

Price rises to $105 → position value $1,800

Another +$300 of unrealized profit brings your position value to $1,800
- Segment PnL: +$300 (+20%) measured from the new $1,500 position value
- Lifetime PnL: +$500 (+38.5%).
4

Position is closed at $1,800

$1,300 of margin was placed across the two deposits and $1,800 total was withdrawn
- Segment PnL: +$300 (+20%)
- Lifetime PnL: +$500 (+38.5%)