Fetches and evaluates a source the way a node would, without signing anything, and returns each input’s response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and stable says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with error, so the response it failed on can be shown.
A source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), secondInputs where the second run read, and a keccak256 output its preimage. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with Retry-After when no node can run it now. A private source with {{secret.NAME}} placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway’s key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with Retry-After); the gateway answers 503 with Retry-After when previews are at capacity. Nothing is signed, charged or recorded.
Fetches and evaluates a source the way a node would, without signing anything, and returns each input’s response, the decoded fields and the 32 bytes nodes would sign. Use it to check a source before you pay for a round. It is served when GET /v1/info reports preview: true, and it backs the Playground in the web app.Send {"source": {...}}, the same document as the source of an execute request.
Two runs. The source runs twice, one second apart. stable is false when the second run gave a different value or failed, and second says what it gave. A value that moves between fetches can keep nodes from agreeing in exact mode.
Failures are answers. A failure at a stage (fetch, decode, transform, assertion, encoding, policy) is a 200 with error (stage, input, message), and the response it failed on is still in inputs.
Policies. For a source with a policy, policy shows each candidate, whether it qualified, the combined value and the outcome of the first run.
Chain sources. A source whose inputs are all chain reads (evm, starknet, svm) runs on a node as a dry-run instead: each input reports the block or slot it read and its decoded fields, with no body. Only the chains in previewChains are run.
Refused with 422: a chain the gateway does not serve, a source that mixes http and chain inputs, a private source ({{secret.NAME}}), and a provider host paid per fetch (x402). The fetcher refuses loopback, private and other non-public addresses. Requests are limited per client address (429 with Retry-After); at capacity, or when no node can run a chain source, the answer is 503 with Retry-After. A body over 64 KiB is 413.Nothing is signed, charged or recorded, and a preview never pays a source.
Body
application/json
Source to preview
source
object
Source is a source document, as the source of an execute request.
Response
OK
data
object
Hide child attributes
data.error
object
Error is the stage the first fetch failed at; absent when it gave a value.
Hide child attributes
data.error.input
string
data.error.message
string
data.error.stage
string
Example:
"fetching data"
data.inputs
object[]
Hide child attributes
data.inputs.block
integer
Block is the block (evm, starknet) or slot (svm) a chain input was read at.
data.inputs.body
string
Body is the response, or the upstream's error text, as text, or hex when bodyHex is set.
data.inputs.bodyHex
boolean
data.inputs.durationMs
integer
data.inputs.error
string
Error is a chain input's own failure.
data.inputs.fields
object[]
Hide child attributes
data.inputs.fields.name
string
data.inputs.fields.type
enum<string>
Available options:
decimal,
string,
bool,
bytes,
null
data.inputs.fields.value
string
data.inputs.kind
enum<string>
Available options:
http,
evm,
starknet,
svm
data.inputs.method
string
data.inputs.name
string
data.inputs.observedAtMs
integer
ObservedAtMs is when a chain input's state was observed, unix milliseconds.
data.inputs.status
integer
the upstream's HTTP status when it refused
data.inputs.truncated
boolean
data.inputs.url
string
data.policy
object
Policy is what the source's policy concluded; absent for a source without a policy. It is set
also when the run failed, for want of a fallback (error.stage "policy inconclusive") or otherwise.
Hide child attributes
data.policy.agg
string
Agg is the combined value; absent when the combine step failed.
Example:
"65000.12"
data.policy.candidates
object[]
Hide child attributes
data.policy.candidates.error
enum<string>
Error is fetch or eval when an error disqualified the candidate.
Available options:
fetch,
eval
data.policy.candidates.errorMessage
string
data.policy.candidates.name
string
data.policy.candidates.qualified
boolean
data.policy.candidates.rule
integer
Rule is the index of the first rule that was false; absent when none was.
data.policy.candidates.value
string
Value is a qualified candidate's value; absent for a chain source.
data.policy.n
integer
N is the number of qualifying candidates.
data.policy.outcome
enum<string>
Outcome is conclusive or inconclusive; absent when the policy refused before reaching one.
Available options:
conclusive,
inconclusive
data.policy.reason
string
Reason is the INCONCLUSIVE reason code (0x01 insufficient sources, 0x02 spread, 0x03 primary
disagrees, 0x10 and up an inconclusiveIf entry); absent when conclusive.
Example:
"0x01"
data.policy.signed
boolean
Signed is true when the outcome was inconclusive and the fallback was signed: value is then the fallback.
data.second
string
Second says what the second fetch gave when it was not the same value.
data.secondInputs
object[]
SecondInputs say where the second run of a chain source read each input; absent for http sources.
Hide child attributes
data.secondInputs.block
integer
data.secondInputs.name
string
data.secondInputs.observedAtMs
integer
data.source
object
Source is the source in canonical form: what was run, and what an execute request sends.
data.sourceId
string
SourceID is the keccak256 of the canonical source, hex without 0x.
data.stable
boolean
Stable is true when a second fetch a second later encoded the same value.
data.timestampMs
integer
TimestampMs is the round timestamp the first fetch was evaluated at (unix ms on the 100 ms grid):
what $ts, $tsMs and freshness rules read. Absent for a chain source, run on a node at its own time.
Example:
1795000000500
data.value
object
Value is what nodes would sign, from the first fetch; absent when it failed.
Preimage is what a keccak256 output hashed, 0x hex; absent for other outputs.
data.value.type
string
Example:
"int256"
status
string
Example:
"ok"
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Molpha","description":"Any API. One threshold signature. Every chain. Threshold-signed data for smart contracts, backends and AI agents, verifiable on Solana, EVM and Starknet.","colors":{"primary":"#9a641f","light":"#cb852a","dark":"#8f5c1c"},"logo":{"light":"https://mintcdn.com/molpha/JodtmQOniERYvMcY/logo/logo.svg?fit=max\u0026auto=format\u0026n=JodtmQOniERYvMcY\u0026q=85\u0026s=0602b5fe95eb3b1557d5dc52b1cd31e7","dark":"https://mintcdn.com/molpha/JodtmQOniERYvMcY/logo/logo.svg?fit=max\u0026auto=format\u0026n=JodtmQOniERYvMcY\u0026q=85\u0026s=0602b5fe95eb3b1557d5dc52b1cd31e7","href":"https://molpha.io"},"favicon":"https://mintcdn.com/molpha/JodtmQOniERYvMcY/logo/favicon.svg?fit=max\u0026auto=format\u0026n=JodtmQOniERYvMcY\u0026q=85\u0026s=fdd89da20736ef39a7efc3cc50d39125","api":{"openapi":"gateway-openapi.yaml","params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","javascript","python","go"],"prefill":true,"autogenerate":true}},"navbar":{"links":[{"href":"mailto:contact@molpha.io","label":"Support"},{"icon":"github","href":"https://github.com/molpha","label":"GitHub"},{"icon":"discord","href":"https://discord.molpha.io","label":"Discord"}],"primary":{"type":"button","label":"npm","href":"https://www.npmjs.com/package/@molpha/sdk"}},"footer":{"socials":{"x":"https://x.com/molpha_oracle","discord":"https://discord.molpha.io","github":"https://github.com/molpha","linkedin":"https://www.linkedin.com/company/molpha-oracle"}},"seo":{"metatags":{"og:site_name":"Molpha Docs","twitter:card":"summary_large_image","twitter:site":"@molpha_oracle","canonical":"https://docs.molpha.io"},"organization":{"id":"https://molpha.io/#organization","name":"Molpha","url":"https://molpha.io","logo":"https://docs.molpha.io/logo/logo.svg","sameAs":["https://x.com/molpha_oracle","https://discord.molpha.io","https://github.com/molpha","https://www.linkedin.com/company/molpha-oracle"]},"indexing":"navigable"},"contextual":{"options":["copy","download-spec","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"molpha","hasAudioNarration":false,"actualSubdomain":"molpha","customDomains":["docs.molpha.io"],"gitSource":{"type":"github","owner":"molpha","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"issues":false,"agentFeedback":true},"entitlements":{},"buildId":"6b0df3fd33512c49bf76bac9","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"API reference","count":77},{"language":"default","tag":"Data templates","count":54},{"language":"default","tag":"Documentation","count":35},{"language":"default","tag":"Reference data","count":11},{"language":"default","tag":"Lending","count":11},{"language":"default","tag":"DEX","count":7},{"language":"default","tag":"Verify and publish","count":7},{"language":"default","tag":"Concepts","count":6},{"language":"default","tag":"Molpha Data API","count":6},{"language":"default","tag":"Perps","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"gateways/api/source-preview","slug":"/gateways/api/source-preview","pageMetadata":{"title":"Preview a source","sidebarTitle":"Source preview","openapi":"gateway-openapi.yaml POST /v1/source/preview","description":"Fetches and evaluates a source the way a node would, without signing anything, and returns each input's response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and `stable` says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with `error`, so the response it failed on can be shown.\n\nA source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), `secondInputs` where the second run read, and a `keccak256` output its `preimage`. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with `Retry-After` when no node can run it now. A private source with `{{secret.NAME}}` placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway's key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with `Retry-After`); the gateway answers 503 with `Retry-After` when previews are at capacity. Nothing is signed, charged or recorded.","href":"/gateways/api/source-preview"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Fetches and evaluates a source the way a node would, without signing anything, and returns each input’s response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and \", _jsx(_components.code, {\n children: \"stable\"\n }), \" says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with \", _jsx(_components.code, {\n children: \"error\"\n }), \", so the response it failed on can be shown.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"A source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), \", _jsx(_components.code, {\n children: \"secondInputs\"\n }), \" where the second run read, and a \", _jsx(_components.code, {\n children: \"keccak256\"\n }), \" output its \", _jsx(_components.code, {\n children: \"preimage\"\n }), \". A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with \", _jsx(_components.code, {\n children: \"Retry-After\"\n }), \" when no node can run it now. A private source with \", _jsx(_components.code, {\n children: \"{{secret.NAME}}\"\n }), \" placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway’s key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with \", _jsx(_components.code, {\n children: \"Retry-After\"\n }), \"); the gateway answers 503 with \", _jsx(_components.code, {\n children: \"Retry-After\"\n }), \" when previews are at capacity. Nothing is signed, charged or recorded.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components};return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Fetches and evaluates a source the way a node would, without signing anything, and returns each input’s response, the decoded fields and the 32 bytes nodes would sign. Use it to check a source before you pay for a round. It is served when `,_jsx(_components.a,{href:`/gateways/api/info`,children:_jsx(_components.code,{children:`GET /v1/info`})}),` reports `,_jsx(_components.code,{children:`preview: true`}),`, and it backs the Playground in the web app.`]}),`\n`,_jsxs(_components.p,{children:[`Send `,_jsx(_components.code,{children:`{\"source\": {...}}`}),`, the same document as the `,_jsx(_components.code,{children:`source`}),` of an execute request.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Two runs.`}),` The source runs twice, one second apart. `,_jsx(_components.code,{children:`stable`}),` is `,_jsx(_components.code,{children:`false`}),` when the second run gave a different value or failed, and `,_jsx(_components.code,{children:`second`}),` says what it gave. A value that moves between fetches can keep nodes from agreeing in exact mode.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Failures are answers.`}),` A failure at a stage (fetch, decode, transform, assertion, encoding, policy) is a `,_jsx(_components.code,{children:`200`}),` with `,_jsx(_components.code,{children:`error`}),` (`,_jsx(_components.code,{children:`stage`}),`, `,_jsx(_components.code,{children:`input`}),`, `,_jsx(_components.code,{children:`message`}),`), and the response it failed on is still in `,_jsx(_components.code,{children:`inputs`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Policies.`}),` For a source with a `,_jsx(_components.code,{children:`policy`}),`, `,_jsx(_components.code,{children:`policy`}),` shows each candidate, whether it qualified, the combined value and the outcome of the first run.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chain sources.`}),` A source whose inputs are all chain reads (`,_jsx(_components.code,{children:`evm`}),`, `,_jsx(_components.code,{children:`starknet`}),`, `,_jsx(_components.code,{children:`svm`}),`) runs on a node as a dry-run instead: each input reports the block or slot it read and its decoded fields, with no body. Only the chains in `,_jsx(_components.code,{children:`previewChains`}),` are run.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Refused with `,_jsx(_components.code,{children:`422`}),`: a chain the gateway does not serve, a source that mixes http and chain inputs, a private source (`,_jsx(_components.code,{children:`{{secret.NAME}}`}),`), and a provider host paid per fetch (x402). The fetcher refuses loopback, private and other non-public addresses. Requests are limited per client address (`,_jsx(_components.code,{children:`429`}),` with `,_jsx(_components.code,{children:`Retry-After`}),`); at capacity, or when no node can run a chain source, the answer is `,_jsx(_components.code,{children:`503`}),` with `,_jsx(_components.code,{children:`Retry-After`}),`. A body over 64 KiB is `,_jsx(_components.code,{children:`413`}),`.`]}),`\n`,_jsx(_components.p,{children:`Nothing is signed, charged or recorded, and a preview never pays a source.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Preview a source","sidebarTitle":"Source preview","openapi":"gateway-openapi.yaml POST /v1/source/preview","description":"Fetches and evaluates a source the way a node would, without signing anything, and returns each input's response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and `stable` says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with `error`, so the response it failed on can be shown.\n\nA source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), `secondInputs` where the second run read, and a `keccak256` output its `preimage`. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with `Retry-After` when no node can run it now. A private source with `{{secret.NAME}}` placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway's key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with `Retry-After`); the gateway answers 503 with `Retry-After` when previews are at capacity. Nothing is signed, charged or recorded.","href":"/gateways/api/source-preview"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"Fetches and evaluates a source the way a node would, without signing anything, and returns each input's response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and `stable` says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with `error`, so the response it failed on can be shown.\n\nA source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), `secondInputs` where the second run read, and a `keccak256` output its `preimage`. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with `Retry-After` when no node can run it now. A private source with `{{secret.NAME}}` placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway's key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with `Retry-After`); the gateway answers 503 with `Retry-After` when previews are at capacity. Nothing is signed, charged or recorded.","requestBody":"4e44210b-9e54-49ac-8612-de996e16a7d7","responses":{"200":"b3dc2f89-fcb5-44d5-9633-e3d07f699c3c","400":"c26ef5a5-9cba-4468-8ca2-1d18738edee7","422":"14e8cc66-0c51-48fe-b599-0ca2498eaea8","429":"d7fef425-8d55-4425-a0d5-830a19d5fd68","503":"04041e70-9c5a-443a-bd65-9a9caf697cd7"},"summary":"Preview a source","tags":["source"],"method":"post","type":"path","servers":["f0ea9e29-9809-4bda-a3a0-1cc20a812cd0"],"security":[],"path":"/v1/source/preview","baseUrlOptions":["https://gateway.molpha.io"],"title":"Preview a source","codeSamples":[],"requestExampleLanguages":["bash","javascript","python","go"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.source":{}}]},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"properties":{"source":{"description":"Source is a source document, as the `source` of an execute request.","type":"object","uniqueKey":"source","typeLabel":"object"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"source":{}}}},"exampleType":"generated"}},"description":"Source to preview","required":true,"exampleType":"generated"},"responses":{"b3dc2f89-fcb5-44d5-9633-e3d07f699c3c":{"description":"OK","content":{"application/json":{"schema":{"properties":{"data":{"properties":{"error":{"type":"object","description":"Error is the stage the first fetch failed at; absent when it gave a value.","properties":{"input":{"type":"string","uniqueKey":"data.error.input","typeLabel":"string"},"message":{"type":"string","uniqueKey":"data.error.message","typeLabel":"string"},"stage":{"example":"fetching data","type":"string","uniqueKey":"data.error.stage","typeLabel":"string"}},"uniqueKey":"data.error","typeLabel":"object"},"inputs":{"items":{"properties":{"block":{"description":"Block is the block (evm, starknet) or slot (svm) a chain input was read at.","type":"integer","uniqueKey":"data.inputs.items.[INDEX].block","typeLabel":"integer"},"body":{"description":"Body is the response, or the upstream's error text, as text, or hex when bodyHex is set.","type":"string","uniqueKey":"data.inputs.items.[INDEX].body","typeLabel":"string"},"bodyHex":{"type":"boolean","uniqueKey":"data.inputs.items.[INDEX].bodyHex","typeLabel":"boolean"},"durationMs":{"type":"integer","uniqueKey":"data.inputs.items.[INDEX].durationMs","typeLabel":"integer"},"error":{"description":"Error is a chain input's own failure.","type":"string","uniqueKey":"data.inputs.items.[INDEX].error","typeLabel":"string"},"fields":{"items":{"properties":{"name":{"type":"string","uniqueKey":"data.inputs.items.[INDEX].fields.items.[INDEX].name","typeLabel":"string"},"type":{"enum":["decimal","string","bool","bytes","null"],"type":"string","uniqueKey":"data.inputs.items.[INDEX].fields.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"value":{"type":"string","uniqueKey":"data.inputs.items.[INDEX].fields.items.[INDEX].value","typeLabel":"string"}},"type":"object","uniqueKey":"data.inputs.items.[INDEX].fields.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"data.inputs.items.[INDEX].fields","typeLabel":"object[]"},"kind":{"enum":["http","evm","starknet","svm"],"type":"string","uniqueKey":"data.inputs.items.[INDEX].kind","typeLabel":"enum\u003cstring>"},"method":{"type":"string","uniqueKey":"data.inputs.items.[INDEX].method","typeLabel":"string"},"name":{"type":"string","uniqueKey":"data.inputs.items.[INDEX].name","typeLabel":"string"},"observedAtMs":{"description":"ObservedAtMs is when a chain input's state was observed, unix milliseconds.","type":"integer","uniqueKey":"data.inputs.items.[INDEX].observedAtMs","typeLabel":"integer"},"status":{"description":"the upstream's HTTP status when it refused","type":"integer","uniqueKey":"data.inputs.items.[INDEX].status","typeLabel":"integer"},"truncated":{"type":"boolean","uniqueKey":"data.inputs.items.[INDEX].truncated","typeLabel":"boolean"},"url":{"type":"string","uniqueKey":"data.inputs.items.[INDEX].url","typeLabel":"string"}},"type":"object","uniqueKey":"data.inputs.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"data.inputs","typeLabel":"object[]"},"policy":{"type":"object","description":"Policy is what the source's policy concluded; absent for a source without a policy. It is set\nalso when the run failed, for want of a fallback (error.stage \"policy inconclusive\") or otherwise.","properties":{"agg":{"description":"Agg is the combined value; absent when the combine step failed.","example":"65000.12","type":"string","uniqueKey":"data.policy.agg","typeLabel":"string"},"candidates":{"items":{"properties":{"error":{"description":"Error is fetch or eval when an error disqualified the candidate.","enum":["fetch","eval"],"type":"string","uniqueKey":"data.policy.candidates.items.[INDEX].error","typeLabel":"enum\u003cstring>"},"errorMessage":{"type":"string","uniqueKey":"data.policy.candidates.items.[INDEX].errorMessage","typeLabel":"string"},"name":{"type":"string","uniqueKey":"data.policy.candidates.items.[INDEX].name","typeLabel":"string"},"qualified":{"type":"boolean","uniqueKey":"data.policy.candidates.items.[INDEX].qualified","typeLabel":"boolean"},"rule":{"description":"Rule is the index of the first rule that was false; absent when none was.","type":"integer","uniqueKey":"data.policy.candidates.items.[INDEX].rule","typeLabel":"integer"},"value":{"description":"Value is a qualified candidate's value; absent for a chain source.","type":"string","uniqueKey":"data.policy.candidates.items.[INDEX].value","typeLabel":"string"}},"type":"object","uniqueKey":"data.policy.candidates.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"data.policy.candidates","typeLabel":"object[]"},"n":{"description":"N is the number of qualifying candidates.","type":"integer","uniqueKey":"data.policy.n","typeLabel":"integer"},"outcome":{"description":"Outcome is conclusive or inconclusive; absent when the policy refused before reaching one.","enum":["conclusive","inconclusive"],"type":"string","uniqueKey":"data.policy.outcome","typeLabel":"enum\u003cstring>"},"reason":{"description":"Reason is the INCONCLUSIVE reason code (0x01 insufficient sources, 0x02 spread, 0x03 primary\ndisagrees, 0x10 and up an inconclusiveIf entry); absent when conclusive.","example":"0x01","type":"string","uniqueKey":"data.policy.reason","typeLabel":"string"},"signed":{"description":"Signed is true when the outcome was inconclusive and the fallback was signed: value is then the fallback.","type":"boolean","uniqueKey":"data.policy.signed","typeLabel":"boolean"}},"uniqueKey":"data.policy","typeLabel":"object"},"second":{"description":"Second says what the second fetch gave when it was not the same value.","type":"string","uniqueKey":"data.second","typeLabel":"string"},"secondInputs":{"description":"SecondInputs say where the second run of a chain source read each input; absent for http sources.","items":{"properties":{"block":{"type":"integer","uniqueKey":"data.secondInputs.items.[INDEX].block","typeLabel":"integer"},"name":{"type":"string","uniqueKey":"data.secondInputs.items.[INDEX].name","typeLabel":"string"},"observedAtMs":{"type":"integer","uniqueKey":"data.secondInputs.items.[INDEX].observedAtMs","typeLabel":"integer"}},"type":"object","uniqueKey":"data.secondInputs.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"data.secondInputs","typeLabel":"object[]"},"source":{"description":"Source is the source in canonical form: what was run, and what an execute request sends.","type":"object","uniqueKey":"data.source","typeLabel":"object"},"sourceId":{"description":"SourceID is the keccak256 of the canonical source, hex without 0x.","type":"string","uniqueKey":"data.sourceId","typeLabel":"string"},"stable":{"description":"Stable is true when a second fetch a second later encoded the same value.","type":"boolean","uniqueKey":"data.stable","typeLabel":"boolean"},"timestampMs":{"description":"TimestampMs is the round timestamp the first fetch was evaluated at (unix ms on the 100 ms grid):\nwhat $ts, $tsMs and freshness rules read. Absent for a chain source, run on a node at its own time.","example":1795000000500,"type":"integer","uniqueKey":"data.timestampMs","typeLabel":"integer"},"value":{"type":"object","description":"Value is what nodes would sign, from the first fetch; absent when it failed.","properties":{"decimals":{"example":8,"type":"integer","uniqueKey":"data.value.decimals","typeLabel":"integer"},"display":{"example":"67412.18","type":"string","uniqueKey":"data.value.display","typeLabel":"string"},"encoded":{"example":"0x000000000000000000000000000000000000000000000000000006219ec58280","type":"string","uniqueKey":"data.value.encoded","typeLabel":"string"},"preimage":{"description":"Preimage is what a keccak256 output hashed, 0x hex; absent for other outputs.","type":"string","uniqueKey":"data.value.preimage","typeLabel":"string"},"type":{"example":"int256","type":"string","uniqueKey":"data.value.type","typeLabel":"string"}},"uniqueKey":"data.value","typeLabel":"object"}},"type":"object","uniqueKey":"data","typeLabel":"object"},"status":{"example":"ok","type":"string","uniqueKey":"status","typeLabel":"string"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"data":{"error":{"input":"\u003cstring>","message":"\u003cstring>","stage":"fetching data"},"inputs":[{"block":123,"body":"\u003cstring>","bodyHex":true,"durationMs":123,"error":"\u003cstring>","fields":[{"name":"\u003cstring>","type":"decimal","value":"\u003cstring>"}],"kind":"http","method":"\u003cstring>","name":"\u003cstring>","observedAtMs":123,"status":123,"truncated":true,"url":"\u003cstring>"}],"policy":{"agg":"65000.12","candidates":[{"error":"fetch","errorMessage":"\u003cstring>","name":"\u003cstring>","qualified":true,"rule":123,"value":"\u003cstring>"}],"n":123,"outcome":"conclusive","reason":"0x01","signed":true},"second":"\u003cstring>","secondInputs":[{"block":123,"name":"\u003cstring>","observedAtMs":123}],"source":{},"sourceId":"\u003cstring>","stable":true,"timestampMs":1795000000500,"value":{"decimals":8,"display":"67412.18","encoded":"0x000000000000000000000000000000000000000000000000000006219ec58280","preimage":"\u003cstring>","type":"int256"}},"status":"ok"}}},"exampleType":"generated"}},"exampleType":"generated"},"c26ef5a5-9cba-4468-8ca2-1d18738edee7":{"description":"Malformed body or source","content":{"application/json":{"schema":{"properties":{"error":{"example":"validation failed","type":"string","uniqueKey":"error","typeLabel":"string"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"validation failed"}}},"exampleType":"generated"}},"exampleType":"generated"},"14e8cc66-0c51-48fe-b599-0ca2498eaea8":{"description":"A source the preview does not run","content":{"application/json":{"schema":{"properties":{"error":{"example":"validation failed","type":"string","uniqueKey":"error","typeLabel":"string"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"validation failed"}}},"exampleType":"generated"}},"exampleType":"generated"},"d7fef425-8d55-4425-a0d5-830a19d5fd68":{"description":"Too many previews from this address, or the sponsored call budget is spent","content":{"application/json":{"schema":{"properties":{"error":{"example":"validation failed","type":"string","uniqueKey":"error","typeLabel":"string"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"validation failed"}}},"exampleType":"generated"}},"exampleType":"generated"},"04041e70-9c5a-443a-bd65-9a9caf697cd7":{"description":"Previews at capacity, or no node can run a chain source now","content":{"application/json":{"schema":{"properties":{"error":{"example":"validation failed","type":"string","uniqueKey":"error","typeLabel":"string"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"validation failed"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{},"servers":{"f0ea9e29-9809-4bda-a3a0-1cc20a812cd0":{"url":"https://gateway.molpha.io","description":"Devnet"}}},"originalFileLocation":"gateway-openapi.yaml"},"subdomain":"molpha","siteName":"Molpha","title":"Preview a source - Molpha","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-30T22:09:09.605Z","originalFileLocation":"gateways/api/source-preview.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Fetches and evaluates a source the way a node would, without signing anything, and returns each input\u0026#x27;s response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and stable says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with error, so the response it failed on can be shown. A source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), secondInputs where the second run read, and a keccak256 output its preimage. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with Retry-After when no node can run it now. A private source with {{secret.NAME}} placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway\u0026#x27;s key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with Retry-After); the gateway answers 503 with Retry-After when previews are at capacity. Nothing is signed, charged or recorded.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Molpha\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Preview a source - Molpha\">\u003cmeta data-mint-head property=\"og:description\" content=\"Fetches and evaluates a source the way a node would, without signing anything, and returns each input\u0026#x27;s response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and stable says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with error, so the response it failed on can be shown. A source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), secondInputs where the second run read, and a keccak256 output its preimage. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with Retry-After when no node can run it now. A private source with {{secret.NAME}} placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway\u0026#x27;s key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with Retry-After); the gateway answers 503 with Retry-After when previews are at capacity. Nothing is signed, charged or recorded.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Molpha Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.molpha.io/gateways/api/source-preview\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://molpha.mintlify.site/_mintlify/api/og/v2?division=Sources\u0026amp;title=Preview+a+source\u0026amp;description=Fetches+and+evaluates+a+source+the+way+a+node+would%2C+without+signing+anything%2C+and+returns+each+input%27s+response%2C+the+decoded+fields+and+the+32+bytes+nodes+woul\u0026amp;theme=31c325c332ddb0c6aed47a08\u0026amp;signature=6342316cc9c79c6773741fead985152aa4daabd85944a75169dfbcb420554eb0\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Preview a source - Molpha\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Fetches and evaluates a source the way a node would, without signing anything, and returns each input\u0026#x27;s response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and stable says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with error, so the response it failed on can be shown. A source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), secondInputs where the second run read, and a keccak256 output its preimage. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with Retry-After when no node can run it now. A private source with {{secret.NAME}} placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway\u0026#x27;s key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with Retry-After); the gateway answers 503 with Retry-After when previews are at capacity. Nothing is signed, charged or recorded.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://molpha.mintlify.site/_mintlify/api/og/v2?division=Sources\u0026amp;title=Preview+a+source\u0026amp;description=Fetches+and+evaluates+a+source+the+way+a+node+would%2C+without+signing+anything%2C+and+returns+each+input%27s+response%2C+the+decoded+fields+and+the+32+bytes+nodes+woul\u0026amp;theme=31c325c332ddb0c6aed47a08\u0026amp;signature=6342316cc9c79c6773741fead985152aa4daabd85944a75169dfbcb420554eb0\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Molpha\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#9a641f\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.molpha.io/gateways/api/source-preview\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/gateways/api/source-preview.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://molpha.io/#organization\",\"name\":\"Molpha\",\"url\":\"https://molpha.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://docs.molpha.io/logo/logo.svg\"},\"sameAs\":[\"https://x.com/molpha_oracle\",\"https://discord.molpha.io\",\"https://github.com/molpha\",\"https://www.linkedin.com/company/molpha-oracle\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.molpha.io#website\",\"name\":\"Molpha\",\"url\":\"https://docs.molpha.io\",\"publisher\":{\"@id\":\"https://molpha.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.molpha.io/gateways/api/source-preview#webpage\",\"url\":\"https://docs.molpha.io/gateways/api/source-preview\",\"name\":\"Preview a source\",\"description\":\"Fetches and evaluates a source the way a node would, without signing anything, and returns each input's response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and stable says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with error, so the response it failed on can be shown. A source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), secondInputs where the second run read, and a keccak256 output its preimage. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with Retry-After when no node can run it now. A private source with {{secret.NAME}} placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway's key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with Retry-After); the gateway answers 503 with Retry-After when previews are at capacity. Nothing is signed, charged or recorded.\",\"dateModified\":\"2026-11-30T22:09:09.605Z\",\"isPartOf\":{\"@id\":\"https://docs.molpha.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.molpha.io/gateways/api/source-preview#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.molpha.io/gateways/api/source-preview#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Molpha\",\"item\":\"https://docs.molpha.io\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Preview a source\",\"item\":\"https://docs.molpha.io/gateways/api/source-preview\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.molpha.io/gateways/api/source-preview#apireference\",\"headline\":\"Preview a source\",\"name\":\"Preview a source\",\"description\":\"Fetches and evaluates a source the way a node would, without signing anything, and returns each input's response, the decoded fields and the 32 bytes nodes would sign. The source is run twice, one second apart, and stable says whether both gave the same value: a field that moves between fetches can keep nodes from agreeing. A failure at a stage (fetch, decode, transform, assertion, encoding) is a 200 with error, so the response it failed on can be shown. A source whose inputs are all chain reads (evm, starknet, svm) is run on a node instead, as a dry-run, twice a second apart: each input reports the block or slot it read and its decoded fields (no body), secondInputs where the second run read, and a keccak256 output its preimage. A chain the gateway does not serve is 422, a source that mixes http and chain inputs is 422, and 503 with Retry-After when no node can run it now. A private source with {{secret.NAME}} placeholders is 422, and a provider host paid per fetch (x402) is 422. A source on a sponsored provider route is fetched with the gateway's key, which never appears in the response. Requests that reach a non-public address are refused by the fetcher. Rate-limited per client address (429 with Retry-After); the gateway answers 503 with Retry-After when previews are at capacity. Nothing is signed, charged or recorded.\",\"url\":\"https://docs.molpha.io/gateways/api/source-preview\",\"mainEntityOfPage\":{\"@id\":\"https://docs.molpha.io/gateways/api/source-preview#webpage\"},\"dateModified\":\"2026-11-30T22:09:09.605Z\",\"publisher\":{\"@id\":\"https://molpha.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.molpha.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Molpha\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Molpha\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/gateways/api/source-preview.md","siteName":"Molpha","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API reference","groups":[{"group":"Gateway API","pages":[{"title":"Gateway API","sidebarTitle":"Overview","href":"/gateways/overview"},{"title":"Round archive","href":"/gateways/archive"}]},{"group":"Rounds","pages":[{"title":"Execute a subscription round","sidebarTitle":"Round execute","openapi":"gateway-openapi.yaml POST /v1/round/execute","href":"/gateways/api/round-execute"},{"title":"Execute an x402 pay-per-request round","sidebarTitle":"x402 execute","openapi":"gateway-openapi.yaml POST /v1/x402/execute","href":"/gateways/api/x402-execute"},{"title":"x402 payment destination and quote","sidebarTitle":"x402 status","openapi":"gateway-openapi.yaml GET /v1/x402/status","href":"/gateways/api/x402-status"}]},{"group":"Sign-in sessions","pages":[{"title":"Get a sign-in challenge","sidebarTitle":"Session challenge","openapi":"gateway-openapi.yaml GET /v1/session/challenge","href":"/gateways/api/session-challenge"},{"title":"Sign in","sidebarTitle":"Session sign-in","openapi":"gateway-openapi.yaml POST /v1/session","href":"/gateways/api/session-create"},{"title":"Session status","sidebarTitle":"Session status","openapi":"gateway-openapi.yaml GET /v1/session","href":"/gateways/api/session-status"},{"title":"Sign out","sidebarTitle":"Session sign-out","openapi":"gateway-openapi.yaml DELETE /v1/session","description":"Ends the session the bearer token belongs to. Always answers `204`, whether or not the token named a live session, so the response says nothing about which tokens exist.","href":"/gateways/api/session-delete"}]},{"group":"Sources","pages":[{"title":"Preview a source","sidebarTitle":"Source preview","openapi":"gateway-openapi.yaml POST /v1/source/preview","href":"/gateways/api/source-preview"},{"title":"Simulate a source","sidebarTitle":"Source simulate","openapi":"gateway-openapi.yaml POST /v1/source/simulate","description":"Evaluates a source over inputs the caller supplies, with the nodes' own evaluator: the policy, transform, assertions and output encoding, exactly what a node does after its inputs were read. Each input is given as an http `body` (decoded with the source's decode block, as a node decodes what it fetched), as decoded `fields` (a chain input also gives its `block`), or as an `error` (`fetch` or `decode`). Nothing is fetched, signed, charged or recorded, so a source's logic, a policy's fallback included, can be checked against any data. A refusal at a stage is a 200 with `error`; `policy` says what the policy concluded.\n\nEvery input of the source must be given; an unknown input, a malformed field or a body over 1 MiB is 400. A private source with `{{secret.NAME}}` placeholders is 422. Rate-limited per client address together with previews (429 with `Retry-After`).","href":"/gateways/api/source-simulate"}]},{"group":"Network","pages":[{"title":"Get gateway identity","sidebarTitle":"Info","openapi":"gateway-openapi.yaml GET /v1/info","href":"/gateways/api/info"},{"title":"Get on-chain nodes","sidebarTitle":"Nodes","openapi":"gateway-openapi.yaml GET /v1/nodes","href":"/gateways/api/nodes"},{"title":"List integrated providers","sidebarTitle":"Providers","openapi":"gateway-openapi.yaml GET /v1/providers","href":"/gateways/api/providers-list"},{"title":"Get an integrated provider","sidebarTitle":"Provider","openapi":"gateway-openapi.yaml GET /v1/providers/{providerId}","href":"/gateways/api/providers-get"},{"title":"Build a provider source for a symbol","sidebarTitle":"Provider source","openapi":"gateway-openapi.yaml GET /v1/providers/{providerId}/source","href":"/gateways/api/providers-source"},{"title":"Health check","sidebarTitle":"Health","openapi":"gateway-openapi.yaml GET /health","href":"/gateways/api/health"}]},{"group":"Molpha Data API","pages":[{"title":"List the chains templates read","sidebarTitle":"Chains","openapi":"data-openapi.json GET /v1/data/chains","href":"/data/api/list-chains"},{"title":"List the templates","sidebarTitle":"Catalog","openapi":"data-openapi.json GET /v1/data/catalog","href":"/data/api/list-templates"},{"title":"Get a template","sidebarTitle":"Template","openapi":"data-openapi.json GET /v1/data/catalog/{templateId}","href":"/data/api/get-template"},{"title":"Derive a template's source","sidebarTitle":"Derive","openapi":"data-openapi.json POST /v1/data/derive","href":"/data/api/derive"},{"title":"Dry-run a template's source","sidebarTitle":"Dry-run","openapi":"data-openapi.json POST /v1/data/dry-run","href":"/data/api/dry-run"},{"title":"Template API document","sidebarTitle":"OpenAPI document","openapi":"data-openapi.json GET /v1/data/openapi.json","href":"/data/api/openapi"}]},{"group":"Data templates","pages":[{"group":"Token","pages":[{"title":"Bridged supply against its lockbox","sidebarTitle":"Bridged supply against its lockbox","openapi":"data-openapi.json GET /v1/data/supply/reconcile","href":"/data/api/supply-reconcile"},{"title":"Token control flags","sidebarTitle":"Token control flags","openapi":"data-openapi.json GET /v1/data/token/controls","href":"/data/api/token-controls"},{"title":"Token snapshot","sidebarTitle":"Token snapshot","openapi":"data-openapi.json GET /v1/data/token/snapshot","href":"/data/api/token-snapshot"},{"title":"Token total supply","sidebarTitle":"Token total supply","openapi":"data-openapi.json GET /v1/data/token/supply","href":"/data/api/token-supply"}]},{"group":"Wallet","pages":[{"title":"Account balance","sidebarTitle":"Account balance","openapi":"data-openapi.json GET /v1/data/account/balance","href":"/data/api/account-balance"}]},{"group":"DEX","pages":[{"title":"Curve EMA price oracle","sidebarTitle":"Curve EMA price oracle","openapi":"data-openapi.json GET /v1/data/curve/priceOracle","href":"/data/api/curve-price-oracle"},{"title":"Ekubo pool spot price","sidebarTitle":"Ekubo pool spot price","openapi":"data-openapi.json GET /v1/data/dex/ekubo/price","href":"/data/api/dex-ekubo-price"},{"title":"Pool spot price","sidebarTitle":"Pool spot price","openapi":"data-openapi.json GET /v1/data/dex/pool/price","href":"/data/api/dex-pool-price"},{"title":"Pool reserve","sidebarTitle":"Pool reserve","openapi":"data-openapi.json GET /v1/data/dex/pool/reserves","href":"/data/api/dex-pool-reserves"},{"title":"Pool state snapshot","sidebarTitle":"Pool state snapshot","openapi":"data-openapi.json GET /v1/data/dex/pool/snapshot","href":"/data/api/dex-pool-snapshot"},{"title":"Pool TWAP price","sidebarTitle":"Pool TWAP price","openapi":"data-openapi.json GET /v1/data/dex/pool/twap","href":"/data/api/dex-pool-twap"},{"title":"Median price across pools","sidebarTitle":"Median price across pools","openapi":"data-openapi.json GET /v1/data/price/median","href":"/data/api/price-median"}]},{"group":"Lending","pages":[{"title":"Aave v3 reserve rate or index","sidebarTitle":"Aave v3 reserve rate or index","openapi":"data-openapi.json GET /v1/data/lending/aave/reserve","href":"/data/api/lending-aave-reserve"},{"title":"Aave v3 reserve totals","sidebarTitle":"Aave v3 reserve totals","openapi":"data-openapi.json GET /v1/data/lending/aave/totals","href":"/data/api/lending-aave-totals"},{"title":"Aave v4 Hub asset totals and rates","sidebarTitle":"Aave v4 Hub asset totals and rates","openapi":"data-openapi.json GET /v1/data/lending/aave4/hub","href":"/data/api/lending-aave4-hub"},{"title":"Aave v4 Spoke reserve totals","sidebarTitle":"Aave v4 Spoke reserve totals","openapi":"data-openapi.json GET /v1/data/lending/aave4/spoke","href":"/data/api/lending-aave4-spoke"},{"title":"Compound v3 market totals and rates","sidebarTitle":"Compound v3 market totals and rates","openapi":"data-openapi.json GET /v1/data/lending/compound/market","href":"/data/api/lending-compound-market"},{"title":"Euler v2 vault totals and rates","sidebarTitle":"Euler v2 vault totals and rates","openapi":"data-openapi.json GET /v1/data/lending/euler/vault","href":"/data/api/lending-euler-vault"},{"title":"Fluid Liquidity layer totals and rates","sidebarTitle":"Fluid Liquidity layer totals and rates","openapi":"data-openapi.json GET /v1/data/lending/fluid/token","href":"/data/api/lending-fluid-token"},{"title":"Kamino Lending reserve totals and rates","sidebarTitle":"Kamino Lending reserve totals and rates","openapi":"data-openapi.json GET /v1/data/lending/kamino/reserve","href":"/data/api/lending-kamino-reserve"},{"title":"marginfi bank totals and rates","sidebarTitle":"marginfi bank totals and rates","openapi":"data-openapi.json GET /v1/data/lending/marginfi/bank","href":"/data/api/lending-marginfi-bank"},{"title":"Morpho Blue market totals and rates","sidebarTitle":"Morpho Blue market totals and rates","openapi":"data-openapi.json GET /v1/data/lending/morpho/market","href":"/data/api/lending-morpho-market"},{"title":"Vesu market totals and rates","sidebarTitle":"Vesu market totals and rates","openapi":"data-openapi.json GET /v1/data/lending/vesu/market","href":"/data/api/lending-vesu-market"}]},{"group":"Position","pages":[{"title":"Aave v3 health factor","sidebarTitle":"Aave v3 health factor","openapi":"data-openapi.json GET /v1/data/position/aave/health","href":"/data/api/position-aave-health"},{"title":"Aave v3 distance to liquidation","sidebarTitle":"Aave v3 distance to liquidation","openapi":"data-openapi.json GET /v1/data/position/aave/liquidationDistance","href":"/data/api/position-aave-liquidation-distance"},{"title":"Aave v4 health factor","sidebarTitle":"Aave v4 health factor","openapi":"data-openapi.json GET /v1/data/position/aave4/health","href":"/data/api/position-aave4-health"},{"title":"Morpho Blue health factor","sidebarTitle":"Morpho Blue health factor","openapi":"data-openapi.json GET /v1/data/position/morpho/health","href":"/data/api/position-morpho-health"}]},{"group":"Yield","pages":[{"title":"Vault share price","sidebarTitle":"Vault share price","openapi":"data-openapi.json GET /v1/data/erc4626/sharePrice","href":"/data/api/erc4626-share-price"},{"title":"Liquid staking token exchange rate","sidebarTitle":"Liquid staking token exchange rate","openapi":"data-openapi.json GET /v1/data/lst/rate","href":"/data/api/lst-rate"},{"title":"Sky savings rate","sidebarTitle":"Sky savings rate","openapi":"data-openapi.json GET /v1/data/savings/sky","href":"/data/api/savings-sky"}]},{"group":"Oracle","pages":[{"title":"Two oracle prices compared","sidebarTitle":"Two oracle prices compared","openapi":"data-openapi.json GET /v1/data/oracle/compare","href":"/data/api/oracle-compare"}]},{"group":"Derived","pages":[{"title":"Pool spot against its TWAP","sidebarTitle":"Pool spot against its TWAP","openapi":"data-openapi.json GET /v1/data/dex/pool/twapDeviation","href":"/data/api/dex-pool-twap-deviation"},{"title":"LST market price against its exchange rate","sidebarTitle":"LST market price against its exchange rate","openapi":"data-openapi.json GET /v1/data/lst/marketDeviation","href":"/data/api/lst-market-deviation"},{"title":"Price feed age","sidebarTitle":"Price feed age","openapi":"data-openapi.json GET /v1/data/oracle/staleness","href":"/data/api/oracle-staleness"},{"title":"Stablecoin peg deviation","sidebarTitle":"Stablecoin peg deviation","openapi":"data-openapi.json GET /v1/data/stable/depeg","href":"/data/api/stable-depeg"}]},{"group":"Perps","pages":[{"title":"GMX v2 funding rate","sidebarTitle":"GMX v2 funding rate","openapi":"data-openapi.json GET /v1/data/perp/gmx/funding","href":"/data/api/perp-gmx-funding"},{"title":"GMX v2 open interest","sidebarTitle":"GMX v2 open interest","openapi":"data-openapi.json GET /v1/data/perp/gmx/openInterest","href":"/data/api/perp-gmx-open-interest"},{"title":"Hyperliquid funding rate","sidebarTitle":"Hyperliquid funding rate","openapi":"data-openapi.json GET /v1/data/perp/hyperliquid/funding","href":"/data/api/perp-hyperliquid-funding"},{"title":"Hyperliquid open interest","sidebarTitle":"Hyperliquid open interest","openapi":"data-openapi.json GET /v1/data/perp/hyperliquid/openInterest","href":"/data/api/perp-hyperliquid-open-interest"},{"title":"Hyperliquid position health","sidebarTitle":"Hyperliquid position health","openapi":"data-openapi.json GET /v1/data/perp/hyperliquid/positionHealth","href":"/data/api/perp-hyperliquid-position-health"},{"title":"Hyperliquid perp price","sidebarTitle":"Hyperliquid perp price","openapi":"data-openapi.json GET /v1/data/perp/hyperliquid/price","href":"/data/api/perp-hyperliquid-price"}]},{"group":"Reference data","pages":[{"title":"EIA energy series","sidebarTitle":"EIA energy series","openapi":"data-openapi.json GET /v1/data/energy/eia","href":"/data/api/energy-eia"},{"title":"Central bank reference exchange rate","sidebarTitle":"Central bank reference exchange rate","openapi":"data-openapi.json GET /v1/data/fx/reference","href":"/data/api/fx-reference"},{"title":"LEI status","sidebarTitle":"LEI status","openapi":"data-openapi.json GET /v1/data/lei/status","href":"/data/api/lei-status"},{"title":"BEA national accounts series","sidebarTitle":"BEA national accounts series","openapi":"data-openapi.json GET /v1/data/macro/bea","href":"/data/api/macro-bea"},{"title":"BLS series value","sidebarTitle":"BLS series value","openapi":"data-openapi.json GET /v1/data/macro/bls","href":"/data/api/macro-bls"},{"title":"drand quicknet randomness","sidebarTitle":"drand quicknet randomness","openapi":"data-openapi.json GET /v1/data/random/drand","href":"/data/api/random-drand"},{"title":"FOMC federal funds target range","sidebarTitle":"FOMC federal funds target range","openapi":"data-openapi.json GET /v1/data/rates/fomcTarget","href":"/data/api/rates-fomc-target"},{"title":"Overnight reference rate","sidebarTitle":"Overnight reference rate","openapi":"data-openapi.json GET /v1/data/rates/reference","href":"/data/api/rates-reference"},{"title":"Average interest rate on Treasury securities","sidebarTitle":"Average interest rate on Treasury securities","openapi":"data-openapi.json GET /v1/data/treasury/avgRate","href":"/data/api/treasury-avg-rate"},{"title":"Debt to the Penny","sidebarTitle":"Debt to the Penny","openapi":"data-openapi.json GET /v1/data/treasury/debt","href":"/data/api/treasury-debt"},{"title":"Treasury par yield curve","sidebarTitle":"Treasury par yield curve","openapi":"data-openapi.json GET /v1/data/treasury/parYield","href":"/data/api/treasury-par-yield"}]},{"group":"Chain","pages":[{"title":"Pinned block","sidebarTitle":"Pinned block","openapi":"data-openapi.json GET /v1/data/chain/head","href":"/data/api/chain-head"}]},{"group":"Raw state","pages":[{"title":"Storage slot","sidebarTitle":"Storage slot","openapi":"data-openapi.json GET /v1/data/evm/storage","href":"/data/api/evm-storage"}]}]}]},{"tab":"SDK","pages":[{"title":"SDK","href":"/sdk/overview"}]}]},"basePath":"","title":"Preview a source - Molpha","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C6Z1vAfX.js","snippetPresets-Bjd6OXRM.js","utils-QL6OhUyF.js","style-to-object-BY3JEAdk.js","utils-Dsq-HLeF.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-CEYfmkoV.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CHgPjMM8.js","_Uint8Array-IXRJ_ueo.js","isObject-FP1Yky1u.js","ApiExamples-pq4ns9YA.js","usePlaygroundInputsStore-D-gnigmo.js","shallow-DIfWGPrf.js","isEqual-DDFuixlH.js","CodeSnippets-8g5rilZj.js","CodeSnippet-C_J7pouP.js","use-playground-group-access-bkOyfPao.js","Page-B_smDgrp.js","api-description-markdown-DtcP2u3s.js","DynamicMarkdown-DOefW1_8.js","SectionHeading-Cg4lfWZw.js","MethodPill-BnqygvYm.js","getPastedJson-BGXYEZ3P.js","Check2Icon-BBeO3TOS.js","axios-CsQoIw0U.js","Markdown-D5IqLG6A.js","AssistantPageLink-_S2h4i6W.js","dist-DzZqOeCq.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}