Deposit Collateral
Deposit pUSD when the account needs collateral for opening or maintaining Perps positions.- TypeScript
- Python
- API
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.Set Up Deposit Approvals
Set up the approvals required for Perps collateral deposits. The SDK skips work
that is already complete.
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.Withdraw Collateral
Withdraw pUSD when the account has available collateral that should return to the authenticated wallet.- TypeScript
- Python
- API
Request a withdrawal to the authenticated wallet.
Amounts use raw pUSD base units, so 10 pUSD is 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.For more details on authenticated sessions, see Authenticated
Sessions.
10_000_000n.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.- TypeScript
- Python
- API
List deposit or withdrawal history from an authenticated Perps session.