Anatomy of a Perp · Ch. 10
PnL Accounting
You close the trade up 8% on price and somehow walk away with less than you expected. No one cheated you. While you held the position, three quiet meters were running the whole time.
The Idea
Intuition
Your headline PnL is the easy part: your size times how far the price moved, long or short. That’s Chapter 3, and it’s where most people stop.
But a perp is never just that. Hold a position and meters tick the entire time you’re in it. Funding flows in or out every interval, depending on your side and the skew. Fees come off when you open and again when you close. And if the mark ever crosses your line, a liquidation ends the trade early and takes its cut.
Your realized PnL is all of it added up: the price move, plus every funding payment you received or paid, minus every fee. That’s the number that actually lands in your balance. Everything in this part, funding, mark, liquidation, skew, was a single term in this one equation.
Watch the tally build, then hold the trade longer or flip your side and see it shift.
The Math
How It’s Calculated
In plain terms: take the price move, add up all the funding that flowed while you held, subtract the fees, and if you were liquidated, subtract that fee too. What’s left is what you actually keep.
Realized PnL is the whole ledger:
where is your notional and for a long, for a short.
There are two versions of this number. Unrealized PnL is marked continuously against the mark price (Chapter 7) while the position is open, it moves every tick. Realized PnL is that ledger banked at the moment you close (or are liquidated). The first is what you see; the second is what you keep.
Where this goes
That’s Part II. You can now read a perp end to end: a bet that never expires (Ch5), tethered by funding (Ch6), valued by a mark it can’t fake (Ch7), closed out if the cushion runs dry (Ch8), with the crowd bending the rate (Ch9) and everything settling into one ledger (Ch10). Part III opens the hood: the engines, orderbook, AMM, and oracle, that actually run all of this, and who takes the other side of your trade. Back to contents →