# simulateHistoricalTransaction

## simulateHistoricalTransaction — Replay a transaction against historical state

> Replays a transaction against the archive's account state at a specified slot. Mirrors Solana's \`simulateTransaction\` response shape, pinned to historical state.\
> \
> \*\*Parameters\*\*\
> \
> 0\. \`transaction\` (required) — base64 (default) or base58 encoded transaction.\
> 1\. \`config\` (required) — see fields below. \`slot\` is required unless \`anchor\` is provided.<br>

```json
{"openapi":"3.0.3","info":{"title":"Rewind RPC: simulateHistoricalTransaction","version":"1.0.0"},"tags":[{"name":"Rewind","description":"Historical transaction simulation."}],"servers":[{"url":"https://basic.rpc.solanavibestation.com","description":"Basic tier"},{"url":"https://ultra.rpc.solanavibestation.com","description":"Ultra tier"},{"url":"https://elite.rpc.solanavibestation.com","description":"Elite tier"},{"url":"https://epic.rpc.solanavibestation.com","description":"Epic tier"}],"security":[{},{"AuthHeader":[]},{"URLParameter":[]}],"components":{"securitySchemes":{"AuthHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Pass `Authorization: <api-key>` on each request."},"URLParameter":{"type":"apiKey","in":"query","name":"api_key","description":"Pass `?api_key=<api-key>` on the URL."}},"schemas":{"Anchor":{"type":"object","required":["signature"],"properties":{"signature":{"type":"string","description":"Base58 transaction signature. The slot is derived automatically from the archive."},"position":{"type":"string","enum":["before","after"],"default":"before"}}},"JsonRpcEnvelope":{"type":"object","required":["jsonrpc","id"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}}},"RewindContext":{"type":"object","required":["apiVersion","slot"],"properties":{"apiVersion":{"type":"string"},"slot":{"type":"integer","format":"int64","description":"The resolved query/load slot."}}},"SimulateValue":{"type":"object","required":["logs","unitsConsumed","rewindSlot","rewindLoadSlot"],"properties":{"err":{"type":"object","nullable":true,"additionalProperties":true,"description":"`null` on success; on failure, a structured `TransactionError` matching Solana's wire shape."},"logs":{"type":"array","description":"Program log stream from execution.","items":{"type":"string"}},"accounts":{"type":"array","description":"Post-state of the addresses listed in `config.accounts.addresses`, in order. Entries the tx didn't touch are emitted as null in the wire format.","items":{"type":"object","additionalProperties":true}},"unitsConsumed":{"type":"integer","format":"int64"},"returnData":{"type":"object","nullable":true,"additionalProperties":true,"description":"Program-emitted return data when set; null otherwise."},"innerInstructions":{"type":"array","description":"Present when `config.innerInstructions = true`. Each entry: `{ index, instructions[] }` — one per outer instruction that produced inner instructions.","items":{"type":"object","additionalProperties":true}},"rewindSlot":{"type":"integer","format":"int64","description":"Rewind extension. Natural slot used for ALT resolution."},"rewindLoadSlot":{"type":"integer","format":"int64","description":"Rewind extension. Slot at which non-ALT account state was loaded; equals `rewindSlot` unless `preStateSlot` overrode it."}}},"JsonRpcErrorResponse":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"error":{"$ref":"#/components/schemas/JsonRpcError"}}},"JsonRpcError":{"type":"object","required":["code","message"],"description":"Method-specific codes:\n- `-32014` `slot` past the archive's `latestSlot`.\n- `-32015` `slot` older than the archive's `earliestSlot`.\n- `-32016` `anchor.signature` not indexed in the archive.\n- `-32017` FilteredAccountStale — tx touches an account in the filter set.\n- `-32018` SlotInArchiveGap — resolved load slot inside a known MISSING/UNKNOWN gap.\n- `-32603` Internal error. Treat as transient; safe to retry.\n","properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}},"responses":{"UnauthorizedError":{"description":"Authentication required or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}},"ForbiddenError":{"description":"Insufficient permissions for the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}},"TooManyRequestsError":{"description":"Rate limit exceeded for this tier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}},"InternalServerError":{"description":"Unexpected server error. Treat as transient; safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}}}},"paths":{"/rewind":{"post":{"operationId":"simulateHistoricalTransaction","summary":"simulateHistoricalTransaction — Replay a transaction against historical state","tags":["Rewind"],"description":"Replays a transaction against the archive's account state at a specified slot. Mirrors Solana's `simulateTransaction` response shape, pinned to historical state.\n\n**Parameters**\n\n0. `transaction` (required) — base64 (default) or base58 encoded transaction.\n1. `config` (required) — see fields below. `slot` is required unless `anchor` is provided.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"method":{"type":"string","enum":["simulateHistoricalTransaction"]},"params":{"type":"array","description":"Positional parameters [transaction, config].","minItems":2,"maxItems":2,"items":{"anyOf":[{"title":"transaction","type":"string","description":"Encoded transaction (base64 by default; configurable via `config.encoding`)."},{"title":"config","type":"object","properties":{"slot":{"type":"integer","format":"int64","description":"Required unless `anchor` is provided. Slot at which to load ALTs and account state."},"anchor":{"$ref":"#/components/schemas/Anchor"},"preStateSlot":{"type":"integer","format":"int64","description":"Advanced — load non-ALT account state at this slot instead of `slot`. Common pattern `slot - 1` for \"as if this tx ran at slot start\". Ignored when `anchor` is set."},"encoding":{"type":"string","enum":["base64","base58"],"default":"base64","description":"Encoding of the transaction parameter."},"innerInstructions":{"type":"boolean","default":false},"accounts":{"type":"object","description":"Post-state of these accounts is returned in `result.value.accounts`.","required":["encoding","addresses"],"properties":{"encoding":{"type":"string","enum":["base64"]},"addresses":{"type":"array","items":{"type":"string"},"description":"Base58 pubkeys."}}},"sigVerify":{"type":"boolean","description":"Accepted for compatibility; ignored."},"replaceRecentBlockhash":{"type":"boolean","description":"Accepted for compatibility; ignored."},"commitment":{"type":"string","description":"Accepted for compatibility; ignored."},"tolerateGaps":{"type":"boolean","default":false,"description":"When `false` (default), simulations whose resolved load slot lands inside a known MISSING/UNKNOWN gap return `-32018 SlotInArchiveGap`."}}}]}}}}}}},"responses":{"200":{"description":"Successful simulation. Failed transactions still return logs and `unitsConsumed`; the application-level error is reported in `result.value.err`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/JsonRpcEnvelope"},{"type":"object","required":["result"],"properties":{"result":{"type":"object","required":["context","value"],"properties":{"context":{"$ref":"#/components/schemas/RewindContext"},"value":{"$ref":"#/components/schemas/SimulateValue"}}}}}]}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.solanavibestation.com/developers/rewind/overview/simulatehistoricaltransaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
