get_balance_allowance() is the py-clob-client-v2 method that returns your pUSD balance and token spending allowance on Polymarket. It tells you how much you can trade and whether your wallet has the required approvals. This page covers get_balance_allowance() (and update_balance_allowance()), including parameters, return types, wei conversion, and pre-trade validation patterns.

⚠️ CLOB V2 (live April 28, 2026). Two things changed for balances: (1) collateral migrated from USDC.e to pUSD (an ERC-20 backed 1:1 by USDC), and (2) the standalone get_balance() method was removed — use get_balance_allowance() instead. The package is py-clob-client-v2 (from py_clob_client_v2 import ...); the V1 py-clob-client no longer works on production. See Migrating to CLOB V2.

For the complete V2 method reference, see the py-clob-client-v2 Reference. For Kalshi’s equivalent balance endpoint, see the Prediction Market API Reference.


get_balance_allowance() Method

Signature

client.get_balance_allowance(params: BalanceAllowanceParams = None) -> dict

Parameters

ParameterTypeRequiredDescription
paramsBalanceAllowanceParamsNoSpecifies which asset to query

BalanceAllowanceParams fields:

FieldTypeDescription
asset_typeAssetTypeAssetType.COLLATERAL for pUSD, or AssetType.CONDITIONAL for outcome tokens
token_idstrRequired when asset_type is CONDITIONAL — the specific outcome token ID
signature_typeintOptional — override the client’s signature type for this lookup (default -1)

Return Type

A dictionary with the following fields:

FieldTypeDescription
balancestrBalance in wei (1 pUSD = 10^6 wei)
allowancestrToken spending allowance in wei

Authentication required: Yes. You must call set_api_creds() before using this method.


Check pUSD Balance and Allowance

The most common use case — check how much pUSD you have available and whether trading is approved:

from py_clob_client_v2 import ClobClient, BalanceAllowanceParams, AssetType

client = ClobClient(
    host="https://clob.polymarket.com",
    chain_id=137,
    key="<your-private-key>",
)
client.set_api_creds(client.create_or_derive_api_key())

result = client.get_balance_allowance(
    BalanceAllowanceParams(asset_type=AssetType.COLLATERAL)
)

balance_pusd = int(result["balance"]) / 1e6
allowance_pusd = int(result["allowance"]) / 1e6

print(f"Balance:   {balance_pusd:.2f} pUSD")
print(f"Allowance: {allowance_pusd:.2f} pUSD")

Example output:

Balance:   1250.00 pUSD
Allowance: 115792089237316195423570985008687907853269984665640564039457584007913129639935.00 pUSD

A very large allowance value (the uint256 max) means unlimited approval is set — this is normal and expected after running the approval transaction.


Check Conditional Token Balance

Query how many YES or NO shares you hold for a specific outcome:

from py_clob_client_v2 import BalanceAllowanceParams, AssetType

result = client.get_balance_allowance(
    BalanceAllowanceParams(
        asset_type=AssetType.CONDITIONAL,
        token_id="<outcome-token-id>"
    )
)

token_balance = int(result["balance"]) / 1e6
print(f"Token balance: {token_balance:.2f} shares")
print(f"Token allowance: {result['allowance']}")

get_balance() — Removed in V2

There is no client.get_balance() method in CLOB V2. The standalone balance method was removed; get_balance_allowance() (above) is the single way to read your balance. If you’re porting V1 code:

# V1 (no longer works):
# balance_wei = client.get_balance()

# V2 equivalent:
result = client.get_balance_allowance(
    BalanceAllowanceParams(asset_type=AssetType.COLLATERAL)
)
balance_pusd = int(result["balance"]) / 1e6
print(f"Balance: {balance_pusd:.2f} pUSD")

Refresh the Cached Value: update_balance_allowance()

After an on-chain deposit or approval, the CLOB may not reflect the change immediately. Call update_balance_allowance() with the same params to force a refresh:

client.update_balance_allowance(
    BalanceAllowanceParams(asset_type=AssetType.COLLATERAL)
)

