Skip to main content
GET
/
api
/
workflows
/
polymarket
/
getPnL
Get Profit and Loss
curl --request GET \
  --url https://api-v2.swaps.xyz/api/workflows/polymarket/getPnL \
  --header 'x-api-key: <api-key>'
{
  "currentPositions": 123,
  "closedPositions": 123,
  "allTime": 123
}

Authorizations

x-api-key
string
header
required

API key for authentication. Contact Swaps.xyz to obtain an API key.

Query Parameters

userId
string
required

User EVM EOA address EVM address (0x prefix + 40 hex characters)

Example:

"0x1234567890123456789012345678901234567890"

proxyWallet
string

Polymarket proxy wallet address EVM address (0x prefix + 40 hex characters)

Example:

"0x1234567890123456789012345678901234567890"

Response

Profit and loss summary

currentPositions
number<float>
required

Total PnL from current open positions

closedPositions
number<float>
required

Total PnL from closed positions

allTime
number<float>
required

All-time total PnL