Skip to main content
GET
/
api
/
workflows
/
polymarket
/
getClosedPositions
Get Closed Positions
curl --request GET \
  --url https://api-v2.swaps.xyz/api/workflows/polymarket/getClosedPositions \
  --header 'x-api-key: <api-key>'
[
  {
    "proxyWallet": "0x56687bf447db6ffa42ffe2204a05edaa20f55839",
    "asset": "<string>",
    "conditionId": "0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917",
    "avgPrice": 123,
    "totalBought": 123,
    "realizedPnl": 123,
    "curPrice": 123,
    "timestamp": 123,
    "title": "<string>",
    "slug": "<string>",
    "icon": "<string>",
    "eventSlug": "<string>",
    "outcome": "<string>",
    "outcomeIndex": 123,
    "oppositeOutcome": "<string>",
    "oppositeAsset": "<string>",
    "endDate": "<string>"
  }
]

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

Array of closed positions

proxyWallet
string
required

Proxy wallet address

Example:

"0x56687bf447db6ffa42ffe2204a05edaa20f55839"

asset
string
required

Asset token ID

conditionId
string
required

Condition ID (0x-prefixed 64-hex string)

Example:

"0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917"

avgPrice
number<float>
required

Average purchase price

totalBought
number<float>
required

Total amount bought

realizedPnl
number<float>
required

Realized profit/loss

curPrice
number<float>
required

Current price

timestamp
integer<int64>
required

Unix timestamp

title
string
required

Market title

slug
string
required

Market slug

icon
string
required

Market icon URL

eventSlug
string
required

Event slug

outcome
string
required

Outcome name

outcomeIndex
integer
required

Outcome index

oppositeOutcome
string
required

Opposite outcome name

oppositeAsset
string
required

Opposite asset token ID

endDate
string
required

Market end date