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

Prerequisites

Request your private beta API key on Discord 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",
  "polymarketWalletAddress": "0x1234...5678",
  "kalshiWalletAddress": "7BfknMUrXjZ..."
}
Save the userId - you’ll need it for all subsequent API calls.

Step 2: Fund Your Wallet

Send tokens to the wallet address for the venue you want to trade on.
Send USDC.e on Polygon to your polymarketWalletAddress.
TokenChainContract Address
USDC.ePolygon (137)0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
You can also use the Bridge API to deposit from other chains (Ethereum, Solana, Bitcoin).

Step 3: Find a Market

Use the Data API to find a market you want to trade.
Get markets from the List Markets endpoint:
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.predexon.com/v1/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..." }
    ]
  }]
}

Step 4: Place an Order

Now place your first trade.
Python
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...",  # From Step 3
        "side": "buy",
        "amount": "10.00",  # Spend $10 USDC
        "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']}")

Next Steps

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']}")

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

# 3. Get a market
markets = requests.get(
    f"{DATA_URL}/v1/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",
        "amount": "5.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'])}")