If you are constantly in a position at @dYdX, adding and reducing to it, then it can be challenging to calculate the realized and unrealized PnL at any given time. I wrote a program to help!