getFirstAvailableBlock — Solana JSON-RPC

Status: Available

Returns the slot of the lowest confirmed block that has not been purged from the ledger.

POSThttps://triport.io/sol
Network
Solana
Scope
sol_read_rpc
Auth
x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
Rate limit
free+ — free 20 / basic 60 / pro 200 / business 600 RPS sustained · up to 1200 burst; Burst capacity

Endpoint and plans: Solana RPC endpoint.

getFirstAvailableBlock returns the slot of the oldest confirmed block that is still retained in the ledger — i.e. the lower bound of the history you can currently query. Older blocks have been purged and can no longer be fetched with methods such as getBlock or getBlockTime.

Use it to discover the earliest slot you may pass to range or per-block queries before paginating forward with getBlocks. Treating any slot below this value as available will result in "block not available" errors.

Gotchas

  • Contrast with minimumLedgerSlot, which reports the lowest slot for which the node has any ledger data — that value may include slots that were never confirmed. getFirstAvailableBlock only counts confirmed blocks, so it is the correct floor for block-fetching requests.
  • The returned slot advances over time as the ledger is trimmed. Do not cache it as a permanent value; re-query before long-running backfills.

Parameters

None. The params array is empty.

——optional
This method takes no parameters.

Response

Response fields

FieldTypeDescription
resultintegerSlot number of the lowest confirmed block still retained in the ledger.

Errors

CodeMeaningWhen it happens
429Rate limit exceededMore than your tier's RPS for sol_read_rpc (free 20 / basic 60 / pro 200 / business 600); a burst up to 2× is allowed before throttling. Rejected before the RPC layer, so this is a plain HTTP error with Retry-After — not a JSON-RPC envelope.
-32601Method not recognisedThe method name was misspelled or is not in the Solana catalog.
-32602Invalid paramsA non-empty params array was sent — this method accepts no parameters.

See the shared errors reference for the full error envelope and the error.data fields.

Examples

JavaScript (fetch)

const res = await fetch("https://triport.io/sol", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getFirstAvailableBlock",
    params: [],
  }),
});


const { result } = await res.json();
console.log(`Oldest retained slot: ${result}`);

Notes

  • History floor: use this value as the lower bound when enumerating slots with getBlocks; requesting a block below it will fail.
  • minimumLedgerSlot vs. this method: minimumLedgerSlot may report a lower slot because it counts unconfirmed ledger data. Prefer getFirstAvailableBlock whenever you intend to fetch full blocks.
  • Moving target: the floor rises as the ledger is pruned — re-query it rather than caching it across a long backfill.