-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Description
polymarket wallet show derives the proxy wallet address locally via derive_proxy_wallet() (CREATE2), but the derived address does not match the actual proxy wallet assigned by Polymarket's backend.
Steps to Reproduce
-
Import a private key that was used to register on Polymarket web UI:
polymarket wallet import <key> --force -
Check wallet info:
polymarket wallet show -o jsonReturns proxy_address:
0x938C...(locally derived) -
Query the actual profile from Polymarket API:
polymarket profiles get <address> -o jsonReturns proxyWallet:
0x943F...(server-assigned, different) -
Check balance:
polymarket clob balance --asset-type collateral -o jsonReturns
balance: "0"— because it queries the wrong proxy address. -
Meanwhile, querying positions with the correct proxy address works:
polymarket data positions 0x943F... -o jsonReturns actual open positions with correct values.
Root Cause
The CLI uses derive_proxy_wallet(address, chain_id) from the SDK to compute the proxy address via CREATE2. However, accounts created through the Polymarket web UI (e.g., via Magic Link / social login) may have a different proxy wallet assigned by the backend. The locally derived address and the server-assigned address diverge.
Impact
clob balancealways returns 0 (queries wrong proxy)clob create-order/market-ordermay fail or operate on wrong proxy- Any authenticated CLOB command that relies on the derived proxy is broken for these accounts
Suggested Fix
- Query the actual proxy from the API: Use the
profiles getendpoint to fetch the realproxyWalletand cache it, instead of relying solely on local derivation. - Allow config override: Add a
proxy_walletfield toconfig.jsonso users can manually specify their actual proxy address. - Add a CLI flag: e.g.,
--proxy-wallet <address>as a global option.
Environment
- CLI version: v0.1.4
- OS: macOS (arm64)
- Signature type: proxy
- Chain: Polygon (137)