You’re building a product where end-users place trades. Could be a copytrading app, structured products, a prediction-market UX, an agentic platform, or a brokerage. This guide is about the architecture decisions — Predexon handles custody, signing, and routing so you don’t have to. You’ll be ready to:Documentation Index
Fetch the complete documentation index at: https://docs.predexon.com/llms.txt
Use this file to discover all available pages before exploring further.
- Pick the right account model for your product (one account per user, vs. corporate)
- Wire up funding, withdrawals, and cross-chain bridging
- Place orders via the Unified Order Router or per-venue
- Monetize with partner fees
- Handle errors, retries, and latency expectations realistically
Pick an account model
Every account on the Trading API owns its own set of per-venue managed wallets. Two patterns:Account per end-user (recommended)
Each of your users gets their own Predexon account. Funds, positions, and P&L are isolated per user. You hand them their deposit wallet; they deposit on-chain. Best for copytrading, brokerage UX, anything user-facing.API key strategy: one Predexon API key for your platform; each end-user maps to an
accountId you create on their behalf.Corporate account (single)
One Predexon account holds all platform funds. Your platform tracks per-user balances internally and bills/credits users out-of-band. Best for funds, prop trading desks, internal tools.API key strategy: one Predexon API key, one
accountId, your DB owns the ledger.Account limits per API key: Free 5 · Dev 50 · Pro 1,000 · Enterprise custom. Account-per-user platforms typically run on Pro or Enterprise.
The four-step trading flow
Every integration walks the same four steps. Code skeleton below uses Python; full per-step references linked.| Step | Reference | Notes |
|---|---|---|
| Create account | Create Account | Idempotent if you pass your own clientId. Persist accountId. |
| Enable venue | Enable Venue | Provisions wallet via Turnkey. Async — poll Get Account until status: "active" (typically <30s). |
| Fund | Funding & Withdrawals guide | Deposit wallet is Base USDC. Bridge from any chain via Quote Transfer. |
| Trade | Placing Trades guide | Per-venue or via Order Router. |
Unified Order Router vs venue-specific
This is the single most important architecture choice in your product.Use the Order Router when…
Your user wants exposure to an outcome and doesn’t care which venue fills it. The router compares price + fees across every venue holding the canonical outcome and picks the best fill. Perfect for casual UX, structured products, agentic trading.
Use venue-specific orders when…
Your user picked the venue intentionally (e.g. copytrading a Kalshi trader), or you need native order types not exposed by the router. Full control, normalized response shape.
Funding architecture
Funding is the single hardest part to get right. The rules:- Every account has one deposit wallet — Base USDC. This is your end-user’s “main” address.
- Venue balances are separate — funding Polymarket means moving USDC from deposit → polymarket wallet (which gets converted to pUSD).
- Cross-chain bridging is supported via Quote Transfer — get a signed transaction, your user submits from their own wallet. Supports Ethereum, Arbitrum, Polygon, BSC, Optimism.
- Hyperliquid is the exception — it uses Across for funding, not
/transfers. See Funding guide. - Withdrawals are the same path in reverse — drain venue → deposit, then
/transferswithto: "external".
- Show user their deposit address (Base USDC) on signup
- Show them a “Deposit from another chain” CTA that calls
quote-transferand prompts a wallet signature - Auto-route deposits into the venue they want to trade on (background
/transferscall after deposit confirms)
Monetize with partner fees
Every order placed through an account you own can carry a partner fee that lands in your wallet. Currently supported on Polymarket (more venues coming).Latency, errors, and operational realism
What to expect in production:| Surface | Typical latency | Notes |
|---|---|---|
| Trading API (place order) | 200–800ms | Higher for first call after venue enable (warm-up). |
| Trading API (cancel) | 200–500ms | |
| Order Router (place) | 400–1500ms | Has to quote venues sequentially, then place. |
| Data API (read) | 50–200ms | |
| WebSocket events | <1s end-to-end | Pending-trades lead confirmed-trades by 3–5s. |
409 Conflicton fee policy updates — concurrent modification. Retry.400on order placement with insufficient venue balance — surface this to user, prompt to fund.503rarely — surface as “venue temporarily unavailable” and let users retry; don’t retry yourself.
Common builder recipes
Copy-trade a wallet
Subscribe to a wallet’s trades via WebSocket, mirror them into your user accounts via the router.
Cross-venue arbitrage product
Surface arb spreads to users, execute both legs atomically through the router.
Portfolio monitor
Positions + P&L + live updates. Same patterns power most prediction-market UIs.
What you should read next
Execution overview
Full map of the Trading API surface.
Order Router guide
The headline feature — canonical discovery, quoting, routing.
Funding & withdrawals
Every funding path, per venue, including cross-chain bridging.
Best Practices
Retries, idempotency, rate limits, error handling.
