Skip to main content

Overview

The Predexon Trading API uses a managed wallet model. When you create a user, the API automatically generates wallet addresses for each supported venue. You never need to handle private keys, manage gas, or sign transactions yourself.

How It Works

Wallet Creation

When you call POST /api/users/create, the API:
  1. Generates a managed wallet address for each venue
  2. Returns the wallet addresses in the response
VenueWallet FieldBlockchainCollateral
PolymarketpolymarketWalletAddressPolygonUSDC.e
Predict.funpredictWalletAddressBSCUSDT (BEP-20)
Users start with status "provisioning" and transition to "ready" before they can place orders.

Key Security via Turnkey

Private keys are managed by Turnkey, a hardware-backed key management infrastructure.
  • Keys are generated and stored in secure enclaves
  • Keys never leave the secure enclaves
  • Predexon never has access to private keys
  • All transaction signing happens server-side automatically

What the API Handles

ConcernManaged By
Key generationAutomatic at user creation
Transaction signingServer-side via Turnkey
Gas feesHandled by platform
Nonce managementHandled by platform

Deposit Flow

Each venue has its own deposit method: Polymarket has two options:
  1. Send USDC.e directly to the polymarketWalletAddress on Polygon
  2. Use the Bridge API (GET /api/bridge/deposit) to deposit from Ethereum, Arbitrum, Base, Solana, or Bitcoin. Funds are automatically converted to USDC.e.
Predict.fun: Send USDT (BEP-20) directly to the predictWalletAddress on BSC.
Sending the wrong token or using the wrong chain will result in lost funds. Always verify the token standard and chain before depositing.

Withdrawal Flow

Call POST /api/users/{userId}/withdraw with the venue, amount, destination address, and chain. The API signs and submits the transaction and returns a transactionHash. Before withdrawing:
  1. Cancel open orders (Predict.fun locks collateral on buy limit orders)
  2. Redeem any resolved winning positions
  3. Verify available balance with the Get Balance endpoint

Security Boundaries

  • Each API key can only access users it created
  • Attempting to access another API key’s users returns 403 Forbidden
  • Wallet addresses are unique per user