Skip to content

Bug: signer field set to EOA address instead of deposit wallet when using signature_type=3 (POLY_1271) #49

@yokithaiii

Description

@yokithaiii

When using py-clob-client-v2 v1.0.0 with a deposit wallet (signature_type=3 / POLY_1271), the signer field in the order payload is populated with the EOA address (derived from the private key) instead of the deposit wallet address passed as funder.

According to Polymarket documentation, for POLY_1271 orders both maker and signer must equal the deposit wallet address. As a result, every order placement fails with:

the order signer address has to be the address of the API KEY

Steps to reproduce

from py_clob_client_v2 import ClobClient, OrderArgs, OrderType, PartialCreateOrderOptions, Side

client = ClobClient(
    host="https://clob-v2.polymarket.com",
    chain_id=137,
    key=EOA_PRIVATE_KEY,
    creds=creds,
    funder=DEPOSIT_WALLET_ADDRESS,  # deposit wallet
    signature_type=3,               # POLY_1271
)

order = client.create_order(
    order_args=OrderArgs(token_id="...", price=0.4, side=Side.BUY, size=100),
    options=PartialCreateOrderOptions(tick_size="0.01"),
)

print(order["maker"])   # DEPOSIT_WALLET_ADDRESS  ✅
print(order["signer"])  # EOA_ADDRESS             ❌ — should also be DEPOSIT_WALLET_ADDRESS

Expected behavior

When signature_type=3 and funder is provided, the signer field in the built order should be set to funder (deposit wallet address), not to the EOA address derived from the private key.

Actual behavior

order["signer"] is set to the EOA address. The API rejects the order.

Root cause (suspected)

In OrderBuilder, the signer field of the order struct is populated from self.signer.address (the EOA). For signature_type=3, it should instead use self.funder when a funder address is provided.

Workaround

Manually overwrite the field after building the order:

order["signer"] = DEPOSIT_WALLET_ADDRESS
order["maker"] = DEPOSIT_WALLET_ADDRESS

Environment

  • py-clob-client-v2 version: 1.0.0
  • Python: 3.x
  • Chain: Polygon (137)
  • signature_type: 3 (POLY_1271)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions