Skip to main content
Start by identifying the account’s wallet type. You can then connect an existing Polymarket account or create new accounts for your users.

Wallet Types

A Deposit Wallet is the default smart wallet for trading on Polymarket. Your wallet type depends on how and when the account wallet was created.

Connect Your Account

Connect an existing polymarket.com account to trade with its funds and positions. Copy the account wallet address from the profile menu:
Polymarket profile menu showing the account wallet address on mobile
Create a Relayer API key under polymarket.com → Settings → API Keys → Relayer API Keys:
Creating a Relayer API key from Polymarket settings
This key authorizes gasless wallet operations for the account. Copy the Signer Address and API Key shown after creation.
With the wallet address and Relayer API key ready, connect the account with createSecureClient.
1

Create a Secure Client

First, provide the signer and account wallet. Include the Relayer API key to authorize gasless wallet operations.
This example uses Viem with a private key. See Wallet Integrations to connect a signer from another supported wallet library.
2

Inspect the Account

Then, inspect the resolved account identity and wallet type.client.account contains the signer, account wallet, and wallet type for the session.
That’s it—you have connected your account.

Create New Accounts

Create a polymarket.com account to serve as your builder account. It represents your integration and owns the builder profile and API credentials used to create Deposit Wallets for your users. Each wallet remains controlled by its signer. In the builder account, open polymarket.com → Settings → Builders and create an API key:
Open Settings, select Builders, and create a Builder API key
Copy the generated Builder API key, secret, and passphrase
Copy the API Key, Secret, and Passphrase shown after creation.
Builder API credentials are secrets. Keep them on your server, and never expose or share them.
With the Builder API key ready, create the new account with createSecureClient.
1

Create a Deposit Wallet

First, create a SecureClient with the signer and Builder API key. The SDK derives the signer’s Deposit Wallet address and deploys the wallet automatically.
This example uses Viem with a private key. See Wallet Integrations to connect a signer from another supported wallet library.
2

Inspect the Account

Then, inspect the resolved account identity and wallet type.client.account contains the signer, account wallet, and wallet type for the session.
That’s it—you have created the new account.

Execute Gasless Transactions

Approve token spending, transfer funds, and manage positions from the account wallet without paying gas.
SecureClient provides named methods for supported wallet actions. Each method returns a TransactionHandle; call .wait() to wait for the action to settle.Create a SecureClient with either a Relayer or Builder API key:
Use the method that matches the wallet action you want to perform:Approve ERC-20 spendingSet an allowance for a contract to spend an ERC-20 token from the account wallet. Pass "max" to approve the maximum amount.
Approve an ERC-1155 operatorAllow an operator to manage every ERC-1155 token held by the account wallet. Set approved to false to revoke access.
Transfer ERC-20 tokensTransfer an ERC-20 token from the account wallet. amount is expressed in the token’s base units.

Set Up Trading Approvals

Set up the ERC-20 and ERC-1155 approvals that allow Polymarket’s exchange contracts to spend the account wallet’s pUSD and Conditional Tokens when placing orders. For Deposit Wallets, Safe Wallets, and Proxy Wallets, these approvals are submitted as a gasless transaction.
Create a SecureClient with either a Relayer or Builder API key:
Call setupTradingApprovals() to configure the required allowances:
The method checks existing approvals and submits only what is missing, so it is safe to call more than once.Order placement can recover from missing allowances automatically. Setting them up in advance keeps that work out of your first order.

Advanced Options

Explore additional wallet and authentication patterns for advanced integrations.

Derive a Deposit Wallet Address

If you need to compute a Deposit Wallet address before deployment, use the deterministic derivation algorithm below.
Deposit Wallets deployed before the June 29, 2026 upgrade use a UUPS proxy. Deposit Wallets deployed after the upgrade use a beacon proxy. The following algorithm derives the address for a new Deposit Wallet with a beacon proxy.
See Contract Addresses for the current Deposit Wallet factory and beacon.

Set Up EOA Trading

If your EOA is allowlisted for trading, use it as the account wallet. Every onchain action—including token approvals, ERC-20 transfers, splits, merges, and redemptions—is submitted directly from the EOA and requires POL for gas.
Pass the signer address as wallet. The SDK identifies the account as an EOA and skips Deposit Wallet deployment.
Methods such as approveErc20(), approveErc1155ForAll(), transferErc20(), and the position lifecycle methods submit transactions directly from the signer. For example, set up every required trading approval:

Remote Builder Signing

Remote Builder Signing keeps Builder API credentials on your server while a TypeScript client requests signed headers for Builder-authenticated actions.
1

Create a Signing Endpoint

Authenticate and authorize the caller on your server, then sign the request details supplied by the client.
2

Connect the Client

Pass the user’s signer and the signing endpoint to the client. Authenticate signing requests with the application’s session credentials or custom headers.
The Builder API credentials remain on the server; the client receives only the headers for the request being authorized.

Opt Out of Beacon Upgrades

Deposit Wallets deployed after June 29, 2026 use an ERC-1967 beacon proxy. This proxy pattern resolves the implementation for multiple wallets through a shared beacon, allowing Polymarket to send implementation upgrades without changing their addresses. The wallet owner can instead pin the wallet to the implementation that is current when it opts out. The owner-only calls below are submitted directly and require POL for gas.
An opted-out wallet does not receive future security fixes, bug fixes, or features delivered through beacon upgrades. Review the current implementation and accept responsibility for maintaining the wallet before opting out.
1

Pause the Wallet

Send a direct onchain transaction from the wallet owner to call pause() on the Deposit Wallet.
2

Wait for the Timelock

Read timelockDelay() from the Deposit Wallet factory and wait until that interval has elapsed after the wallet was paused.
3

Opt Out

Send another transaction from the wallet owner to call optOut() on the Deposit Wallet. This pins the wallet to the beacon implementation that is current when the transaction executes.
4

Unpause the Wallet

Call unpause() from the wallet owner to clear the paused state.
To resume receiving beacon upgrades, repeat the pause and timelock steps, call optIn(), and then unpause the wallet. Review the beacon’s current default implementation before opting back in.