> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gte.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# PnL and Account Value

* **Current Notional** equals your position size multiplied by the current mark price.
* **Open Notional** represents the total cost you've paid to build your position.
* **PnL** is the difference between your current position value and what you paid for it.
* **Account Value** combines all your assets plus PnL minus fees to give you your total account worth.

For long positions:

```
pnl = currentNotional - position.openNotional
```

For short positions:

```
pnl = position.openNotional - currentNotional
```

The `openNotional` is the **total cost** you've paid to build your position. This includes all the trades you've made to increase your position size.

When you add to an existing position, the openNotional increases by the amount you just traded:

```
position.openNotional += quoteTraded
```

When you reduce a position, the openNotional decreases proportionally:

```
position.openNotional = position.openNotional × (remainingSize / originalSize)
```

Your account value is the sum of all your assets and PnL:

```
accountValue = margin + totalPnL + fundingPayments + fees
```

**Margin** represents your deposited collateral that you've put into the account. **Total PnL** is the sum of all your position PnL across all open positions. **Funding Payments** are the net funding you've received or paid to other traders. **Fees** represent the net trading fees you've paid to the protocol.

## Realized vs. Unrealized PnL

**Unrealized PnL** represents PnL on open positions that hasn't been locked in yet. It changes every time the mark price moves, which means it can disappear if the price moves against you before you close the position.

**Realized PnL** is PnL that's been locked in by closing positions. It gets added to your account when you close a position or reduce its size, and once realized is added to your account balance.
