While I can do the calculation with the said formula in the above link by @sujith can you @sujith@rakeshr clarify that the buy/sell value and net qty is always up to date. For eg: I take a new position and cover half of an existing position 1 second back and immediately poll the positions API, the response would contain the latest buy/sell values along with net qty always (hope it is not like last_price) and I can pass on the last_price which would give me the latest PnL?