PnL And Total Account Value
PnL (Profit and Loss)
Unrealized PnL represents the potential gain or loss an account would incur by closing all its open positions. It is calculated based on the difference between the average entry price of the positions and the current mark price.
Let be the current position size of an account. is positive if the account position is long and negative if it is short. The unrealized PnL of the account can be calculated as:
Realized PnL is the gain / loss that has already been captured from the position after closing or due to funding payments. It is calculated based on the difference in USDC value between your average entry price and exit price. Additionally, all funding payments for the position are immediately applied to its realized PNL.
When the user is closing a portion of an existing long or short position, average entry price stays the same and exchange realizes the difference in average exit and entry prices.
When the user is increasing the size of their open position, no PnL is realized. Exchange updates the average entry price according to the following formula
Total Account Value
Total Account Value represents the total USDC value of an account in Lighter, including all open positions and collateral. It is calculated as follows:
Last updated