Building directly against the API? Start with Authenticated
Sessions, then use Fund Your
Account and Trading.
- TypeScript
- Python
Install the SDK
Install the Unified TypeScript SDK with the package manager of your choice.
This page uses Viem for wallet signing. See the TypeScript tooling
guide for other wallet library
integrations.
Create a Secure Client
Create a Create a Relayer API key from
polymarket.com → Settings → API Keys.
SecureClient with the wallet and signer that owns the Perps account.
Include a Relayer API key so the SDK can submit gasless transactions.Fund the Account
Set up the approvals required for Perps collateral deposits, then deposit pUSD
from the user’s Polymarket wallet into the Perps account. 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. See Fund Your
Account for the full funding workflow.Place the Order
Place a long buy order for The returned order includes the accepted order state. See
Trading for direction, order behavior, cancellation, and state
reconciliation.
1 quantity unit of SP500-USD with an explicit
limit price of 100 USD per quantity unit and immediate-or-cancel execution.