Skip to main content
This guide walks through the full workflow of placing a trade — from finding a market to executing an order and monitoring the result.

Find a Market

Before placing a trade, you need the token ID for the outcome you want to trade. How you get it depends on the venue.

Polymarket

Use the List Markets endpoint to browse active markets:
import requests

HEADERS = {"x-api-key": "YOUR_API_KEY"}

# Find top markets by volume
markets = requests.get(
    "https://api.predexon.com/v2/markets",
    headers=HEADERS,
    params={"status": "active", "sort": "volume", "limit": 5}
).json()

for market in markets["markets"]:
    print(f"{market['question']}")
    for outcome in market["outcomes"]:
        print(f"  {outcome['label']}: tokenId={outcome['tokenId']}")
Each outcome (e.g., “Yes” and “No”) has its own tokenId. You’ll pass this token ID when placing an order.

Predict.fun

Find markets on Predict.fun or via the Predict.fun API. You’ll need two identifiers:
  • marketId — the numeric market ID (e.g., "46954")
  • tokenId — the on-chain outcome token ID (a large numeric string)

Understand the Identifiers

Every order requires you to tell the API which outcome you’re trading. There are two ways to do this:

Option 1: Explicit fields

Pass venue, tokenId, and (for Predict) marketId separately:
{
  "venue": "polymarket",
  "tokenId": "71321045679252212...",
  "side": "buy",
  "type": "market",
  "amount": "10"
}

Option 2: Market identifier

Use the composite marketIdentifier string, which is returned in every order and position response:
{
  "marketIdentifier": "polymarket:71321045679252212...",
  "side": "buy",
  "type": "market",
  "amount": "10"
}
The format is polymarket:<tokenId> or predict:<marketId>:<tokenId>. This is convenient when re-trading a market you’ve already interacted with — just reuse the marketIdentifier from a previous response.

Choose Your Order Type

Market orders

Execute immediately at the best available price. Use these when you want to get in or out of a position right now.
  • Market BUY — you specify amount (how much USDC.e/USDT to spend). The API fills as many shares as possible at the current price.
  • Market SELL — you specify size (how many shares to sell). The API sells them at the best available price.

Limit orders

Sit on the orderbook at a specific price until someone takes the other side. Use these when you have a target price in mind and are willing to wait.
  • Limit BUY — you specify size (shares) and price (per share). The order rests until a seller matches it.
  • Limit SELL — same as limit buy, but on the sell side.

Understand Amount vs Size vs Price

This is the most common source of confusion. The rule is simple:
  • amount = stablecoin to spend (USDC.e or USDT). Only used for market BUY orders.
  • size = number of shares. Used for everything else (market sell, all limit orders).
  • price = price per share. Only used for limit orders.
Order Typeamountsizeprice
Market BUYRequiredRejected
Market SELLRejectedRequired
Limit BUYRejectedRequiredRequired
Limit SELLRejectedRequiredRequired
Sending the wrong field returns a 400 error with a message indicating which field is expected.

Place an Order

All orders go to the same endpoint: POST /api/users/{userId}/orders. See the reference for Polymarket or Predict.

Polymarket example

import requests

user_id = "YOUR_USER_ID"
HEADERS = {"x-api-key": "YOUR_API_KEY", "Content-Type": "application/json"}
BASE = "https://trade.predexon.com"

# Market buy — spend $10 USDC.e on "Yes" shares
order = requests.post(
    f"{BASE}/api/users/{user_id}/orders",
    headers=HEADERS,
    json={
        "venue": "polymarket",
        "tokenId": "71321045679252212...",
        "side": "buy",
        "type": "market",
        "amount": "10"
    }
).json()

print(f"Status: {order['status']}")
print(f"Shares received: {order['sizeMatched']}")

Predict.fun example

# Market buy — spend 10 USDT on "Nuggets" shares
order = requests.post(
    f"{BASE}/api/users/{user_id}/orders",
    headers=HEADERS,
    json={
        "venue": "predict",
        "tokenId": "103210916722172...",
        "marketId": "46954",
        "side": "buy",
        "type": "market",
        "amount": "10.00"
    }
).json()

print(f"Status: {order['status']}")
print(f"Shares received: {order['sizeMatched']}")

Limit order example

# Place a limit buy at $0.40 per share on Polymarket
order = requests.post(
    f"{BASE}/api/users/{user_id}/orders",
    headers=HEADERS,
    json={
        "venue": "polymarket",
        "tokenId": "71321045679252212...",
        "side": "buy",
        "type": "limit",
        "size": "20",
        "price": "0.40"
    }
).json()

# Limit orders return status "open" — they sit on the orderbook
print(f"Status: {order['status']}")  # "open"
print(f"Order ID: {order['orderId']}")

Venue Differences

The two venues have different constraints and behaviors:
PolymarketPredict.fun
BlockchainPolygonBSC
CollateralUSDC.eUSDT (BEP-20)
Price rangeBetween 0 and 1 (exclusive)Between 0 and 1 (exclusive)
Min market order> 1 USDC.e~$0.90 USDT
Min limit order> 5 shares~$0.90 USDT
Extra fieldmarketId required
FeesConfigurable partner feeExchange fee that varies by market (automatic)

After Placing an Order

Once your order is placed, you can:

Next Steps