Make your first PMX API call in under 2 minutes.
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 } ] }
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 } }
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 } } }
const tx = Transaction.from(Buffer.from(data.transaction, "base64")); tx.sign(wallet); const sig = await connection.sendRawTransaction(tx.serialize());
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 } ] }