Skip to main content
BETAThe Prediction Market API is currently in beta and subject to breaking changes as we continue to improve the product. If you have any feedback, please reach out in Discord.
This doc covers the social features of Jupiter Prediction Market, including user profiles, following system, leaderboards, and the global trade feed.

Prerequisite

To use social features, you need:
API REFERENCEFor complete endpoint specifications, see the Prediction API Reference.

User Profiles

Use GET /profiles/{ownerPubkey} to retrieve a user’s prediction market statistics and performance metrics.
const traderPubkey = 'TRADER_WALLET_PUBLIC_KEY';
const response = await fetch(
  `https://api.jup.ag/prediction/v1/profiles/${traderPubkey}`,
  {
    headers: {
      'x-api-key': 'your-api-key'
    }
  }
);

const profile = await response.json();
console.log(profile);
Example response:
{
  "ownerPubkey": "TRADER_WALLET_PUBLIC_KEY",
  "realizedPnlUsd": "15000000",
  "totalVolumeUsd": "250000000",
  "predictionsCount": 45,
  "correctPredictions": 28,
  "wrongPredictions": 17,
  "totalActiveContracts": 150,
  "totalPositionsValueUsd": "85000000"
}
FieldDescription
realizedPnlUsdTotal realized profit/loss in micro USD
totalVolumeUsdTotal trading volume in micro USD
predictionsCountTotal number of predictions made
correctPredictionsNumber of winning predictions
wrongPredictionsNumber of losing predictions
totalActiveContractsCurrent open contract count
totalPositionsValueUsdCurrent portfolio value in micro USD

P&L History

Use GET /profiles/{ownerPubkey}/pnl-history to retrieve time-series P&L data for charting.
ParameterTypeDescription
intervalstringTime interval: 24h, 1w, or 1m
countnumberNumber of data points (default: 10)
const traderPubkey = 'TRADER_WALLET_PUBLIC_KEY';
const response = await fetch(
  `https://api.jup.ag/prediction/v1/profiles/${traderPubkey}/pnl-history?` +
  new URLSearchParams({
    interval: '1w',
    count: '12' // 12 weeks of data
  }),
  {
    headers: {
      'x-api-key': 'your-api-key'
    }
  }
);

const pnlHistory = await response.json();
Example response:
{
  "data": [
    { "timestamp": 1704067200, "realizedPnlUsd": "5000000" },
    { "timestamp": 1704672000, "realizedPnlUsd": "7500000" },
    { "timestamp": 1705276800, "realizedPnlUsd": "6800000" },
    { "timestamp": 1705881600, "realizedPnlUsd": "12000000" },
    { "timestamp": 1706486400, "realizedPnlUsd": "15000000" }
  ]
}

Trade Feed

Use GET /trades to retrieve recent trades across the platform. This provides a global activity feed of filled orders.
const response = await fetch(
  'https://api.jup.ag/prediction/v1/trades',
  {
    headers: {
      'x-api-key': 'your-api-key'
    }
  }
);

const trades = await response.json();
Example response:
{
  "data": [
    {
      "ownerPubkey": "trader-pubkey-1",
      "eventId": "event-123",
      "marketId": "market-456",
      "action": "buy",
      "side": "yes",
      "contracts": "25",
      "priceUsd": "720000",
      "amountUsd": "18000000",
      "timestamp": 1704067260,
      "eventTitle": "Will SOL reach $500?",
      "marketTitle": "SOL $500 by Q2 2026",
      "eventImageUrl": "https://..."
    },
    {
      "ownerPubkey": "trader-pubkey-2",
      "eventId": "event-789",
      "marketId": "market-012",
      "action": "sell",
      "side": "no",
      "contracts": "10",
      "priceUsd": "450000",
      "amountUsd": "4500000",
      "timestamp": 1704067200,
      "eventTitle": "Bitcoin halving date",
      "marketTitle": "BTC halving before April 2024",
      "eventImageUrl": "https://..."
    }
  ]
}
FieldDescription
ownerPubkeyTrader’s wallet address
actionbuy or sell
sideyes or no
contractsNumber of contracts traded
priceUsdExecution price in micro USD
amountUsdTotal trade value in micro USD
eventTitleParent event title
marketTitleMarket title

Leaderboards

Use GET /leaderboards to retrieve competitive rankings.
ParameterTypeDescription
periodstringTime period: all_time, weekly, monthly
metricstringRanking metric: pnl, volume, win_rate
limitnumberNumber of results (1-100)
const response = await fetch(
  'https://api.jup.ag/prediction/v1/leaderboards?' + new URLSearchParams({
    period: 'weekly',
    metric: 'pnl',
    limit: '10'
  }),
  {
    headers: {
      'x-api-key': 'your-api-key'
    }
  }
);

const leaderboard = await response.json();
Example response:
{
  "data": [
    {
      "rank": 1,
      "ownerPubkey": "top-trader-pubkey",
      "realizedPnlUsd": "50000000",
      "totalVolumeUsd": "500000000",
      "winRatePct": "72.5",
      "predictionsCount": 40
    },
    {
      "rank": 2,
      "ownerPubkey": "second-trader-pubkey",
      "realizedPnlUsd": "35000000",
      "totalVolumeUsd": "400000000",
      "winRatePct": "68.2",
      "predictionsCount": 55
    }
  ],
  "summary": {
    "totalVolume": "2500000000",
    "totalPredictions": 1250
  }
}
MetricDescription
pnlRanked by realized profit/loss
volumeRanked by total trading volume
win_rateRanked by prediction accuracy

Use Cases

Analytics Dashboard

Combine leaderboards with profiles for competitive analysis:
// Get top performers
const topTraders = await fetch(
  'https://api.jup.ag/prediction/v1/leaderboards?' + new URLSearchParams({
    period: 'monthly',
    metric: 'pnl',
    limit: '5'
  }),
  { headers: { 'x-api-key': 'your-api-key' } }
).then(r => r.json());

// Get detailed P&L history for top trader
const topTraderHistory = await fetch(
  `https://api.jup.ag/prediction/v1/profiles/${topTraders.data[0].ownerPubkey}/pnl-history?` +
  new URLSearchParams({ interval: '1w', count: '4' }),
  { headers: { 'x-api-key': 'your-api-key' } }
).then(r => r.json());

console.log('Top trader weekly P&L trend:', topTraderHistory.data);

Summary

FeatureEndpointDescription
ProfilesGET /profiles/{pubkey}User stats and performance
P&L HistoryGET /profiles/{pubkey}/pnl-historyTime-series P&L data
FollowPOST /follow/{pubkey}Follow a trader
UnfollowDELETE /unfollow/{pubkey}Unfollow a trader
FollowersGET /followers/{pubkey}List followers
FollowingGET /following/{pubkey}List who user follows
Trade FeedGET /tradesGlobal recent trades
LeaderboardsGET /leaderboardsCompetitive rankings