API Docs

PREX API reference for markets, portfolio, wallet setup, and Polymarket order relay.

Wallet & Deposit Wallet

Users connect an EOA. PREX derives the official Polymarket Deposit Wallet and uses it for balances, positions, buys, and sells.

Trading

Buy and sell orders are signed in the user's wallet. PREX only relays signed CLOB payloads and never asks for private keys.

Market Sync

Markets are synced from Polymarket in the background, then served quickly from PREX's database with pagination.

Security Model

Private keys are never collected or stored by PREX.
Polymarket API credentials are encrypted before saving.
Portfolio data is fetched from public Polymarket position APIs for the user's Deposit Wallet.

List Markets

Returns active Polymarket markets from PREX's synced database with pagination and search.

GET/api/marketsPublic

Parameters

pagepageSizecategoryq

Response Fields

data[]totalCounttotalPageslastSyncedAt

User Portfolio

Returns the logged-in user's real Polymarket positions by querying the user's Deposit Wallet.

GET/api/portfolioSession

Parameters

No request parameters.

Response Fields

walletAddressdepositWalletAddresstotalValuetotalPnLpositions[]stats

Submit Signed Order

Backend relay for already-signed Polymarket CLOB orders. Used for buy and sell flows to avoid browser CORS.

POST/api/polymarket/submit-orderSigned order

Parameters

ordercredsauthAddressorderType

Response Fields

successorder

Save Connected Wallet

Stores the connected EOA and derives the deterministic Polymarket Deposit Wallet.

POST/api/user/walletSession

Parameters

walletAddress

Response Fields

walletAddressdepositWalletAddress

Save Polymarket API Credentials

Stores encrypted API credentials and normalizes the wallet mode to Deposit Wallet signing.

POST/api/settings/polymarketSession

Parameters

apiKeyapiSecretapiPassphrasewalletAddress

Response Fields

successwalletAddress

Sync Markets

Fetches active Polymarket markets in pages and upserts markets/outcomes into the local database.

GET/POST/api/sync/marketsInternal

Parameters

No request parameters.

Response Fields

syncedCounterrorCounttotalMarkets