> ## Documentation Index
> Fetch the complete documentation index at: https://docs.predexon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collateral Playground

> pUSD wrap/unwrap events (V2). Tracks deposits and withdrawals of the V2 trading collateral.



## AsyncAPI

````yaml websocket/asyncapi.json collateral
id: collateral
title: Collateral
description: >-
  pUSD wrap/unwrap events (V2). Tracks deposits and withdrawals of the V2
  trading collateral.
servers:
  - id: production
    protocol: wss
    host: wss.predexon.com
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations:
  - &ref_1
    id: sendSubscribeCollateral
    title: Send subscribe collateral
    type: receive
    messages:
      - &ref_6
        id: SubscribeCollateral
        payload:
          - name: Subscribe to Collateral
            description: >-
              Subscribe to pUSD wrap/unwrap events (V2 deposits and
              withdrawals). Only users filter or wildcard supported.
            type: object
            properties:
              - name: action
                type: string
                description: Must be 'subscribe'
                required: true
              - name: platform
                type: string
                description: Must be 'polymarket'
                required: true
              - name: version
                type: integer
                description: Must be 1
                required: true
              - name: type
                type: string
                description: Must be 'collateral'
                required: true
              - name: filters
                type: object
                description: Only 'users' filter supported. Use ["*"] for wildcard.
                required: true
                properties:
                  - name: users
                    type: array
                    description: Wallet addresses or ["*"]
                    required: false
                    properties:
                      - name: item
                        type: string
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - action
            - platform
            - version
            - type
            - filters
          properties:
            action:
              type: string
              description: Must be 'subscribe'
              x-parser-schema-id: <anonymous-schema-250>
            platform:
              type: string
              description: Must be 'polymarket'
              x-parser-schema-id: <anonymous-schema-251>
            version:
              type: integer
              description: Must be 1
              x-parser-schema-id: <anonymous-schema-252>
            type:
              type: string
              description: Must be 'collateral'
              x-parser-schema-id: <anonymous-schema-253>
            filters:
              type: object
              description: Only 'users' filter supported. Use ["*"] for wildcard.
              properties:
                users:
                  type: array
                  description: Wallet addresses or ["*"]
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-256>
                  x-parser-schema-id: <anonymous-schema-255>
              x-parser-schema-id: <anonymous-schema-254>
          examples:
            - action: subscribe
              platform: polymarket
              version: 1
              type: collateral
              filters:
                users:
                  - 0x3b27d0fb...
          x-parser-schema-id: <anonymous-schema-249>
        title: Subscribe to Collateral
        description: >-
          Subscribe to pUSD wrap/unwrap events (V2 deposits and withdrawals).
          Only users filter or wildcard supported.
        example: |-
          {
            "action": "subscribe",
            "platform": "polymarket",
            "version": 1,
            "type": "collateral",
            "filters": {
              "users": [
                "0x3b27d0fb..."
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: SubscribeCollateral
          - id: x-parser-message-name
            value: SubscribeCollateral
    bindings: []
    extensions: &ref_0
      - id: x-mint
        value: &ref_11
          content: >-
            <Warning>WebSocket requires a **Dev** or **Pro** API key. Free tier
            keys cannot connect. [Get your key
            →](https://dashboard.predexon.com)</Warning>
      - id: x-parser-unique-object-id
        value: collateral
  - &ref_2
    id: sendUnsubscribeCollateral
    title: Send unsubscribe collateral
    type: receive
    messages:
      - &ref_7
        id: Unsubscribe
        payload:
          - name: Unsubscribe
            description: Remove a subscription by ID.
            type: object
            properties:
              - name: action
                type: string
                description: Must be 'unsubscribe'
                required: true
              - name: subscription_id
                type: string
                description: Subscription ID from the ack response (e.g. sub_2f4b15b33798)
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - action
            - subscription_id
          properties:
            action:
              type: string
              description: Must be 'unsubscribe'
              x-parser-schema-id: <anonymous-schema-15>
            subscription_id:
              type: string
              description: Subscription ID from the ack response (e.g. sub_2f4b15b33798)
              x-parser-schema-id: <anonymous-schema-16>
          examples:
            - action: unsubscribe
              subscription_id: sub_2f4b15b33798
          x-parser-schema-id: <anonymous-schema-14>
        title: Unsubscribe
        description: Remove a subscription by ID.
        example: |-
          {
            "action": "unsubscribe",
            "subscription_id": "sub_2f4b15b33798"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: Unsubscribe
          - id: x-parser-message-name
            value: Unsubscribe
    bindings: []
    extensions: *ref_0
  - &ref_3
    id: sendUpdateCollateral
    title: Send update collateral
    type: receive
    messages:
      - &ref_8
        id: Update
        payload:
          - name: Update Subscription
            description: >-
              Replace filters on an existing subscription. Not supported on the
              orderbook channel.
            type: object
            properties:
              - name: action
                type: string
                description: Must be 'update'
                required: true
              - name: subscription_id
                type: string
                description: Subscription ID to update
                required: true
              - name: filters
                type: object
                description: New filters (replaces existing filters entirely)
                required: true
                properties:
                  - name: users
                    type: array
                    description: Wallet addresses
                    required: false
                    properties:
                      - name: item
                        type: string
                        required: false
                  - name: condition_ids
                    type: array
                    description: Market condition IDs
                    required: false
                    properties:
                      - name: item
                        type: string
                        required: false
                  - name: market_slugs
                    type: array
                    description: Market URL slugs
                    required: false
                    properties:
                      - name: item
                        type: string
                        required: false
                  - name: status
                    type: string
                    description: confirmed, pending, or all (orders channel only)
                    enumValues:
                      - confirmed
                      - pending
                      - all
                    required: false
                  - name: token_ids
                    type: array
                    description: CLOB token IDs (orderbook channel only)
                    required: false
                    properties:
                      - name: item
                        type: string
                        required: false
                  - name: feeds
                    type: array
                    description: Chainlink crypto feed symbols (crypto_prices channel only)
                    required: false
                    properties:
                      - name: item
                        type: string
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - action
            - subscription_id
            - filters
          properties:
            action:
              type: string
              description: Must be 'update'
              x-parser-schema-id: <anonymous-schema-18>
            subscription_id:
              type: string
              description: Subscription ID to update
              x-parser-schema-id: <anonymous-schema-19>
            filters:
              type: object
              description: New filters (replaces existing filters entirely)
              properties:
                users:
                  type: array
                  description: Wallet addresses
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-22>
                  x-parser-schema-id: <anonymous-schema-21>
                condition_ids:
                  type: array
                  description: Market condition IDs
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-24>
                  x-parser-schema-id: <anonymous-schema-23>
                market_slugs:
                  type: array
                  description: Market URL slugs
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-26>
                  x-parser-schema-id: <anonymous-schema-25>
                status:
                  type: string
                  description: confirmed, pending, or all (orders channel only)
                  enum:
                    - confirmed
                    - pending
                    - all
                  x-parser-schema-id: <anonymous-schema-27>
                token_ids:
                  type: array
                  description: CLOB token IDs (orderbook channel only)
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-29>
                  x-parser-schema-id: <anonymous-schema-28>
                feeds:
                  type: array
                  description: Chainlink crypto feed symbols (crypto_prices channel only)
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-31>
                  x-parser-schema-id: <anonymous-schema-30>
              x-parser-schema-id: <anonymous-schema-20>
          examples:
            - action: update
              subscription_id: sub_2f4b15b33798
              filters:
                users:
                  - 0xnew_address...
                status: all
          x-parser-schema-id: <anonymous-schema-17>
        title: Update Subscription
        description: >-
          Replace filters on an existing subscription. Not supported on the
          orderbook channel.
        example: |-
          {
            "action": "update",
            "subscription_id": "sub_2f4b15b33798",
            "filters": {
              "users": [
                "0xnew_address..."
              ],
              "status": "all"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: Update
          - id: x-parser-message-name
            value: Update
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: receiveAckCollateral
    title: Receive ack collateral
    type: send
    messages:
      - &ref_9
        id: Ack
        payload:
          - name: Acknowledgement
            description: >-
              Server acknowledgement for subscribe, unsubscribe, and update
              actions.
            type: object
            properties:
              - name: type
                type: string
                description: ack
                required: true
              - name: subscription_id
                type: string
                description: The subscription ID
                required: true
              - name: channel
                type: string
                description: >-
                  Channel name (trades, activity, lifecycle, orderbook, oracle,
                  collateral, crypto_prices)
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              description: ack
              x-parser-schema-id: <anonymous-schema-33>
            subscription_id:
              type: string
              description: The subscription ID
              x-parser-schema-id: <anonymous-schema-34>
            channel:
              type: string
              description: >-
                Channel name (trades, activity, lifecycle, orderbook, oracle,
                collateral, crypto_prices)
              x-parser-schema-id: <anonymous-schema-35>
          required:
            - type
            - subscription_id
            - channel
          examples:
            - type: ack
              subscription_id: sub_2f4b15b33798
              channel: trades
          x-parser-schema-id: <anonymous-schema-32>
        title: Acknowledgement
        description: Server acknowledgement for subscribe, unsubscribe, and update actions.
        example: |-
          {
            "type": "ack",
            "subscription_id": "sub_2f4b15b33798",
            "channel": "trades"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: Ack
          - id: x-parser-message-name
            value: Ack
    bindings: []
    extensions: *ref_0
  - &ref_5
    id: receiveCollateralEvent
    title: Receive collateral event
    type: send
    messages:
      - &ref_10
        id: CollateralEvent
        payload:
          - name: Collateral Event
            description: pUSD wrap (deposit) or unwrap (withdrawal) event. V2 only.
            type: object
            properties:
              - name: event_type
                type: string
                description: polyusd_wrapped (deposit) or polyusd_unwrapped (withdrawal)
                enumValues:
                  - polyusd_wrapped
                  - polyusd_unwrapped
                required: true
              - name: user
                type: string
                description: End-recipient of the operation
                required: true
              - name: asset
                type: string
                description: Underlying ERC-20 address (typically USDC.e)
                required: true
              - name: amount
                type: integer
                description: Raw amount (6 decimals, same as USDC)
                required: true
              - name: amount_normalized
                type: number
                description: Human-readable amount
                required: true
              - name: tx_hash
                type: string
                description: Transaction hash
                required: true
              - name: log_index
                type: string
                description: Log index (hex)
                required: true
              - name: block_number
                type: string
                description: Block number (hex)
                required: true
              - name: timestamp
                type: integer
                description: Unix timestamp in seconds
                required: true
              - name: version
                type: integer
                description: Always 2
                enumValues:
                  - 2
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            event_type:
              type: string
              description: polyusd_wrapped (deposit) or polyusd_unwrapped (withdrawal)
              enum:
                - polyusd_wrapped
                - polyusd_unwrapped
              x-parser-schema-id: <anonymous-schema-258>
            user:
              type: string
              description: End-recipient of the operation
              x-parser-schema-id: <anonymous-schema-259>
            asset:
              type: string
              description: Underlying ERC-20 address (typically USDC.e)
              x-parser-schema-id: <anonymous-schema-260>
            amount:
              type: integer
              description: Raw amount (6 decimals, same as USDC)
              x-parser-schema-id: <anonymous-schema-261>
            amount_normalized:
              type: number
              description: Human-readable amount
              x-parser-schema-id: <anonymous-schema-262>
            tx_hash:
              type: string
              description: Transaction hash
              x-parser-schema-id: <anonymous-schema-263>
            log_index:
              type: string
              description: Log index (hex)
              x-parser-schema-id: <anonymous-schema-264>
            block_number:
              type: string
              description: Block number (hex)
              x-parser-schema-id: <anonymous-schema-265>
            timestamp:
              type: integer
              description: Unix timestamp in seconds
              x-parser-schema-id: <anonymous-schema-266>
            version:
              type: integer
              description: Always 2
              enum:
                - 2
              x-parser-schema-id: <anonymous-schema-267>
          required:
            - event_type
            - user
            - asset
            - amount
            - amount_normalized
            - tx_hash
            - log_index
            - block_number
            - timestamp
            - version
          examples:
            - event_type: polyusd_wrapped
              user: 0x3b27d0fb...
              asset: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
              amount: 45000000
              amount_normalized: 45
              tx_hash: 0xabc...
              log_index: '0x9ed'
              block_number: '0x51c9418'
              timestamp: 1776638042
              version: 2
          x-parser-schema-id: <anonymous-schema-257>
        title: Collateral Event
        description: pUSD wrap (deposit) or unwrap (withdrawal) event. V2 only.
        example: |-
          {
            "event_type": "polyusd_wrapped",
            "user": "0x3b27d0fb...",
            "asset": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
            "amount": 45000000,
            "amount_normalized": 45,
            "tx_hash": "0xabc...",
            "log_index": "0x9ed",
            "block_number": "0x51c9418",
            "timestamp": 1776638042,
            "version": 2
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: CollateralEvent
          - id: x-parser-message-name
            value: CollateralEvent
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
  - *ref_3
receiveOperations:
  - *ref_4
  - *ref_5
sendMessages:
  - *ref_6
  - *ref_7
  - *ref_8
receiveMessages:
  - *ref_9
  - *ref_10
extensions:
  - id: x-mint
    value: *ref_11
  - id: x-parser-unique-object-id
    value: collateral
securitySchemes:
  - id: apiKey
    name: api_key
    type: httpApiKey
    description: Your Predexon API key
    in: query
    extensions: []

````