curl --request GET \
--url https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}import requests
url = "https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"schemaVersion": 1,
"state": "BUILDING",
"scope": "MARKET",
"marketId": 2,
"metric": "pnl",
"limit": 50,
"page": 1,
"totalRows": 1,
"totalPages": 1,
"data": [
{
"rank": 2,
"account": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"side": "YES",
"outcomeLabel": "<string>",
"heldShares": {
"raw": "100000000",
"formatted": "100"
},
"avgEntry": {
"raw": "100000000",
"formatted": "100"
},
"costBasis": {
"raw": "9000000",
"formatted": "9",
"usd": "9"
},
"mark": {
"raw": "<string>",
"formatted": "<string>",
"source": "CLOB_DEPTH_WEIGHTED_BID",
"asOf": "2023-11-07T05:31:56Z"
},
"marketValue": {
"raw": "9000000",
"formatted": "9",
"usd": "9"
},
"unrealizedPnl": {
"raw": "9000000",
"formatted": "9",
"usd": "9"
},
"unrealizedRoi": 123
}
],
"projectionVersion": "<string>",
"scopeVersion": "<string>",
"presentationVersion": "<string>",
"asOf": "2023-11-07T05:31:56Z",
"markAsOf": "2023-11-07T05:31:56Z",
"staleReason": "<string>",
"collateralToken": {
"id": 7,
"symbol": "USDC",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"priceOracleId": "usd-coin"
}
}Unrealized PnL Leaderboard by Market
Live leaderboard of open positions for one market, ranked by Unrealized PnL or ROI. Public - no authentication required. Ranks are absolute across pages, so page 2 with limit=10 returns ranks 11-20.
Results are paginated with limit (1-100, default 100) and page (1-100, default 1). The response also includes totalRows and totalPages describing the committed Top-100 generation for the market. ETag values are page-specific, so a validator returned for one page will not match another.
Responses are served from a live Redis projection maintained by a dedicated worker. When the projection is warm the response is a READY snapshot with a strong ETag and short client cache. When the projection is still being rebuilt, callers may receive a BUILDING, STALE, or DEGRADED snapshot with Cache-Control: no-store and (for BUILDING) an empty data array - retry after a short delay. If the market is not open (RESOLVED, hidden, or otherwise ineligible), the endpoint returns 404.
curl --request GET \
--url https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}import requests
url = "https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/leaderboard/pnl/unrealized/markets/{marketId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"schemaVersion": 1,
"state": "BUILDING",
"scope": "MARKET",
"marketId": 2,
"metric": "pnl",
"limit": 50,
"page": 1,
"totalRows": 1,
"totalPages": 1,
"data": [
{
"rank": 2,
"account": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"side": "YES",
"outcomeLabel": "<string>",
"heldShares": {
"raw": "100000000",
"formatted": "100"
},
"avgEntry": {
"raw": "100000000",
"formatted": "100"
},
"costBasis": {
"raw": "9000000",
"formatted": "9",
"usd": "9"
},
"mark": {
"raw": "<string>",
"formatted": "<string>",
"source": "CLOB_DEPTH_WEIGHTED_BID",
"asOf": "2023-11-07T05:31:56Z"
},
"marketValue": {
"raw": "9000000",
"formatted": "9",
"usd": "9"
},
"unrealizedPnl": {
"raw": "9000000",
"formatted": "9",
"usd": "9"
},
"unrealizedRoi": 123
}
],
"projectionVersion": "<string>",
"scopeVersion": "<string>",
"presentationVersion": "<string>",
"asOf": "2023-11-07T05:31:56Z",
"markAsOf": "2023-11-07T05:31:56Z",
"staleReason": "<string>",
"collateralToken": {
"id": 7,
"symbol": "USDC",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"priceOracleId": "usd-coin"
}
}ETag; pass it back as If-None-Match to get 304 Not Modified while the projection is unchanged. ETag values are page-specific — validators do not cross pages.Pagination
Results are paginated withlimit (1–100, default 100) and page (1–100, default 1). Ranks stay absolute across pages, so page 2 with limit=10 returns ranks 11–20. Each response includes:
page— the page returned.totalRows— number of ranked rows in the committed Top-100 generation for the market.totalPages— total number of pages given the requestedlimit.
limit=10&page=1, then increment page until page === totalPages. To fetch the complete Top-100 in one call, use limit=100&page=1. Omitting page is treated as page 1, so existing clients keep working.
State field
Every response carries astate. Treat it as the readiness signal:
| State | Meaning | How to handle |
|---|---|---|
READY | Complete, current snapshot. | Render data and cache per Cache-Control. |
STALE | Last complete snapshot is being replaced. | Render data; response is Cache-Control: no-store, refetch shortly. |
DEGRADED | Snapshot returned with a staleReason. | Render data; treat as best-effort and refetch shortly. |
BUILDING | No complete snapshot yet. | data is empty; retry after a short delay. |
unrealizedPnlProjectionChanged WebSocket event and refetch this endpoint when a hint arrives for the same marketId.
404 for markets that are not open — resolved, hidden, or otherwise ineligible for a live leaderboard.Path Parameters
Numeric market id.
x >= 1Query Parameters
Metric to rank by.
pnl, roi Number of leaderboard entries to return per page (1-100).
1 <= x <= 100Page number to return (1-100). Ranks stay absolute across pages, so page 2 with limit=10 returns ranks 11-20. Omitting page returns page 1.
1 <= x <= 100Response
Ranked Unrealized PnL leaderboard for the market
1 Readiness of the underlying projection. READY is a complete, current snapshot. BUILDING means the projection is being rebuilt and data is empty. STALE and DEGRADED return the last complete snapshot with Cache-Control: no-store; callers should retry shortly.
BUILDING, DEGRADED, READY, STALE MARKET x >= 1pnl, roi 1 <= x <= 100x >= 1x >= 0x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes