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.Segment & Lifetime PnL math
Segment & Lifetime PnL math
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.Where:
- is the margin currently backing the position
- is the entry price and is the current mark price
- is the position size
- for a long and for a short
- is the marked value defined above, taken as zero once the position closes
- is all cash credited back to your wallet from the position
- is all cash debited from your wallet for the position (e.g. margin added)
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
- Segment PnL:
- Lifetime PnL:
+$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
- Segment PnL:
- Lifetime PnL:
$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
- Segment PnL:
- Lifetime PnL:
+$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%)