getSlot — Solana RPC Method
getSlot returns the current slot number at the requested commitment level. This is the simplest way to check how far the node has progressed in the ledger.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
commitment | string | No | processed, confirmed, or finalized. Default: finalized. |
minContextSlot | number | No | Minimum slot at which the request can be evaluated. |
Request
curl -X POST https://api.mainnet-beta.solana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlot",
"params": []
}'
TypeScript (@solana/kit)
import { createSolanaRpc } from "@solana/kit";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const slot = await rpc.getSlot().send();
console.log(`Current slot: ${slot}`);
Response
{
"jsonrpc": "2.0",
"result": 341200000,
"id": 1
}
| Field | Type | Description |
|---|---|---|
result | u64 | The current slot number at the requested commitment level. |
Common errors
- Node behind — if
minContextSlotis higher than the node’s current slot, the request fails.
Performance
getSlot is one of the lightest RPC calls. It returns a single number from the node’s local state. Safe to poll at high frequency for monitoring.
FAQ
What is a slot? A slot is a time window (approximately 400ms) during which a designated validator (the leader) can produce a block. Each slot has a unique number that increases monotonically from genesis.
What is the difference between slot and block height? Every slot gets a number, but not every slot produces a block (some are skipped). Block height only counts slots where a block was produced. Slot number is always >= block height.
How fast do slots increment? Approximately 2.5 slots per second (one every 400ms). The actual rate varies slightly with network conditions.
Why does the slot differ by commitment level?
processed shows the latest slot the node has seen. confirmed lags by a few slots (time for supermajority votes). finalized lags further (32+ slots) as it requires the block to be part of the irreversible chain.
Can I use the slot to estimate time? Roughly. At 400ms per slot, each slot is about 0.4 seconds. For precise timestamps, use getBlockTime for a specific slot.
Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
commitment | string | No | Commitment level: processed, confirmed, or finalized. | finalized |
minContextSlot | number | No | Minimum slot at which the request can be evaluated. | — |
Updated: