Skip to main content
Fund the Perps account with pUSD before placing orders. Deposits move pUSD from the user’s Polymarket wallet into the Perps account. Withdrawals move available pUSD back to the authenticated wallet. Internal transfers move pUSD between two Perps accounts, including between accounts in the same account group.

Deposit Collateral

Deposit pUSD when the account needs collateral for opening or maintaining Perps positions.
1

Create a Secure Client

Create a SecureClient for the wallet that will fund the Perps account. If you already have a Polymarket wallet, pass it as wallet and include a Relayer API key so the SDK can submit gasless transactions. If you are creating a wallet programmatically, use a Builder API key so the SDK can create the Deposit Wallet for that signer.
2

Set Up Deposit Approvals

Set up the approvals required for Perps collateral deposits. The SDK skips work that is already complete.
3

Deposit Collateral

Deposit pUSD from the user’s Polymarket wallet into the Perps account. Make sure the wallet has pUSD before depositing. The minimum Perps deposit is 10 pUSD. Amounts use raw pUSD base units, so 10 pUSD is 10_000_000n.
deposit.wait() confirms that the chain transaction settled. Perps may take a moment to credit the account after that.
4

Verify the Deposit

Open a Perps session and read account state after the deposit settles.
Use portfolio.withdrawable to check collateral available for withdrawal and deposits.items to reconcile deposit history. The withdrawable value already accounts for the 10% notional reserve.

Withdraw Collateral

Withdraw pUSD when the account has available collateral that should return to the authenticated wallet. Withdrawals must satisfy the withdrawal margin requirements, including the 10% reserve against open-position notional. Collateral available for trading can therefore exceed collateral available for withdrawal.
Request a withdrawal to the authenticated wallet. Amounts use raw pUSD base units, so 10 pUSD is 10_000_000n.
The SDK signs the withdrawal request with the Polymarket account signer and returns the Perps withdrawal ID.To track the withdrawal, open a Perps session and list withdrawals.
To narrow the results to a single state, pass a withdrawalStatus filter with a PerpsKnownWithdrawalStatus member. The filter accepts one status per request. For example, list the withdrawals that are still pending:
For what each status means, see Withdrawals.For more details on authenticated sessions, see Authenticated Sessions.

Transfer Between Your Accounts

Move pUSD between two Perps accounts with an internal transfer. The transfer settles on the exchange ledger, with no onchain transaction and no fee. The source owner can transfer to another Perps account. Transfers are limited to withdrawable collateral after accounting for pending withdrawals and transfers.
Use client.transferPerpsCollateral() on the owner-signed SecureClient from Set Up Perps Access.
The result is a PerpsInternalTransferId. amount is decimal pUSD, and its exact string is signed unchanged. Choose a recipient distinct from the owner’s address. label accepts 1 to 64 UTF-8 bytes and helps identify the transfer in history. The SDK signs with the owner and attempts the submission once.
Transfers and withdrawals still pending count against the withdrawable amount. Each source account can have up to 10 transfers waiting to be processed. If submission times out or returns a server error, the transfer may still have completed. Reconcile settled history before considering another submission. Labels help match records; they do not make transfers idempotent. A missing record does not prove failure, so do not automatically submit a new transfer.

Reconcile a Transfer

Use authenticated account history to locate the collateral movement and compare its recipient, amount, and direction with your intended transfer.
Use session.listInternalTransfers() with the authenticated session from Set Up Perps Access.
Each item is a PerpsInternalTransfer. amount is a decimal string in pUSD units; direction is "in" or "out" relative to this account. counterparty is the other account’s owner address.The default window is the past 90 days. Set start and end in epoch milliseconds to choose a window, or pass a returned nextCursor as cursor to resume it. The paginator deduplicates overlapping records and raises UnexpectedResponseError if a full millisecond cannot be paged without skipping records.
An interrupted or incomplete history read does not establish whether a transfer failed. Complete reconciliation before deciding whether to submit again.

Review Funding History

Use deposit and withdrawal history to reconcile collateral movements after your integration submits funding requests. See Authenticated Sessions for how to create an authenticated session for private account history reads.
List deposit or withdrawal history from an authenticated Perps session.