> For the complete documentation index, see [llms.txt](https://docs.uniocean.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uniocean.io/forecast-platform/markets/leaderboard.md).

# Rankings

Rankings track forecasts by accuracy and update in real time as asset prices move.

## Ranking Criteria

| Priority | Compared Value             | Rule                                                 |
| -------: | -------------------------- | ---------------------------------------------------- |
|        1 | Distance from actual price | Smaller distance ranks higher                        |
|        2 | Deterministic tie-breaker  | Cryptographic hash of on-chain data determines order |

### How Distance Works

Distance is calculated as the absolute difference between a user's forecast and the oracle price:

```
Distance = |Forecasted Price − Oracle Price|
```

A forecast of 96,000 when the oracle price is 96,100 has a distance of 100.

### How Tie-Breaking Works

When two forecasts have the same distance, a cryptographic hash is computed using on-chain data:

* The forecasted price
* The block number where the forecast was recorded
* The block hash (unique and unpredictable)
* The log position within the block

This produces a deterministic, tamper-resistant ordering that:

* Always gives the same result for the same inputs
* Cannot be influenced after submission
* Can be independently verified by anyone

### Tie Example

If one user forecasts 100 and another forecasts 110 while the settlement price is 105, both are 5 points away. The tie-breaker hash (not submission time alone) determines which ranks higher. This prevents manipulation and ensures fairness.

## Real-Time Rankings

During live markets, rankings update every second as the oracle price changes. The platform streams live price data from Pyth Network and recalculates all positions continuously.

A user may rank #1 at one moment and #50 the next — final ranking is determined only at settlement.

### How Real-Time Updates Work

```mermaid
flowchart LR
    A[Oracle Price Feed] --> B[New Price Tick]
    B --> C[Recalculate All Distances]
    C --> D[Update Rankings]
    D --> E[Push to Clients via WebSocket]
```

The rankings service computes positions using high-performance sorted data structures, achieving response times under 10 milliseconds even for markets with thousands of participants.

WebSocket connections push updated rankings to all connected users simultaneously, so the live rankings feel instant and responsive.

## What Users See

* Current rank position
* Distance from current/settlement price
* Total participant count
* Forecast distribution chart
* Full paginated rankings
* Personal rank card (for logged-in users)

## Scalability

The ranking system is designed to handle large markets efficiently:

| Market Size       | Query Time  |
| ----------------- | ----------- |
| 1,000 forecasts   | Under 5 ms  |
| 10,000 forecasts  | Under 10 ms |
| 100,000 forecasts | Under 15 ms |

## Global Rankings

Uniocean also tracks broader performance across:

* All Time
* Monthly
* Weekly
* Daily

Metrics include forecasts submitted, markets participated in, net P\&L, in-the-money rate (ITM rate), and badges such as Gold, Silver, and Bronze.

## Multi-Chain Support

Rankings work seamlessly across multiple blockchain networks. A single rankings service handles all supported chains simultaneously, so users see consistent rankings regardless of which network processes their forecasts.

***

## Related Pages

* [Submitting Forecasts](/forecast-platform/markets/making-predictions.md)
* [Reward Overview](/forecast-platform/rewards/overview.md)
* [Settlement Process](/forecast-platform/settlement/settlement-process.md)
* [Market Lifecycle](/forecast-platform/markets/market-lifecycle.md)
