Description
When using @polymarket/clob-client@5.8.1 with signatureType=2 (GNOSIS_SAFE) and a proxy wallet created via polymarket.com, createAndPostOrder fails with "not enough balance / allowance: the balance is not enough -> balance: 0" on most markets, despite:
getBalanceAllowance({ asset_type: 'COLLATERAL' }) returning correct balance ($8 USDC.e)
- All on-chain approvals confirmed (USDC.e → CTF Exchange, NegRisk Exchange, NegRisk Adapter + ERC1155 setApprovalForAll)
- Valid API credentials derived via
createOrDeriveApiKey()
Reproduction
Setup:
- EOA signer:
0x76a22D91bcb74261EB53354e25CE4F37dDa32934
- Proxy wallet (created via polymarket.com "Enable Trading"):
0x22da6635e16e2f540fbe16d253a89dc8a4674edc
- Proxy wallet holds 8 USDC.e with unlimited approvals to all 3 exchange contracts
signatureType=2, funderAddress=proxyWallet
Code:
const fc = new ClobClient(url, 137, viemWalletClient, creds, 2, proxyWallet);
await fc.updateBalanceAllowance({ asset_type: 'COLLATERAL' });
// This WORKS (WTI Crude Oil market):
await fc.createAndPostOrder(
{ tokenID: '10281909509596543...', price: 0.01, side: 0, size: 1, feeRateBps: 1000 },
{ tickSize: '0.01', negRisk: false }, 'GTC'
);
// → SUCCESS: order placed and matched
// This FAILS (Crypto Up/Down, Sports, etc.):
await fc.createAndPostOrder(
{ tokenID: '60717035396676988...', price: 0.01, side: 0, size: 1, feeRateBps: 1000 },
{ tickSize: '0.01', negRisk: false }, 'GTC'
);
// → {"error":"not enough balance / allowance: balance: 0, order amount: 1000000"}
Key observations
- Same code, same wallet, same params — only the tokenID differs
getBalanceAllowance returns correct balance for both
/neg-risk endpoint returns false for both tokens
- If we force
negRisk: true, we get "invalid signature" instead (tested with both viem WalletClient and ethers v5 Wallet as signer)
- The WTI market (
Will WTI Crude Oil hit $200) is the only market that works
- Sport markets (MLB, NBA, Tennis) and Crypto Up/Down (BTC/ETH/XRP 5min) all fail with
balance: 0
- The web UI (polymarket.com) CAN trade these markets with the same proxy wallet
Questions
- Is there a different exchange contract being used for newer markets that we need to approve?
- Does
getNegRisk() return incorrect values for some markets?
- Is there a known issue with negRisk order signing when using
signatureType=2?
- Are Crypto Up/Down and Sports markets handled differently at the CLOB level?
Environment
@polymarket/clob-client: 5.8.1
- Node.js: 25.2.1
- Signer: tested with both viem
WalletClient and ethers v5 Wallet
- Chain: Polygon PoS (137)
Description
When using
@polymarket/clob-client@5.8.1withsignatureType=2(GNOSIS_SAFE) and a proxy wallet created via polymarket.com,createAndPostOrderfails with"not enough balance / allowance: the balance is not enough -> balance: 0"on most markets, despite:getBalanceAllowance({ asset_type: 'COLLATERAL' })returning correct balance ($8 USDC.e)createOrDeriveApiKey()Reproduction
Setup:
0x76a22D91bcb74261EB53354e25CE4F37dDa329340x22da6635e16e2f540fbe16d253a89dc8a4674edcsignatureType=2,funderAddress=proxyWalletCode:
Key observations
getBalanceAllowancereturns correct balance for both/neg-riskendpoint returnsfalsefor both tokensnegRisk: true, we get"invalid signature"instead (tested with both viem WalletClient and ethers v5 Wallet as signer)Will WTI Crude Oil hit $200) is the only market that worksbalance: 0Questions
getNegRisk()return incorrect values for some markets?signatureType=2?Environment
@polymarket/clob-client: 5.8.1WalletClientand ethers v5Wallet