PnL Pool
Any account can call the settlePNL instruction, which will trigger negative P&L accounts to be settled, adding to each per-market P&L pool. Negative P&L being settled increases the amount available to be settled, whilst positive P&L being settled decreases the amount available for settlement.
Calling settlePNL
settlePNLAny account can call the settlePNL instruction. Once called, all unrealised P&L will be settled and added to (or subtracted from) the market's P&L Pool to be made available for withdrawal.
Users with open positions that have negative unrealised P&L will have their unrealised P&L settled and sent to the P&L Pool; however, their position will be unaffected.
As users are settled against, the Cost Basis for their position will be adjusted so that their position remains unchanged even though a portion of their unrealised negative P&L has been realised and sent to the P&L Pool.
The P&L settled as a result of the
settlePNLinstruction will be reflected in theUnrealised P&Ltab, specifically within theRealised P&Lcolumn. The adjusted cost basis for the position is reflected in theCost Basiscolumn.

