Documentation index

getSlotLeader

Returns the current slot leader -- the validator responsible for producing the block at the current slot. This information is used for transaction routing optimization (sending transactions directly to the leader), MEV strategies, and network monitoring. Knowing the current leader helps applications make informed decisions about transaction timing and submission.

Parameters

#TypeRequiredDescription
1objectNoConfiguration object

Configuration object fields:

FieldTypeDescription
commitmentstringCommitment level: processed, confirmed, or finalized
minContextSlotnumberMinimum slot at which the request can be evaluated

Response

Returns a single value:

FieldTypeDescription
resultstringBase-58 encoded identity public key of the current slot leader

Code Examples

cURL

Terminal
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getSlotLeader",
  "params": [
    { "commitment": "finalized" }
  ]
}'

TypeScript

TypeScript
const response = await fetch("http://88.216.36.108:7999", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getSlotLeader",
    params: [
      { commitment: "finalized" }
    ]
  }),
});
const { result } = await response.json();
console.log("Current leader:", result);

Python

Python
import requests

response = requests.post("http://88.216.36.108:7999", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getSlotLeader",
    "params": [
        {"commitment": "finalized"}
    ]
})
result = response.json()["result"]
print(f"Current leader: {result}")

Rust

Rust
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client.post("http://88.216.36.108:7999")
        .json(&json!({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "getSlotLeader",
            "params": [
                {"commitment": "finalized"}
            ]
        }))
        .send().await?
        .text().await?;
    println!("{}", res);
    Ok(())
}

Example Response

JSON
{
  "jsonrpc": "2.0",
  "result": "ENvAW7JScgYq6o4MZbs5mu5jJzyzHRcK8rLjnT2rJEGX",
  "id": 1
}