Skip to content

[Feature]: How can I create a tradable account from only a private key when AsyncSecureClient requires RelayerApiKey? #108

Description

@hanju

What would you like the SDK to support?

Hi,

I'm trying to understand the account initialization flow for the new SDK.

My goal is to bootstrap a completely new trading account using only a Polygon private key.

The documentation shows:

secure_client = await AsyncSecureClient.create(
    private_key=PRIVATE_KEY,
    api_key=RelayerApiKey(
        key=POLYMARKET_RELAYER_API_KEY,
        address=POLYMARKET_RELAYER_API_KEY_ADDRESS,
    ),
)

await secure_client.setup_trading_approvals()

However, it's unclear to me:

  1. What exactly is POLYMARKET_RELAYER_API_KEY_ADDRESS?
  • Is it the deposit wallet address?
  • The EOA address?
  • An address associated with the relayer API key?
  1. How can a brand-new user obtain POLYMARKET_RELAYER_API_KEY and POLYMARKET_RELAYER_API_KEY_ADDRESS?
  2. Is there an SDK method that creates these automatically from a private key?
  3. Is it possible to bootstrap a fully tradable account using only a private key, or must the account first be initialized through the Polymarket web application?

I can already see a Relayer API Key in my Polymarket account settings, but I don't see any value corresponding to POLYMARKET_RELAYER_API_KEY_ADDRESS.

Could someone clarify the expected onboarding flow?

Thanks!

Why do you need this?

I'm building an automated trading system on top of the new Polymarket SDK.

The expected onboarding flow for my application is:

  1. A user provides only a Polygon private key.
  2. The SDK initializes everything required for trading.
  3. The application can perform trading approvals.
  4. The application can start placing orders.

However, the documentation examples require:

RelayerApiKey(
    key=POLYMARKET_RELAYER_API_KEY,
    address=POLYMARKET_RELAYER_API_KEY_ADDRESS,
)

### Example API or additional context

```python

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