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:
- Generates a managed wallet address for each venue
- Returns the wallet addresses in the response
| Venue | Wallet Field | Blockchain | Collateral |
|---|
| Polymarket | polymarketWalletAddress | Polygon | USDC.e |
| Predict.fun | predictWalletAddress | BSC | USDT (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
| Concern | Managed By |
|---|
| Key generation | Automatic at user creation |
| Transaction signing | Server-side via Turnkey |
| Gas fees | Handled by platform |
| Nonce management | Handled by platform |
Deposit Flow
Each venue has its own deposit method:
Polymarket has two options:
- Send USDC.e directly to the
polymarketWalletAddress on Polygon
- 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:
- Cancel open orders (Predict.fun locks collateral on buy limit orders)
- Redeem any resolved winning positions
- 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