Skip to content

bullpen polymarket unwrap

Last updated: July 13, 2026

Unwrap pUSD back to USDC

Usage

bullpen polymarket unwrap [OPTIONS] <AMOUNT>

Live Help

Unwrap pUSD back to USDC

Usage: bullpen polymarket unwrap [OPTIONS] <AMOUNT>

Arguments:
  <AMOUNT>
          Amount in pUSD to unwrap (e.g. "100" for $100)

Options:
      --output <OUTPUT>
          Output format for command results

          [possible values: table, json]

      --yes
          Skip confirmation prompt

      --env <ENV>
          Target environment to connect to (overrides config.toml)

          [env: BULLPEN_ENV=]
          [possible values: staging, production]

      --preview
          Preview the approve + unwrap relayer batch without signing or submitting

      --config <CONFIG>
          Path to a custom config.toml file (overrides $BULLPEN_CONFIG and the default location).

          Explicit --config and BULLPEN_CONFIG paths fail closed: if the file is missing, the CLI exits validation instead of silently loading defaults. Credentials still resolve via BULLPEN_HOME, so set BULLPEN_HOME too when isolating a session.

      --wallet <WALLET>
          Pin the signer to a specific owner EOA (0x…). Does not override the server-selected Safe/Proxy/Deposit Wallet or bypass 1151 safety checks. Use in bot automation to avoid wallet-select races

      --read-only
          Enable read-only mode: blocks all mutating commands

      --non-interactive
          Suppress interactive prompts; does NOT imply --yes for money-moving commands

          [env: BULLPEN_NON_INTERACTIVE=]

  -h, --help
          Print help (see a summary with '-h')

EXAMPLES:
  # Preview an approve + unwrap relayer batch without signing or submitting
  bullpen polymarket unwrap 10 --preview --output json

  # Unwrap 10 pUSD back to USDC after confirmation is bypassed
  bullpen polymarket unwrap 10 --yes

  # Pin a specific owner EOA for automation and preview the batch
  bullpen polymarket unwrap 10 --wallet 0xYourOwnerEOA --preview

Example Commands

bullpen polymarket unwrap --help
bullpen polymarket unwrap 5 --preview --output json

JSON Output

Contract: JSON Output Contract.

Successful output is a single JSON document. The shape below is representative for this command family; commands may add fields without breaking the shared contract.

Schema version: 1 when a command emits schema_version; otherwise treat the current command shape as contract version 1.

Top-level Keys

Preview (--preview) output:

key type nullable notes
status string no dry-run for --preview responses
operation string no wrap or unwrap
amount string no Human-readable 6-decimal amount
amount_raw string no Raw 6-decimal amount used in calldata
owner_eoa string no Owner EOA controlling the selected Polymarket wallet
source_wallet string no Polymarket wallet that would submit through the relayer
source_wallet_kind string no Server-selected wallet kind
relayer_batch_kind string no safe or wallet
relayer_endpoint string no Polymarket relayer submit endpoint that would be used by the live path
relayer_cost_note string no Gasless/builder-fee preview note
would_submit boolean no Always false for preview output
balance_precondition object no Source-wallet balance snapshot with raw and human-readable amounts
preflight_decision string no ready, need_pre_swap, insufficient, or paused
pre_swap_required string yes Native-USDC pre-swap note for wrap previews
batch array no Planned approve + wrap/unwrap relayer calls; not submitted in preview
warnings array no Non-fatal preview warnings
multi_wallet_warning object yes Machine-readable active-wallet warning when applicable

Example

Example JSON output
bullpen polymarket unwrap 5 --preview --output json
{
  "status": "dry-run",
  "operation": "unwrap",
  "amount": "5.000000",
  "amount_raw": "5000000",
  "owner_eoa": "0x1111111111111111111111111111111111111111",
  "source_wallet": "0x2222222222222222222222222222222222222222",
  "source_wallet_kind": "deposit_wallet",
  "relayer_batch_kind": "wallet",
  "relayer_endpoint": "https://relayer-v2.polymarket.com/submit",
  "relayer_cost_note": "gasless; Bullpen builder fee is HMAC-attached server-side and is not visible in the preview",
  "would_submit": false,
  "balance_precondition": {
    "usdce": "12.345000",
    "usdce_raw": "12345000",
    "native_usdc": "0.000000",
    "native_usdc_raw": "0",
    "pusd": "0.000000",
    "pusd_raw": "0",
    "sufficient": true
  },
  "preflight_decision": "ready",
  "batch": [
    {
      "label": "pUSD.approve(Collateral Offramp)",
      "to": "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB",
      "calldata": "0x095ea7b3...",
      "operation": 0,
      "value": "0"
    },
    {
      "label": "Collateral Offramp.unwrap",
      "to": "0x2957922Eb93258b93368531d39fAcCA3B4dC5854",
      "calldata": "0x...",
      "operation": 0,
      "value": "0"
    }
  ],
  "warnings": [
    "Preview only; no pUSD approval, wrap, unwrap, or relayer transaction was submitted."
  ]
}

Live (--yes --output json) output:

key type nullable notes
status string no unwrapped
kind string no polymarket_unwrap_result
success boolean no true only when receipt status and balance proof are both confirmed
amount string no Human-readable amount submitted
tx_hash string yes On-chain transaction hash retained for compatibility
transaction_hash string yes Alias of tx_hash for stable automation
relayer_trace_id string yes Relayer trace ID for support when present
receipt_status string no confirmed, missing_after_poll, or reverted
verification object no Money-path proof state and details
source_wallet_kind string no safe or deposit_wallet
warnings array no Non-fatal post-flight warnings
multi_wallet_warning object yes Machine-readable active-wallet warning when applicable
Live success JSON output
bullpen polymarket unwrap 5 --yes --output json
{
  "status": "unwrapped",
  "kind": "polymarket_unwrap_result",
  "success": true,
  "amount": "5.00",
  "tx_hash": "0xdef456...",
  "transaction_hash": "0xdef456...",
  "relayer_trace_id": "relayer-trace-id",
  "receipt_status": "confirmed",
  "verification": {
    "state": "confirmed",
    "outcome": "confirmed-success",
    "details": {
      "tx_hash": "0xdef456...",
      "polygonscan_url": "https://polygonscan.com/tx/0xdef456...",
      "receipt_status": "confirmed"
    }
  },
  "source_wallet_kind": "safe",
  "warnings": []
}

Error Envelope

When a Polymarket CLOB or gasless-relayer rejection coincides with a degraded Polymarket status page, the error envelope may include a polymarket_status object:

{
  "polymarket_status": {
    "page_status": "HASISSUES",
    "status_url": "https://status.polymarket.com",
    "affected_components": [
      {"name": "CLOB API", "status": "PARTIALOUTAGE"}
    ],
    "advisory": "Polymarket is experiencing issues; this rejection is most likely a Polymarket-side outage."
  }
}

The field is omitted on local validation/auth/balance errors and when the status-page fetch times out or reports healthy relevant components.

Stability

Patch releases may add nullable or optional fields. Minor releases may add required fields or increment schema_version. Major releases may remove or rename fields.