Question

How does Sandwich calculate UPnL and RPnL?

Answer

If this information is available from the exchange via API, Sandwich will display the UPnL and RPnL as reported by the exchange. Otherwise, Sandwich calculates the UPnL by using the Mark Price. If the Mark Price is unavailable, then the Last Price is used.