Get the PnL for a given wallet and token address.
Buy/Sell | Token | Amt | Balance | Price | Avg Cost Calculation | PnL |
---|---|---|---|---|---|---|
Buy | SOL | 50 | 50 | $210 | (50 * $210) / (50) | 0 |
Buy | SOL | 10 | 60 | $200 | (50 * 200) / (50 + 10) | -$500 |
Sell | SOL | 10 | 50 | $220 | 50 * avg cost / 50 = 50 * ((50 * 200) / (50 + 10)) / 50 | $583.50 |
Sell | SOL | 2 | 48 | $220 | 48 * avg cost / 48 = 48 * ((50 * 200) / (50 + 10)) / 48 | $560.16 |
User checking app | 48 | $230 | 48 * $208.33 / 48 | $1040.16 | ||
Buy | SOL | 7 | 55 | $180 | 48 * $208.33 + 7 * 180 / 48 + 7 | -$1359.84 |
User checking app | 55 | $185 | 48 * $208.33 + 7 * 180 / 48 + 7 = 204.72 | -$1084.6 |
The body is of type any[]
.
Successful Response
The response is of type any
.