Profit and loss is based on an average price model. Every trade that contributes to a current position is used to calculate the average price. This is then compared to the current Mark Price in order to determine the current unrealised P&L. As such, if the position were to be completely closed at the Mark Price, the unrealised P&L would become realized P&L, less any applicable trading fees.