How PnL is calculated
The exact accounting SquirtFi uses, including where it refuses to answer.
The inputs
Every figure is built from the position’s own event history, valued with a mark at a specific moment. Which moment depends on the question being asked, and the two are never mixed.
| Term | Definition |
|---|---|
| Cost basis | Each deposit valued at the mark for the block it landed in, summed. |
| Withdrawn value | Each withdrawal valued at the mark for its own block. |
| Fees value | Each fee entry valued at its own block. Fees are already net of principal. |
| Position value | Current principal amounts, derived from tick maths, valued at current marks. |
| Claimable value | Uncollected fees valued at current marks. |
| Gas cost | Gas for every transaction that touched the position, valued at that transaction’s own block time. |
The figures
realizedPnl= withdrawn value + fees value − cost basis of what leftunrealizedPnl= position value + claimable value − cost basis of what remainsgrossPnl= realized + unrealized, before gasnetPnl= gross − gas
Cost basis is per-lot FIFO
Each deposit is a lot. Withdrawals consume the oldest lot first. With a single deposit this is the same as one blended basis; with several deposits at different prices it is the difference between a correct split and a pro-rata guess. The lots are exposed in the interface so a disputed basis can be traced.
The HODL comparison
“Did providing liquidity beat holding” is a different question from “what did I lock in”, so it is computed differently and reported separately.
- Both branches are valued as a terminal value at today’s marks, so the comparison sits at one instant.
hodlValue= every deposit valued at today’s marks.- The LP branch is position value + claimable + withdrawn value at today’s marks + fees at today’s marks.
vsHodlis that difference, minus gas — and is null when gas is unknown.divergenceLossis the same difference with fees taken back out, which isolates the rebalancing effect.
Realized and unrealized PnL deliberately use the mark at each event instead. Mixing a withdrawal valued at its own block with a position valued today compares two different times and is not a benchmark.
Fees are counted exactly once
Fees appear inside the fees and claimable terms, and inside the HODL comparison through those same terms. They are never also added to position value. Corporate-action multipliers live in the price, never in the quantity, so a stock split changes the mark and not the raw balance.
