> For the complete documentation index, see [llms.txt](https://docs.solanavibestation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.solanavibestation.com/api-reference/rewind/methods/simulatehistoricaltransaction.md).

# simulateHistoricalTransaction

## simulateHistoricalTransaction — Replay a transaction against archived state

> Runs a signed or unsigned transaction against the archive at a chosen position.\
> \
> \*\*Parameters\*\*\
> \
> 0\. \`transaction\` (required) — base64 (default) or base58 wire-format string. Legacy, v0 and v1 accepted.\
> 1\. \`config\` (required) — see fields below.\
> \
> \*\*Positioning.\*\* Set one of:\
> \- \`slot: N\` — end-of-slot; lookup tables and (by default) account state load at end of slot N.\
> \- \`slot: N, writeVersion: W\` — exact inside-slot boundary.\
> \- \`anchor: { signature, position }\` — immediately before or after that transaction; slot is resolved from the signature.\
> \
> Optional \`preStateSlot\` loads account state at end of a different slot than lookup tables (lookup tables still resolve at \`slot\`). Ignored with \`writeVersion\` or \`anchor\`.\
> \
> \*\*Overrides.\*\* \`accountOverrides\` is a map of base58 pubkey → override, up to \*\*64 entries\*\*. Two variants:\
> \- \*\*static\*\* — supply \`lamports\`, \`owner\`, \`data\`, optional \`executable\` / \`rentEpoch\`.\
> \- \*\*loadAt\*\* — \`{ "loadAt": { "slot" / "writeVersion" / "anchor" } }\` reads the account from the archive at that position instead of the simulation's.\
> \
> Overrides are applied last, so they always win. Sysvars, address-lookup tables and the program-data account of an upgradeable program cannot be overridden statically. A \`loadAt\` that moves an upgradeable program without moving its program-data account to the same position (or vice versa) is refused with \`-32602\` naming both accounts.<br>

```json
{"openapi":"3.0.3","info":{"title":"Rewind RPC: simulateHistoricalTransaction","version":"1.0.0"},"tags":[{"name":"Rewind","description":"Historical account state, per-write change history, and historical simulation."}],"servers":[{"url":"https://rewind.solanavibestation.com","description":"Rewind service (all tiers routed by API key)"}],"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"},"position":{"type":"string","enum":["before","after"],"default":"before"}}},"AccountOverride":{"description":"One entry in `accountOverrides`. Two variants distinguished by the presence of `loadAt`.\n","oneOf":[{"$ref":"#/components/schemas/StaticOverride"},{"$ref":"#/components/schemas/LoadAtOverride"}]},"StaticOverride":{"type":"object","required":["lamports","owner","data"],"properties":{"lamports":{"type":"integer","format":"int64"},"owner":{"type":"string"},"data":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string"},"description":"[payload, encoding] where encoding is `base64` or `base58`. Decoded payload ≤ 10 MiB."},"executable":{"type":"boolean","default":false},"rentEpoch":{"type":"integer","format":"int64","description":"Defaults to 2^64−1."}}},"LoadAtOverride":{"type":"object","required":["loadAt"],"properties":{"loadAt":{"$ref":"#/components/schemas/LoadAtSpec"}}},"LoadAtSpec":{"type":"object","description":"Same positioning vocabulary as the top-level `config`; must supply one of `slot`, `slot`+`writeVersion`, or `anchor`.","properties":{"slot":{"type":"integer","format":"int64"},"writeVersion":{"type":"integer","format":"int64"},"anchor":{"$ref":"#/components/schemas/Anchor"}}},"JsonRpcEnvelope":{"type":"object","required":["jsonrpc","id"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]}}},"SimResult":{"type":"object","required":["context","value"],"properties":{"context":{"type":"object","required":["apiVersion","slot"],"properties":{"apiVersion":{"type":"string"},"slot":{"type":"integer","format":"int64"}}},"value":{"type":"object","required":["err","logs","unitsConsumed","returnData","rewindSlot","rewindLoadSlot","rewindLoadWriteVersion","rewindOverriddenAccounts","rewindOverrideLoads"],"properties":{"err":{"nullable":true,"type":"object","additionalProperties":true,"description":"`null` on success, otherwise Solana's `TransactionError` JSON (e.g. `{\"InstructionError\":[0,{\"Custom\":1}]}`). Failed transactions still return `logs` and `unitsConsumed`."},"logs":{"type":"array","items":{"type":"string"}},"accounts":{"type":"array","nullable":true,"description":"Post-state of `config.accounts.addresses` in order; `null` entries for accounts that did not exist. Whole field `null` when `config.accounts` was omitted.","items":{"type":"object","nullable":true,"additionalProperties":true}},"unitsConsumed":{"type":"integer","format":"int64"},"returnData":{"type":"object","nullable":true,"description":"`{ \"programId\": <base58>, \"data\": [<base64>, \"base64\"] }` or `null`.","additionalProperties":true},"innerInstructions":{"type":"array","nullable":true,"description":"`null` unless requested; one entry per outer instruction that made CPIs.","items":{"type":"object","additionalProperties":true}},"rewindSlot":{"type":"integer","format":"int64","description":"Slot used for lookup-table resolution."},"rewindLoadSlot":{"type":"integer","format":"int64","description":"Position account state was loaded at. `2^64−1` means end of slot."},"rewindLoadWriteVersion":{"type":"integer","format":"int64","description":"Companion to `rewindLoadSlot`: the write-version boundary applied. `2^64−1` means end of slot."},"rewindOverriddenAccounts":{"type":"array","description":"Pubkeys whose state came from `accountOverrides`. Non-empty means the result is hypothetical.","items":{"type":"string"}},"rewindOverrideLoads":{"type":"object","description":"For each `loadAt` override: `pubkey → { loadSlot, loadWriteVersion }`.","additionalProperties":{"type":"object","properties":{"loadSlot":{"type":"integer","format":"int64"},"loadWriteVersion":{"type":"integer","format":"int64"}}}}}}}},"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":"Simulation-specific behaviour:\n\n- `-32602` Malformed transaction or config, conflicting position fields, an invalid override, a lookup table that does not exist at the position, or a program / program-data override mismatch. Message names the field.\n- `-32014` `slot` or `preStateSlot` above `latestSlot`.\n- `-32015` `slot` / `preStateSlot` below `earliestSlot`, or (rare) an account the tx needs has no archived version at the position and its earlier history has aged out (`data` names the slots).\n- `-32016` `anchor.signature` (top-level or in a `loadAt`) not indexed.\n- `-32017` The transaction invokes the Vote program, or loads a Vote-owned account (directly or via CPI). `data` names the pubkey and owner. Only a Vote account the archive has never observed reads as nonexistent instead.\n- `-32018` The load position is inside an incomplete slot and `tolerateGaps` is not set.\n- `-32603` Storage failure.\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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcErrorResponse"}}}}}},"paths":{"/":{"post":{"operationId":"simulateHistoricalTransaction","summary":"simulateHistoricalTransaction — Replay a transaction against archived state","tags":["Rewind"],"description":"Runs a signed or unsigned transaction against the archive at a chosen position.\n\n**Parameters**\n\n0. `transaction` (required) — base64 (default) or base58 wire-format string. Legacy, v0 and v1 accepted.\n1. `config` (required) — see fields below.\n\n**Positioning.** Set one of:\n- `slot: N` — end-of-slot; lookup tables and (by default) account state load at end of slot N.\n- `slot: N, writeVersion: W` — exact inside-slot boundary.\n- `anchor: { signature, position }` — immediately before or after that transaction; slot is resolved from the signature.\n\nOptional `preStateSlot` loads account state at end of a different slot than lookup tables (lookup tables still resolve at `slot`). Ignored with `writeVersion` or `anchor`.\n\n**Overrides.** `accountOverrides` is a map of base58 pubkey → override, up to **64 entries**. Two variants:\n- **static** — supply `lamports`, `owner`, `data`, optional `executable` / `rentEpoch`.\n- **loadAt** — `{ \"loadAt\": { \"slot\" / \"writeVersion\" / \"anchor\" } }` reads the account from the archive at that position instead of the simulation's.\n\nOverrides are applied last, so they always win. Sysvars, address-lookup tables and the program-data account of an upgradeable program cannot be overridden statically. A `loadAt` that moves an upgradeable program without moving its program-data account to the same position (or vice versa) is refused with `-32602` naming both accounts.\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":"The signed or unsigned transaction, base64 (default) or base58. Legacy, v0 and v1 wire formats accepted."},{"title":"config","type":"object","properties":{"slot":{"type":"integer","format":"int64","description":"End-of-slot for lookup tables and (by default) account state. Required unless `anchor` is set."},"writeVersion":{"type":"integer","format":"int64","description":"Exact inside-slot boundary for account state. Mutually exclusive with `anchor`."},"anchor":{"$ref":"#/components/schemas/Anchor"},"preStateSlot":{"type":"integer","format":"int64","description":"Load account state at end of this slot instead. Lookup tables still resolve at `slot`. Ignored with `writeVersion` or `anchor`."},"encoding":{"type":"string","enum":["base64","base58"],"default":"base64","description":"Encoding of the transaction wire bytes."},"innerInstructions":{"type":"boolean","default":false,"description":"Return the CPI trace."},"accounts":{"type":"object","required":["addresses"],"description":"Post-state of these accounts is returned in order in `value.accounts`, always base64.","properties":{"addresses":{"type":"array","items":{"type":"string"}}}},"tolerateGaps":{"type":"boolean","default":false,"description":"Accept at-or-before state from inside an incomplete slot instead of `-32018`."},"accountOverrides":{"type":"object","description":"Base58 pubkey → override, at most 64 entries. See \"Overrides\".","additionalProperties":{"$ref":"#/components/schemas/AccountOverride"}},"sigVerify":{"type":"boolean","description":"Accepted for Solana compatibility; ignored."},"replaceRecentBlockhash":{"type":"boolean","description":"Accepted for Solana compatibility; ignored."},"commitment":{"type":"string","description":"Accepted for Solana compatibility; ignored."}}}]}}}}}}},"responses":{"200":{"description":"Successful simulation.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/JsonRpcEnvelope"},{"type":"object","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/SimResult"}}}]}}}},"400":{"description":"Malformed JSON."},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"429":{"$ref":"#/components/responses/TooManyRequestsError"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```