When to Use Each Method

ScenarioUseWhy
Read your pUSD balanceget_balance_allowance()The only balance method in V2 (get_balance() is gone)
Verify trading approvals are setget_balance_allowance()Returns allowance — essential for EOA wallets
Check outcome token holdingsget_balance_allowance()Pass AssetType.CONDITIONAL with a token_id
After a deposit/approvalupdate_balance_allowance()Forces the CLOB to re-read on-chain state

Pre-Trade Balance Validation

A production pattern for validating funds before placing an order:

from py_clob_client_v2 import (
    ClobClient, BalanceAllowanceParams, AssetType,
    OrderArgs, OrderType, PartialCreateOrderOptions, Side,
)

def validate_and_place_order(client, token_id, price, size):
    """Check balance and allowance before placing a limit order."""

    # Step 1: Check pUSD balance and allowance
    result = client.get_balance_allowance(
        BalanceAllowanceParams(asset_type=AssetType.COLLATERAL)
    )

    balance_pusd = int(result["balance"]) / 1e6
    allowance_pusd = int(result["allowance"]) / 1e6
    order_cost = price * size

    # Step 2: Validate sufficient balance
    if balance_pusd < order_cost:
        print(f"Insufficient balance: {balance_pusd:.2f} pUSD "
              f"< order cost {order_cost:.2f} pUSD")
        return None

    # Step 3: Validate sufficient allowance
    if allowance_pusd < order_cost:
        print(f"Insufficient allowance: {allowance_pusd:.2f} pUSD. "
              f"Run approval transaction first.")
        return None

    # Step 4: Place the order
    response = client.create_and_post_order(
        order_args=OrderArgs(token_id=token_id, price=price, size=size, side=Side.BUY),
        options=PartialCreateOrderOptions(tick_size="0.01"),
        order_type=OrderType.GTC,
    )

    print(f"Order placed: {response['orderID']}")
    print(f"Remaining balance: {balance_pusd - order_cost:.2f} pUSD")
    return response

# Usage
client = ClobClient(
    host="https://clob.polymarket.com",
    chain_id=137,
    key="<your-private-key>",
)
client.set_api_creds(client.create_or_derive_api_key())

validate_and_place_order(client, "<token-id>", price=0.45, size=100)

Wei Conversion Reference

Polymarket returns all balances in wei (micro-pUSD). pUSD uses 6 decimals, same as USDC.e did — so the conversion is unchanged:

Wei ValuepUSD Amount
"1000000"1.00 pUSD
"500000"0.50 pUSD
"100000000"100.00 pUSD
"1250000000"1,250.00 pUSD

Conversion formula:

# Wei to pUSD
balance_pusd = int(balance_wei) / 1e6

# pUSD to wei
balance_wei = int(balance_pusd * 1e6)

Common pitfall: Forgetting the wei conversion is the most frequent source of bugs with balance methods. A balance of "1000000" is 1 pUSD, not 1 million pUSD.


Common Errors

ErrorCauseFix
AttributeError: get_balanceCalling the removed V1 methodUse get_balance_allowance(BalanceAllowanceParams(asset_type=AssetType.COLLATERAL))
UNAUTHORIZED or 403API credentials not setCall client.set_api_creds(client.create_or_derive_api_key()) first
KeyError: 'balance'Unexpected response formatCheck that authentication succeeded — unauthenticated calls return different responses
Balance is "0" but you have fundsWrong wallet type or funder addressVerify signature_type (0 = EOA, 1 = POLY_PROXY, 2 = GNOSIS_SAFE, 3 = POLY_1271) and funder. Also confirm you’ve wrapped USDC.e → pUSD
Allowance is "0"Token approval not setApprove the V2 Exchange contracts on-chain (EOA only), then update_balance_allowance()
ConnectionErrorAPI unreachableRetry with backoff. See the Rate Limits Guide

See Also


{{ partial “marketplace-cta.html” . }}


This reference is maintained by AgentBets.ai. Found an error or SDK change we missed? Let us know on Twitter.

Not financial advice. Built for builders.