Skip to main content
This guide walks you through placing your first trade on a prediction market using the Predexon Trading API.

Prerequisites

Get your free API key at dashboard.predexon.com before starting.

Step 1: Create a User

Create a user to get managed wallet addresses for depositing funds.
curl -X POST \
  -H "x-api-key: YOUR_API_KEY" \
  "https://trade.predexon.com/api/users/create"
Response:
{
  "userId": "550e8400-e29b-41d4-a716-446655440000",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "status": "provisioning",
  "polymarketWalletAddress": "0x1234...5678",
  "predictWalletAddress": "0x1234...5678"
}
Save the userId - you’ll need it for all subsequent API calls. Poll Get User until status becomes "ready" before placing orders.

Step 2: Fund Your Wallet

Send tokens to the wallet address for the venue you want to trade on.
VenueTokenChainWallet FieldContract Address
PolymarketUSDC.ePolygon (137)polymarketWalletAddress0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
PredictUSDT (BEP-20)BSC (56)predictWalletAddress0x55d398326f99059fF775485246999027B3197955
Polymarket: Only send USDC.e (Bridged USDC) - not native USDC. Predict: Only send BEP-20 USDT on BSC. Sending tokens on the wrong chain will result in lost funds.
For Polymarket, you can also use the Bridge API to deposit from other chains (Ethereum, Solana, Bitcoin). For Predict, send USDT directly to the predictWalletAddress on BSC.

Step 3: Find a Market

Use the List Markets endpoint to find a market and its tokenId:
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.predexon.com/v2/markets?status=active&sort=volume&limit=5"
Find the tokenId in the outcomes array for the side you want to trade:
{
  "markets": [{
    "question": "Will Bitcoin reach $100k?",
    "outcomes": [
      { "label": "Yes", "tokenId": "71321045679252..." },
      { "label": "No", "tokenId": "48331043336612..." }
    ]
  }]
}
Find a market on Predict.fun and note the numeric marketId and tokenId for the outcome you want to trade. Market data is also available from the Predict.fun API.

Step 4: Place an Order

Now place your first trade.
import requests

user_id = "YOUR_USER_ID"

# Place a limit order to buy "Yes" shares at $0.65
response = requests.post(
    f"https://trade.predexon.com/api/users/{user_id}/orders",
    headers={
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "venue": "polymarket",
        "tokenId": "71321045679252...",
        "side": "buy",
        "size": "15.00",
        "price": "0.65",
        "type": "limit"
    }
)

order = response.json()
print(f"Order placed: {order['orderId']}")
print(f"Status: {order['status']}")
Limit orders sit on the orderbook until matched. Use "type": "market" for immediate execution at best available price.

Step 5: Check Your Position

View your positions to see your holdings and P&L.
Python
response = requests.get(
    f"https://trade.predexon.com/api/users/{user_id}/positions",
    headers={"x-api-key": "YOUR_API_KEY"}
)

positions = response.json()["positions"]
for pos in positions:
    print(f"{pos['title']} - {pos['outcome']}")
    print(f"  Shares: {pos['size']} @ avg ${pos['averagePrice']}")
    print(f"  Current value: ${pos['currentValue']}")
    print(f"  P&L: ${pos['pnl']}")

Complete Example

Here’s a full Python script to place your first trade:
Python
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://trade.predexon.com"
DATA_URL = "https://api.predexon.com"
HEADERS = {"x-api-key": API_KEY, "Content-Type": "application/json"}

# 1. Create user
user = requests.post(f"{BASE_URL}/api/users/create", headers=HEADERS).json()
user_id = user["userId"]
print(f"Created user: {user_id}")
print(f"Fund Polymarket wallet: {user['polymarketWalletAddress']}")
print(f"Fund Predict wallet: {user['predictWalletAddress']}")

# 1b. Wait for user to be ready
import time
while True:
    user = requests.get(f"{BASE_URL}/api/users/{user_id}", headers=HEADERS).json()
    if user["status"] == "ready":
        break
    print("Waiting for setup...")
    time.sleep(2)

# 2. (Manual step) Send USDC.e to the Polymarket wallet address

# 3. Get a market
markets = requests.get(
    f"{DATA_URL}/v2/markets",
    headers=HEADERS,
    params={"status": "active", "sort": "volume", "limit": 1}
).json()

market = markets["markets"][0]
tokenId = market["outcomes"][0]["tokenId"]  # Buy "Yes" side
print(f"Trading: {market['question']}")

# 4. Check balance
balance = requests.get(
    f"{BASE_URL}/api/users/{user_id}/balance",
    headers=HEADERS
).json()
print(f"Available balance: ${balance['balances'][0]['available']}")

# 5. Place order
order = requests.post(
    f"{BASE_URL}/api/users/{user_id}/orders",
    headers=HEADERS,
    json={
        "venue": "polymarket",
        "tokenId": tokenId,
        "side": "buy",
        "size": "10.00",
        "price": "0.50",
        "type": "limit"
    }
).json()
print(f"Order placed: {order['orderId']} - {order['status']}")

# 6. Check positions
positions = requests.get(
    f"{BASE_URL}/api/users/{user_id}/positions",
    headers=HEADERS
).json()
print(f"Total positions: {len(positions['positions'])}")

Next Steps

Placing Trades

Order types, venues, and the full trading workflow

Funding & Withdrawals

Deposits, bridging, and withdrawals

Fees & Monetization

Set up partner fees to earn revenue

How It Works

Understand the custody and execution model