## Overview

The Solana Staking Reporting API introduces enhanced features, including timezone-based reporting for more precise analysis and improved tracking of validator and delegator statuses.

🌐 **Supported network:** Mainnet

---

## ➡️ Get the Rewards

This endpoint returns the total rewards between specified timestamps for a single or multiple addresses.

- Solana rewards are tracked by processing each slot in an epoch, with inflation rewards in the first slot and fee/rent rewards in subsequent ones. While MEV rewards are paid out in the epoch after they are earned and are not available in the reporting API until approximately 60-90 minutes after the epoch ends.
- The API will report the MEV rewards separately from the consensus layer rewards, and the total rewards may appear higher than normal due to the MEV rewards.

> **Note** that there may be processing delays at epoch end when gathering MEV and inflation rewards.

### Endpoints

| Endpoint |
| --- |
| [Get a Stream of Rewards](https://docs.blockdaemon.com/reference/getrewards-solana) - `POST /rewards` |
| [Get a Stream of Rewards for a Single Address](https://docs.blockdaemon.com/reference/getrewardssingle-solana) - `GET /rewards/{address}` |
| [Get a Yield for a Validator Address](https://docs.blockdaemon.com/reference/getyield-validator-solana) - `GET /yield/{address}` |
| [Get a Stream of Yield Summaries](https://docs.blockdaemon.com/reference/getyields-solana) - `GET /yield` |

### Sample Request

Below is a sample request for a single validator. For multiple validators, you can include up to 1000 addresses per request.

Request

```curl
curl --location 'https://svc.blockdaemon.com/reporting/staking/v2/solana/mainnet/validator/rewards/FQwewNXahV7MiZcLpY6p1xhUs2acVGQ3U5Xxc7FzV571?startTime=1678174507&endTime=1678779307&period=weekly' \
--header 'Authorization: Bearer YOUR_KEY' \
--header 'accept: application/x-ndjson'
```

This would return a response below.

Response

```json
{
  "address": "FQwewNXahV7MiZcLpY6p1xhUs2acVGQ3U5Xxc7FzV571",
  "denomination": "lamports",
  "return": "152995957268",
  "startTime": 1678174507,
  "endTime": 1678779306,
  "period": "WEEKLY",
  "startBalance": "582507713330",
  "metadata": {
    "epoch": "419-422",
    "fee": "33473577072",
    "identity": "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy",
    "slot": "181226296-182498587",
    "voteKey": "FQwewNXahV7MiZcLpY6p1xhUs2acVGQ3U5Xxc7FzV571",
    "voting": "119522380196",
    "stake": "1118732553958212"
  }
}
```

> 📘
>
> ### Info
>
> To get the most recent rewards, you need to make a request for either epoch or raw rewards by specifying an **end time** in the future and a **start time**.
> In the response, the highest `startTime` value shows the most recent reward.

## ➡️ Get a Status

This endpoint returns the current status of a validator/delegator. Possible statuses include:

- `UNKNOWN`
- `ACTIVE`
- `INACTIVE`

### Endpoints

| Endpoint |
| --- |
| [Get a Stream of Statuses](https://docs.blockdaemon.com/reference/getstatuses-solana) - `POST /status` |
| [Get Status for an Address](https://docs.blockdaemon.com/reference/getstatus-solana) - `GET /status/{address}` |

### Sample Request

Below is an example to get the status of a single validator.

cURL

```curl
curl -X 'GET' \
	'https://svc.blockdaemon.com/reporting/staking/v2/solana/mainnet/delegator/status/78NumgHAAgfaHUDPBPTyzFcSgvPnXSqqTnSmXPAW9KZW' \
	-H 'Content-Type: application/json' \
	-H 'Authorization: Bearer KEY'
```

This would return a response below.

JSON

```json
{
  "address": "78NumgHAAgfaHUDPBPTyzFcSgvPnXSqqTnSmXPAW9KZW",
  "status": "ACTIVE",
  "metadata": {
    "activationEpoch": "631",
    "deactivationEpoch": "18446744073709551615",
    "identity": "7cVfgArCheMR6Cs4t6vz5rfnqd56vZq4ndaBrY5xkxXy",
    "solanaAccount": "A2VLtkfrXxBCLKUGQqwhyD5fmGSvSZpc6a8jMA78T2eL",
    "stakeAccount": "78NumgHAAgfaHUDPBPTyzFcSgvPnXSqqTnSmXPAW9KZW",
    "type": "delegator",
    "voteKey": "FQwewNXahV7MiZcLpY6p1xhUs2acVGQ3U5Xxc7FzV571"
  }
}
```

## ➡️ Get Health

The endpoint provides the health status of the rewards processing system. You can track:

- The latest epoch with available rewards.
- The current status of the blockchain.

### Endpoint

| Endpoint |
| --- |
| [Get the Protocol Rewards Processing Health](https://docs.blockdaemon.com/reference/gethealth-solana) - `GET /health` |

### Sample Request

Below is an example request for a Health endpoint.

Request

```curl
curl 'https://svc.blockdaemon.com/reporting/staking/v2/solana/mainnet/health' \
     -H 'Authorization: Bearer YOUR_KEY'
```

The response will include information about the current status of the API, such as the current chain epoch, last processed inflation epoch, and last processed MEV epoch.

Response

```json
{
    "status": "OPTIMAL",
    "timestamp": 1716893171,
    "metadata": {
        "lastProcessedInflationEpoch": "620",
        "lastProcessedMevEpoch": "620",
        "lastProcessStatusesEpoch": "621",
        "chainEpoch": "621",
        "chainSlot": "268425883",
        "lastProcessedSlot": "268425383",
        "lastProcessedMevTxTimestamp": "1716893374"
    }
}
```

> 📘
>
> ### Info
>
> The endpoint will return `unknown` if queried before 2024/06/03.
