Skip to content

[Bug]: Order placement failed (will retry next iteration): not enough balance / allowance: the balance is not enough #101

@cheukhin1024

Description

@cheukhin1024

SDK package and version

polymarket-client==0.1.0b7

Runtime

Python 3,12

What happened?

Issue:
My account had enough cash before I placed an order. My account was created before v2 upgrade.
I encountered an error while trying to execute a trade using the PolyMarket Python SDK beta:
Order placement failed (will retry next iteration): not enough balance / allowance: the balance is not enough -> balance: 0, order amount: 10000000

I use the limit order:
response = await secure_client.place_limit_order(token_id, side="BUY", price="0.01", size="10")

Minimal reproduction

import os
from polymarket import AsyncSecureClient, RelayerApiKey

secure_client = await AsyncSecureClient.create(
    private_key="<PK>",
    wallet="<wallet address>",
    api_key=RelayerApiKey(
        key="<key>",
        address="<address>",
    ),
)

# Check Gasless Readiness
is_gasless_ready = await secure_client.is_gasless_ready()

# Set Up Gasless Wallet
gasless_client = await secure_client.setup_gasless_wallet()
secure_client = gasless_client

# Set Up Trading Approvals
handle = await secure_client.setup_trading_approvals()
outcome = await handle.wait()

# Place Limit Order
response = await secure_client.place_limit_order(token_id="<token>", side="BUY", price="0.01", size="10")
print(response)

Expected behavior, actual behavior, or logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions