minimumLedgerSlot — Solana RPC Method
minimumLedgerSlot returns the lowest slot number that the node still has in its ledger. Slots older than this have been purged and are no longer queryable on this node.
Parameters
This method takes no parameters.
Request
curl -X POST https://api.mainnet-beta.solana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "minimumLedgerSlot",
"params": []
}'
TypeScript (@solana/kit)
import { createSolanaRpc } from "@solana/kit";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const minSlot = await rpc.minimumLedgerSlot().send();
console.log(`Oldest available slot: ${minSlot}`);
Response
{
"jsonrpc": "2.0",
"result": 340800000,
"id": 1
}
| Field | Type | Description |
|---|---|---|
result | u64 | The lowest slot the node has in its ledger. |
Performance
Reads a single value from the node’s ledger metadata. Extremely lightweight.
FAQ
How is this different from getFirstAvailableBlock?
minimumLedgerSlot returns the minimum slot in the ledger, while getFirstAvailableBlock returns the first block that has not been purged. Not every slot produces a block (some are skipped), so getFirstAvailableBlock may return a higher number.
How much history does a typical node keep? Non-archival validators typically retain the last 2-3 days of ledger data. Archival nodes keep the full history from genesis.
Why would I use this? To determine the oldest data available on a given node before making historical queries. If you need a slot older than the minimum, you need an archival RPC provider.
Updated: