Skip to main content
curl -X GET "https://api.polyhush.com/api/v1/trading/pnl" \
     -H "X-API-Key: your-api-key"

Response

total_pnl
number
Total profit/loss (realized + unrealized).
realized_pnl
number
Realized profit/loss from completed trades, settlements, and fees.
unrealized_pnl
number
Unrealized profit/loss from open positions (current price vs average price).
total_buys
number
Total USDC spent on buy orders (all-time).
total_sells
number
Total USDC received from sell orders (all-time).
total_settlements
number
Total USDC received from market settlements and refunds.
total_fees
number
Total fees paid (sell fees + settlement fees).
portfolio_value
number
Current market value of all open positions.
{
  "total_pnl": 12.45,
  "realized_pnl": -45.02,
  "unrealized_pnl": 57.47,
  "total_buys": 1190.10,
  "total_sells": 1035.35,
  "total_settlements": 121.29,
  "total_fees": 11.56,
  "portfolio_value": 102.50
}

How PnL is Calculated

Realized PnL

realized_pnl = (total_sells + total_settlements) - (total_buys + total_fees)
This represents the actual profit or loss from:
  • Selling positions (at higher or lower price than purchased)
  • Market settlements (winning or losing predictions)
  • Minus all fees paid

Unrealized PnL

unrealized_pnl = sum((current_price - average_price) * size) for each open position
This represents the paper profit or loss if you were to sell all open positions at current market prices.

Total PnL

total_pnl = realized_pnl + unrealized_pnl