> For the complete documentation index, see [llms.txt](https://docs.42.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.42.space/for-developers/rest-api-alpha/leaderboard/get-race-leaderboard.md).

# Get race leaderboard

GET /api/v1/token-races/leaderboard

## Get race leaderboard

> Ranks wallets over finalised token races (Blitz) within a time period or UTC calendar-day window, sorted by longest consecutive winning-race run by default. Every row also reports \`losses\` and \`longestLossStreak\` (the losing mirror of \`wins\` / \`bestStreak\` over the same window), though neither is a sort option. Treasury wallets and the deployment's configured market-maker wallets are excluded. Pass \`user\` for a single wallet's rank. For live ranks inside the current race window, use the race-coordinator's GET /race/leaderboard/me instead — this endpoint only sees races that have been finalised onchain.

```json
{"openapi":"3.1.1","info":{"title":"FortyTwo Read API","version":"1.0"},"tags":[{"description":"GET /api/v1/token-races/leaderboard","name":"get-race-leaderboard"}],"servers":[{"url":"https://rest.ft.42.space/"}],"paths":{"/api/v1/token-races/leaderboard":{"get":{"description":"Ranks wallets over finalised token races (Blitz) within a time period or UTC calendar-day window, sorted by longest consecutive winning-race run by default. Every row also reports `losses` and `longestLossStreak` (the losing mirror of `wins` / `bestStreak` over the same window), though neither is a sort option. Treasury wallets and the deployment's configured market-maker wallets are excluded. Pass `user` for a single wallet's rank. For live ranks inside the current race window, use the race-coordinator's GET /race/leaderboard/me instead — this endpoint only sees races that have been finalised onchain.","tags":["get-race-leaderboard"],"summary":"Get race leaderboard","parameters":[{"schema":{"type":"string","default":"all","enum":["1d","7d","30d","all"]},"description":"Time period (mutually exclusive with from/to)","name":"period","in":"query"},{"schema":{"type":"string"},"description":"Window start date YYYY-MM-DD UTC inclusive (requires to; mutually exclusive with period)","name":"from","in":"query"},{"schema":{"type":"string"},"description":"Window end date YYYY-MM-DD UTC inclusive (requires from; mutually exclusive with period)","name":"to","in":"query"},{"schema":{"type":"string","default":"best_streak","enum":["best_streak","pnl","wins","win_rate"]},"description":"Primary sort criterion. win_rate is unweighted — one won race outranks a long profitable run.","name":"sort_by","in":"query"},{"schema":{"type":"string"},"description":"Wallet address — returns that wallet's rank instead of the full list","name":"user","in":"query"},{"schema":{"type":"integer","default":100,"maximum":500,"minimum":1},"description":"Max results","name":"limit","in":"query"},{"schema":{"type":"integer","default":0},"description":"Pagination offset","name":"offset","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ft_market-service-v2_pkg_api.PaginatedResponse-internal_handler_RaceLeaderboardEntry"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ft_market-service-v2_pkg_api.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ft_market-service-v2_pkg_api.ErrorResponse"}}}}}}}},"components":{"schemas":{"ft_market-service-v2_pkg_api.PaginatedResponse-internal_handler_RaceLeaderboardEntry":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/internal_handler.RaceLeaderboardEntry"}},"pagination":{"$ref":"#/components/schemas/ft_market-service-v2_pkg_api.Pagination"}}},"internal_handler.RaceLeaderboardEntry":{"type":"object","properties":{"bestStreak":{"type":"integer"},"longestLossStreak":{"description":"LongestLossStreak is the longest consecutive losing run in the same window,\ncomputed from the same islands as BestStreak. Losses is its atom count\n(races_played − wins). Reported but not rankable — see raceLeaderboardOrderBy.","type":"integer"},"losses":{"type":"integer"},"racePnl":{"type":"number"},"racesPlayed":{"type":"integer"},"rank":{"type":"integer"},"walletAddress":{"type":"string"},"winRate":{"type":"number"},"wins":{"type":"integer"}}},"ft_market-service-v2_pkg_api.Pagination":{"type":"object","properties":{"hasMore":{"type":"boolean"},"totalResults":{"type":"integer"}}},"ft_market-service-v2_pkg_api.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.42.space/for-developers/rest-api-alpha/leaderboard/get-race-leaderboard.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
