Skip to main content

1. List active markets

No setup needed — just make a request:
curl https://api.pmx.trade/v2/markets?status=active
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "BTC 1min candle 12:00 UTC",
      "description": "Will BTC/USDT close above open for the Binance 1-minute candle at 12:00 UTC?",
      "status": "active",
      "marketType": "amm",
      "yesTicker": "UP",
      "noTicker": "DOWN",
      "odds": { "yes": 0.65, "no": 0.35 },
      "yesReserve": 3500000,
      "noReserve": 6500000,
      "tradeFeeBps": 200,
      "creator": "7xKX...abc",
      "createdAt": 1717200000,
      "resolutionTime": 1735689600
    }
  ]
}

2. Get a price quote

Before trading, preview what you’ll receive:
curl "https://api.pmx.trade/v2/markets/1/quote?side=UP&amount=100000000&action=buy"
{
  "success": true,
  "data": {
    "side": "YES",
    "action": "buy",
    "inputAmount": 100000000,
    "outputAmount": 147060000,
    "effectivePrice": 0.68,
    "priceImpactBps": 300,
    "tradeFee": 2000000,
    "liquidityFee": 1500000,
    "effectiveAmount": 96500000,
    "preOdds": { "yes": 0.50, "no": 0.50 },
    "postOdds": { "yes": 0.68, "no": 0.32 },
    "marketId": 1
  }
}
This tells you: spending 100 USDC (100,000,000 raw units) on UP tokens gets you ~147 tokens at an effective price of $0.68 each.

3. Buy tokens

The API returns an unsigned transaction. Sign it locally and submit:
curl -X POST https://api.pmx.trade/v2/markets/1/buy \
  -H "Content-Type: application/json" \
  -d '{
    "wallet": "YOUR_WALLET_ADDRESS",
    "side": "UP",
    "amount": 100000000
  }'
{
  "success": true,
  "data": {
    "transaction": "AQAAAAAAA...base64...",
    "quote": {
      "side": "YES",
      "action": "buy",
      "inputAmount": 100000000,
      "outputAmount": 146500000,
      "effectivePrice": 0.6826
    }
  }
}
Then sign and submit the transaction locally:
const tx = Transaction.from(Buffer.from(data.transaction, "base64"));
tx.sign(wallet);
const sig = await connection.sendRawTransaction(tx.serialize());

4. Check your position

curl "https://api.pmx.trade/v2/positions/YOUR_WALLET_ADDRESS"
{
  "success": true,
  "data": [
    {
      "marketId": 1,
      "costBasis": 100.0,
      "currentValue": 103.50,
      "unrealizedPnl": 3.50,
      "returnPct": 3.5,
      "isResolved": false,
      "yesBalance": 146500000,
      "noBalance": 0
    }
  ]
}

Next steps

How Pricing Works

Understand price mechanics

Full API Reference

Browse all endpoints