Skip to main content
POST
/
v2
/
redeem-all
curl -X POST https://api.pmx.trade/v2/redeem-all \
  -H "Content-Type: application/json" \
  -d '{
    "wallet": "7xKXabc123..."
  }'
{
  "success": true,
  "data": {
    "transactions": [
      {
        "marketId": 5,
        "side": "YES",
        "transaction": "AQAAAAAAA...base64..."
      },
      {
        "marketId": 12,
        "side": "NO",
        "transaction": "BQAAAAAAA...base64..."
      }
    ],
    "skipped": [
      { "marketId": 8, "reason": "status_active" },
      { "marketId": 10, "reason": "YES_is_losing_side" }
    ],
    "message": "2 redemption transaction(s) to sign. 2 skipped."
  }
}
Scans the wallet’s token holdings and builds redemption transactions for every resolved market where the wallet holds winning tokens. Returns all transactions in a single response — sign and submit each one. This endpoint only builds transactions for positions where the wallet holds tokens on the winning side. Losing-side tokens and already-redeemed positions are automatically skipped.

Request body

wallet
string
required
Solana wallet address to redeem all positions for.

Response

success
boolean
data
object
curl -X POST https://api.pmx.trade/v2/redeem-all \
  -H "Content-Type: application/json" \
  -d '{
    "wallet": "7xKXabc123..."
  }'
{
  "success": true,
  "data": {
    "transactions": [
      {
        "marketId": 5,
        "side": "YES",
        "transaction": "AQAAAAAAA...base64..."
      },
      {
        "marketId": 12,
        "side": "NO",
        "transaction": "BQAAAAAAA...base64..."
      }
    ],
    "skipped": [
      { "marketId": 8, "reason": "status_active" },
      { "marketId": 10, "reason": "YES_is_losing_side" }
    ],
    "message": "2 redemption transaction(s) to sign. 2 skipped."
  }
}
This endpoint scans the wallet’s token accounts directly (single RPC call), then matches tokens to market mint PDAs. It only builds transactions for markets where the wallet holds winning-side tokens with non-zero balances. This is much faster than calling /v2/markets/:id/redeem for each market individually.