GET /v1/data/position/aave/liquidationDistance/source
The source and its sourceId
Free
GET /v1/data/position/aave/liquidationDistance/dry-run
A status-only run on one node, no value
Free
# The source these parameters build, and its sourceId (free)curl "https://gateway.molpha.io/v1/data/position/aave/liquidationDistance/source?chain=ethereum&user=0xedfa9614cb7c2b52b5180294d7736abb50dfbac1"# The signed value with a sign-in session (without one, the answer is the x402 quote)curl -H "Authorization: Bearer $MOLPHA_SESSION" "https://gateway.molpha.io/v1/data/position/aave/liquidationDistance?chain=ethereum&user=0xedfa9614cb7c2b52b5180294d7736abb50dfbac1"
Authorizations
BearerAuthX402Payment
Authorization
string
header
required
Session token from POST /v1/session (sign in with the subscription owner's or a delegate's wallet). Each value uses one round of the plan's quota.
Query Parameters
chain
enum<string>
required
CAIP-2 id or alias (EVM chains)
Available options:
ethereum,
eip155:1,
sepolia,
eip155:11155111,
eip155:137,
eip155:143,
arbitrum,
eip155:42161,
bnb,
eip155:56,
base,
eip155:8453,
base-sepolia,
eip155:84532,
hyperevm,
eip155:999
finality
string
default:final
"final" or "fast", or a raw mode: "finalized", "safe", "confirmations:" (EVM, Starknet), "confirmed" (Solana)
market
enum<string>
default:aave-v3
the lending market
Available options:
aave-v3,
hyperlend,
spark
user
string
required
the account
signaturesRequired
integer
default:3
Signatures the round needs (default 3). Tolerance-mode sources need at least 3; the gateway bounds it by the protocol minimum, your plan and the live nodes.
Required range: 1 <= x <= 255
Response
The threshold-signed value (data.attestation) and its rendering (data.value); Molpha-Source-Id names the derived source.
data
object
Hide child attributes
data.attestation
object
Hide child attributes
data.attestation.payload
object
Hide child attributes
data.attestation.payload.registryVersion
integer
Example:
42
data.attestation.payload.signaturesRequired
integer
Example:
18
data.attestation.payload.sourceId
string
Example:
"0xabc123..."
data.attestation.payload.timestamp
integer
Gateway-assigned round time in unix milliseconds: the start of the round's 100 ms tick.
Example:
1700100000000
data.attestation.payload.value
string
Value is the fixed 32-byte packed attestation value (exact uint256 or tolerance int256).
Example:
"42150125000000..."
data.attestation.signature
object
Hide child attributes
data.attestation.signature.commitment
string
Example:
"02..."
data.attestation.signature.signature
string
Example:
"01..."
data.attestation.signature.signersBitmap
string
data.fresh
boolean
Example:
true
data.outcome
string
Outcome is present for a source with a policy (node-client docs/policy.md): conclusive, the
value is the source's result; or fallback, the policy concluded INCONCLUSIVE (reason) and the
value is its declared fallback. Both are signed under the source's ID. The label is the nodes'
word: what a consumer can rely on is the signed value compared with the declared fallback.
Example:
"fallback"
data.reason
string
Example:
"0x01"
data.roundId
string
RoundID is the round's ID: requests for one feed in one 100 ms tick share it. The read service
serves the round's archive record, and for a source with a policy each node's receipt, under it
(GET /v1/rounds/{roundId}).
Example:
"5f1c..."
data.value
string
Value is the decimal rendering of payload.value (trailing zeros trimmed), not signed.
Example:
"42150125000000"
data.valuePreimage
string
ValuePreimage is the 0x-prefixed hex of the bytes the source's keccak256 output hashed to
payload.value. It is present only for such a source, and the response is its only copy: the
signed value is the hash. Hash it to check, and pass it as the raw value when submitting the
attestation to Solana.
Example:
"0x68656c6c6f"
status
string
Example:
"completed"
{"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":"data/api/position-aave-liquidation-distance","slug":"/data/api/position-aave-liquidation-distance","pageMetadata":{"title":"Aave v3 distance to liquidation","sidebarTitle":"Aave v3 distance to liquidation","openapi":"data-openapi.json GET /v1/data/position/aave/liquidationDistance","description":"How far an account's collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor.\n\n**Returns:** a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt\n\n- All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them.\n\n- An account with debt and no collateral reads 0.\n\nA signed round on the derived source: see the document's description for paying with a session or x402.","href":"/data/api/position-aave-liquidation-distance"},"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 li: \"li\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"How far an account’s collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Returns:\"\n }), \" a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"\\n\", _jsx(_components.p, {\n children: \"All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them.\"\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"\\n\", _jsx(_components.p, {\n children: \"An account with debt and no collateral reads 0.\"\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"A signed round on the derived source: see the document’s description for paying with a session or x402.\"\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`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Template `,_jsx(_components.code,{children:`position.aave.liquidationDistance@1`}),` · Position · distance to liquidation · reads EVM`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Route`}),_jsx(_components.th,{children:`Answer`}),_jsx(_components.th,{children:`Cost`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/data/position/aave/liquidationDistance`})}),_jsxs(_components.td,{children:[`The threshold-signed value (`,_jsx(_components.a,{href:`/data/signed-reads`,children:`Signed reads`}),`)`]}),_jsx(_components.td,{children:`One round: x402 or one unit of your plan`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/data/position/aave/liquidationDistance/source`})}),_jsxs(_components.td,{children:[`The source and its `,_jsx(_components.code,{children:`sourceId`})]}),_jsx(_components.td,{children:`Free`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/data/position/aave/liquidationDistance/dry-run`})}),_jsx(_components.td,{children:`A status-only run on one node, no value`}),_jsx(_components.td,{children:`Free`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# The source these parameters build, and its sourceId (free)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://gateway.molpha.io/v1/data/position/aave/liquidationDistance/source?chain=ethereum\u0026user=0xedfa9614cb7c2b52b5180294d7736abb50dfbac1\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# The signed value with a sign-in session (without one, the answer is the x402 quote)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MOLPHA_SESSION`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://gateway.molpha.io/v1/data/position/aave/liquidationDistance?chain=ethereum\u0026user=0xedfa9614cb7c2b52b5180294d7736abb50dfbac1\"`})]}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Aave v3 distance to liquidation","sidebarTitle":"Aave v3 distance to liquidation","openapi":"data-openapi.json GET /v1/data/position/aave/liquidationDistance","description":"How far an account's collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor.\n\n**Returns:** a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt\n\n- All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them.\n\n- An account with debt and no collateral reads 0.\n\nA signed round on the derived source: see the document's description for paying with a session or x402.","href":"/data/api/position-aave-liquidation-distance"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"How far an account's collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor.\n\n**Returns:** a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt\n\n- All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them.\n\n- An account with debt and no collateral reads 0.\n\nA signed round on the derived source: see the document's description for paying with a session or x402.","operationId":"position.aave.liquidationDistance","parameters":["0d4667e4-aa5a-4997-b875-c299722b494e","58fe9766-2de2-4133-abca-850ce4470ddd","c11c0d3f-7442-4e3d-aa83-e5e3251e26b4","602856f0-f80d-47b9-bbcf-eecf5fec7ab3","461c84ba-70da-4cd6-8499-b7aa748dbc96"],"responses":{"200":"73d71175-5a05-4dbf-8a4e-825b33be4076","400":"dab11314-b3df-485f-83bf-649278bca302","401":"32a48f3f-0c34-4ad4-b2fd-94ddb7485da4","402":"f46b3bc1-10b5-418a-ac27-d4f20152d10b","403":"4cdf85b6-57ef-4e02-af8e-f0440422cbe5","409":"1475c7d8-5076-40a9-9c39-a79300fe8cc0","422":"5ac4f188-cbe5-4d82-a10f-b952b807c3fa","429":"6e5b2ace-0304-4aaa-8c1d-7e41dda02c72","503":"bcfd528c-1dea-4771-84fa-e97d0928990e","default":"e22527f3-3e0d-420e-a48d-b0b0c5f31ca4"},"security":["ca6c3142-0ceb-46db-bc91-74a4056b486e","8f3912d7-0a57-4d81-8b2f-deae6d50c485"],"summary":"Aave v3 distance to liquidation","tags":["Position"],"x-molpha":{"caveats":["All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them.","An account with debt and no collateral reads 0."],"chains":["eip155:1","eip155:11155111","eip155:137","eip155:143","eip155:42161","eip155:56","eip155:8453","eip155:84532","eip155:999"],"class":"Position · distance to liquidation","example":{"chain":"ethereum","user":"0xedfa9614cb7c2b52b5180294d7736abb50dfbac1"},"id":"position.aave.liquidationDistance","kinds":["evm"],"notices":[],"paths":{"dryRun":"/v1/data/position/aave/liquidationDistance/dry-run","source":"/v1/data/position/aave/liquidationDistance/source","value":"/v1/data/position/aave/liquidationDistance"},"returns":"a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt","summary":"How far an account's collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor.","template":"position.aave.liquidationDistance@1","title":"Aave v3 distance to liquidation","version":1},"method":"get","type":"path","servers":["79510351-e0f7-4cb9-9869-b7bb911657f8"],"path":"/v1/data/position/aave/liquidationDistance","baseUrlOptions":["https://gateway.molpha.io"],"title":"Aave v3 distance to liquidation","codeSamples":[],"requestExampleLanguages":["bash","javascript","python","go"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[]},"dependencies":{"parameters":{"0d4667e4-aa5a-4997-b875-c299722b494e":{"description":"CAIP-2 id or alias (EVM chains)","example":"ethereum","in":"query","name":"chain","required":true,"schema":{"enum":["ethereum","eip155:1","sepolia","eip155:11155111","eip155:137","eip155:143","arbitrum","eip155:42161","bnb","eip155:56","base","eip155:8453","base-sepolia","eip155:84532","hyperevm","eip155:999"],"type":"string","isRequired":true,"description":"CAIP-2 id or alias (EVM chains)","uniqueKey":"","typeLabel":"enum\u003cstring>"},"x-molpha-type":"chain"},"58fe9766-2de2-4133-abca-850ce4470ddd":{"description":"\"final\" or \"fast\", or a raw mode: \"finalized\", \"safe\", \"confirmations:\u003cn>\" (EVM, Starknet), \"confirmed\" (Solana)","in":"query","name":"finality","required":false,"schema":{"default":"final","type":"string","isRequired":false,"description":"\"final\" or \"fast\", or a raw mode: \"finalized\", \"safe\", \"confirmations:\u003cn>\" (EVM, Starknet), \"confirmed\" (Solana)","uniqueKey":"","typeLabel":"string"},"x-molpha-type":"finality"},"c11c0d3f-7442-4e3d-aa83-e5e3251e26b4":{"description":"the lending market","in":"query","name":"market","required":false,"schema":{"default":"aave-v3","enum":["aave-v3","hyperlend","spark"],"type":"string","isRequired":false,"description":"the lending market","uniqueKey":"","typeLabel":"enum\u003cstring>"},"x-molpha-type":"enum"},"602856f0-f80d-47b9-bbcf-eecf5fec7ab3":{"description":"the account","example":"0xedfa9614cb7c2b52b5180294d7736abb50dfbac1","in":"query","name":"user","required":true,"schema":{"type":"string","isRequired":true,"description":"the account","uniqueKey":"","typeLabel":"string"},"x-molpha-type":"address"},"461c84ba-70da-4cd6-8499-b7aa748dbc96":{"description":"Signatures the round needs (default 3). Tolerance-mode sources need at least 3; the gateway bounds it by the protocol minimum, your plan and the live nodes.","in":"query","name":"signaturesRequired","required":false,"schema":{"default":3,"maximum":255,"minimum":1,"type":"integer","isRequired":false,"description":"Signatures the round needs (default 3). Tolerance-mode sources need at least 3; the gateway bounds it by the protocol minimum, your plan and the live nodes.","uniqueKey":"","typeLabel":"integer"}}},"responses":{"73d71175-5a05-4dbf-8a4e-825b33be4076":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"attestation":{"properties":{"payload":{"properties":{"registryVersion":{"example":42,"type":"integer","uniqueKey":"data.attestation.payload.registryVersion","typeLabel":"integer"},"signaturesRequired":{"example":18,"type":"integer","uniqueKey":"data.attestation.payload.signaturesRequired","typeLabel":"integer"},"sourceId":{"example":"0xabc123...","type":"string","uniqueKey":"data.attestation.payload.sourceId","typeLabel":"string"},"timestamp":{"description":"Gateway-assigned round time in unix milliseconds: the start of the round's 100 ms tick.","example":1700100000000,"type":"integer","uniqueKey":"data.attestation.payload.timestamp","typeLabel":"integer"},"value":{"description":"Value is the fixed 32-byte packed attestation value (exact uint256 or tolerance int256).","example":"42150125000000...","type":"string","uniqueKey":"data.attestation.payload.value","typeLabel":"string"}},"type":"object","uniqueKey":"data.attestation.payload","typeLabel":"object"},"signature":{"properties":{"commitment":{"example":"02...","type":"string","uniqueKey":"data.attestation.signature.commitment","typeLabel":"string"},"signature":{"example":"01...","type":"string","uniqueKey":"data.attestation.signature.signature","typeLabel":"string"},"signersBitmap":{"type":"string","uniqueKey":"data.attestation.signature.signersBitmap","typeLabel":"string"}},"type":"object","uniqueKey":"data.attestation.signature","typeLabel":"object"}},"type":"object","uniqueKey":"data.attestation","typeLabel":"object"},"fresh":{"example":true,"type":"boolean","uniqueKey":"data.fresh","typeLabel":"boolean"},"outcome":{"description":"Outcome is present for a source with a policy (node-client docs/policy.md): conclusive, the\nvalue is the source's result; or fallback, the policy concluded INCONCLUSIVE (reason) and the\nvalue is its declared fallback. Both are signed under the source's ID. The label is the nodes'\nword: what a consumer can rely on is the signed value compared with the declared fallback.","example":"fallback","type":"string","uniqueKey":"data.outcome","typeLabel":"string"},"reason":{"example":"0x01","type":"string","uniqueKey":"data.reason","typeLabel":"string"},"roundId":{"description":"RoundID is the round's ID: requests for one feed in one 100 ms tick share it. The read service\nserves the round's archive record, and for a source with a policy each node's receipt, under it\n(GET /v1/rounds/{roundId}).","example":"5f1c...","type":"string","uniqueKey":"data.roundId","typeLabel":"string"},"value":{"description":"Value is the decimal rendering of payload.value (trailing zeros trimmed), not signed.","example":"42150125000000","type":"string","uniqueKey":"data.value","typeLabel":"string"},"valuePreimage":{"description":"ValuePreimage is the 0x-prefixed hex of the bytes the source's keccak256 output hashed to\npayload.value. It is present only for such a source, and the response is its only copy: the\nsigned value is the hash. Hash it to check, and pass it as the raw value when submitting the\nattestation to Solana.","example":"0x68656c6c6f","type":"string","uniqueKey":"data.valuePreimage","typeLabel":"string"}},"type":"object","uniqueKey":"data","typeLabel":"object"},"status":{"example":"completed","type":"string","uniqueKey":"status","typeLabel":"string"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"data":{"attestation":{"payload":{"registryVersion":42,"signaturesRequired":18,"sourceId":"0xabc123...","timestamp":1700100000000,"value":"42150125000000..."},"signature":{"commitment":"02...","signature":"01...","signersBitmap":"\u003cstring>"}},"fresh":true,"outcome":"fallback","reason":"0x01","roundId":"5f1c...","value":"42150125000000","valuePreimage":"0x68656c6c6f"},"status":"completed"}}},"exampleType":"generated"}},"description":"The threshold-signed value (`data.attestation`) and its rendering (`data.value`); `Molpha-Source-Id` names the derived source.","exampleType":"generated"},"dab11314-b3df-485f-83bf-649278bca302":{"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"}},"description":"The round request was refused (for example `signaturesRequired` below the protocol minimum); a malformed query is the data error body","exampleType":"generated"},"32a48f3f-0c34-4ad4-b2fd-94ddb7485da4":{"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"}},"description":"The session token is unknown, expired or revoked","exampleType":"generated"},"f46b3bc1-10b5-418a-ac27-d4f20152d10b":{"content":{"application/json":{"schema":{"properties":{"accepts":{"items":{"properties":{"amount":{"type":"string","uniqueKey":"accepts.items.[INDEX].amount","typeLabel":"string"},"asset":{"type":"string","uniqueKey":"accepts.items.[INDEX].asset","typeLabel":"string"},"extra":{"additionalProperties":{"type":"string","uniqueKey":"accepts.items.[INDEX].extra.additionalProperties","typeLabel":"string"},"type":"object","uniqueKey":"accepts.items.[INDEX].extra","typeLabel":"object"},"maxTimeoutSeconds":{"type":"integer","uniqueKey":"accepts.items.[INDEX].maxTimeoutSeconds","typeLabel":"integer"},"network":{"type":"string","uniqueKey":"accepts.items.[INDEX].network","typeLabel":"string"},"payTo":{"type":"string","uniqueKey":"accepts.items.[INDEX].payTo","typeLabel":"string"},"scheme":{"type":"string","uniqueKey":"accepts.items.[INDEX].scheme","typeLabel":"string"}},"type":"object","uniqueKey":"accepts.items.[INDEX]","typeLabel":"object"},"type":"array","uniqueKey":"accepts","typeLabel":"object[]"},"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"extensions":{"type":"object","description":"Extensions carries non-Molpha payment terms, currently the relayed\nupstream-source quote. It never affects the accepted-requirements\nbyte comparison performed by Decode.","properties":{"upstream":{"properties":{"eligibleSetSize":{"type":"integer","uniqueKey":"extensions.upstream.eligibleSetSize","typeLabel":"integer"},"error":{"type":"string","uniqueKey":"extensions.upstream.error","typeLabel":"string"},"nodeCount":{"type":"integer","uniqueKey":"extensions.upstream.nodeCount","typeLabel":"integer"},"provider":{"description":"Provider names the integrated provider whose paid host this is, when it is one.","type":"string","uniqueKey":"extensions.upstream.provider","typeLabel":"string"},"redundancyBuffer":{"type":"integer","uniqueKey":"extensions.upstream.redundancyBuffer","typeLabel":"integer"},"resource":{"type":"string","uniqueKey":"extensions.upstream.resource","typeLabel":"string"},"signaturesRequired":{"type":"integer","uniqueKey":"extensions.upstream.signaturesRequired","typeLabel":"integer"},"supportedX402Versions":{"items":{"type":"integer","uniqueKey":"extensions.upstream.supportedX402Versions.items.[INDEX]","typeLabel":"integer"},"type":"array","uniqueKey":"extensions.upstream.supportedX402Versions","typeLabel":"integer[]"}},"type":"object","uniqueKey":"extensions.upstream","typeLabel":"object"}},"uniqueKey":"extensions","typeLabel":"object"},"resource":{"properties":{"description":{"type":"string","uniqueKey":"resource.description","typeLabel":"string"},"mimeType":{"type":"string","uniqueKey":"resource.mimeType","typeLabel":"string"},"url":{"type":"string","uniqueKey":"resource.url","typeLabel":"string"}},"type":"object","uniqueKey":"resource","typeLabel":"object"},"x402Version":{"type":"integer","uniqueKey":"x402Version","typeLabel":"integer"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"accepts":[{"amount":"\u003cstring>","asset":"\u003cstring>","extra":{},"maxTimeoutSeconds":123,"network":"\u003cstring>","payTo":"\u003cstring>","scheme":"\u003cstring>"}],"error":"\u003cstring>","extensions":{"upstream":{"eligibleSetSize":123,"error":"\u003cstring>","nodeCount":123,"provider":"\u003cstring>","redundancyBuffer":123,"resource":"\u003cstring>","signaturesRequired":123,"supportedX402Versions":[123]}},"resource":{"description":"\u003cstring>","mimeType":"\u003cstring>","url":"\u003cstring>"},"x402Version":123}}},"exampleType":"generated"}},"description":"No session and no payment: the x402 quote. Pay it and send the same request with `PAYMENT-SIGNATURE`","headers":{"PAYMENT-REQUIRED":{"description":"Base64 x402 v2 payment requirements","schema":{"type":"string"}}},"exampleType":"generated"},"4cdf85b6-57ef-4e02-af8e-f0440422cbe5":{"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"}},"description":"The subscription is inactive, the delegate is not authorized, or the term's quota is spent","exampleType":"generated"},"1475c7d8-5076-40a9-9c39-a79300fe8cc0":{"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"}},"description":"You already have a round for this source and quorum in this 100 ms tick; retry one tick later","exampleType":"generated"},"5ac4f188-cbe5-4d82-a10f-b952b807c3fa":{"description":"A parameter is wrong, or the chain shows it names something else","content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"example":"PARAM_INVALID","type":"string","uniqueKey":"error.code","typeLabel":"string"},"input":{"type":"string","uniqueKey":"error.input","typeLabel":"string"},"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"stage":{"type":"string","uniqueKey":"error.stage","typeLabel":"string"}},"type":"object","uniqueKey":"error","typeLabel":"object"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"PARAM_INVALID","input":"\u003cstring>","message":"\u003cstring>","stage":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"6e5b2ace-0304-4aaa-8c1d-7e41dda02c72":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"example":"PARAM_INVALID","type":"string","uniqueKey":"error.code","typeLabel":"string"},"input":{"type":"string","uniqueKey":"error.input","typeLabel":"string"},"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"stage":{"type":"string","uniqueKey":"error.stage","typeLabel":"string"}},"type":"object","uniqueKey":"error","typeLabel":"object"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"PARAM_INVALID","input":"\u003cstring>","message":"\u003cstring>","stage":"\u003cstring>"}}}},"exampleType":"generated"}},"description":"Too many new derivations from this address, or too many rounds for this consumer; retry after Retry-After","exampleType":"generated"},"bcfd528c-1dea-4771-84fa-e97d0928990e":{"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"}},"description":"No quorum could form now, the gateway is at capacity, or a fact could not be read; retry after Retry-After","exampleType":"generated"},"e22527f3-3e0d-420e-a48d-b0b0c5f31ca4":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"example":"PARAM_INVALID","type":"string","uniqueKey":"error.code","typeLabel":"string"},"input":{"type":"string","uniqueKey":"error.input","typeLabel":"string"},"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"stage":{"type":"string","uniqueKey":"error.stage","typeLabel":"string"}},"type":"object","uniqueKey":"error","typeLabel":"object"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"PARAM_INVALID","input":"\u003cstring>","message":"\u003cstring>","stage":"\u003cstring>"}}}},"exampleType":"generated"}},"description":"Data error body","exampleType":"generated"}},"security":{"ca6c3142-0ceb-46db-bc91-74a4056b486e":{"BearerAuth":{"description":"Session token from `POST /v1/session` (sign in with the subscription owner's or a delegate's wallet). Each value uses one round of the plan's quota.","scheme":"bearer","type":"http","scopes":[],"schemeName":"BearerAuth"}},"8f3912d7-0a57-4d81-8b2f-deae6d50c485":{"X402Payment":{"description":"Base64 x402 v2 payment payload for the quote a request without it receives (`402`, `PAYMENT-REQUIRED`).","in":"header","name":"PAYMENT-SIGNATURE","type":"apiKey","scopes":[],"schemeName":"X402Payment"}}},"servers":{"79510351-e0f7-4cb9-9869-b7bb911657f8":{"url":"https://gateway.molpha.io","description":"Molpha gateway (Solana devnet release)"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"description":"Session token from `POST /v1/session` (sign in with the subscription owner's or a delegate's wallet). Each value uses one round of the plan's quota.","scheme":"bearer","type":"http","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Session token from `POST /v1/session` (sign in with the subscription owner's or a delegate's wallet). Each value uses one round of the plan's quota.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"},{"schemes":[{"scheme":{"description":"Base64 x402 v2 payment payload for the quote a request without it receives (`402`, `PAYMENT-REQUIRED`).","in":"header","name":"PAYMENT-SIGNATURE","type":"apiKey","scopes":[],"schemeName":"X402Payment"},"schema":{"title":"PAYMENT-SIGNATURE","type":"string","description":"Base64 x402 v2 payment payload for the quote a request without it receives (`402`, `PAYMENT-REQUIRED`).","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"X402Payment","name":"PAYMENT-SIGNATURE"}],"title":"X402Payment"}]},"originalFileLocation":"data-openapi.json"},"subdomain":"molpha","siteName":"Molpha","title":"Aave v3 distance to liquidation - Molpha","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-30T22:09:09.605Z","originalFileLocation":"data/api/position-aave-liquidation-distance.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=\"How far an account\u0026#x27;s collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor. Returns: a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt - All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them. - An account with debt and no collateral reads 0. A signed round on the derived source: see the document\u0026#x27;s description for paying with a session or x402.\">\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=\"Aave v3 distance to liquidation - Molpha\">\u003cmeta data-mint-head property=\"og:description\" content=\"How far an account\u0026#x27;s collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor. Returns: a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt - All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them. - An account with debt and no collateral reads 0. A signed round on the derived source: see the document\u0026#x27;s description for paying with a session or x402.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Molpha Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.molpha.io/data/api/position-aave-liquidation-distance\">\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=Position\u0026amp;title=Aave+v3+distance+to+liquidation\u0026amp;description=How+far+an+account%27s+collateral+value+can+fall%2C+debt+unchanged%2C+before+the+position+can+be+liquidated%3A+1+-+1%2FhealthFactor.%0A%0A**Returns%3A**+a+fraction%2C+18+decimals\u0026amp;theme=31c325c332ddb0c6aed47a08\u0026amp;signature=1406a1bf6a877fc7be760c3b3915739a7bb1a177c28d65253f4147d7c83cf541\">\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=\"Aave v3 distance to liquidation - Molpha\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How far an account\u0026#x27;s collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor. Returns: a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt - All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them. - An account with debt and no collateral reads 0. A signed round on the derived source: see the document\u0026#x27;s description for paying with a session or x402.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://molpha.mintlify.site/_mintlify/api/og/v2?division=Position\u0026amp;title=Aave+v3+distance+to+liquidation\u0026amp;description=How+far+an+account%27s+collateral+value+can+fall%2C+debt+unchanged%2C+before+the+position+can+be+liquidated%3A+1+-+1%2FhealthFactor.%0A%0A**Returns%3A**+a+fraction%2C+18+decimals\u0026amp;theme=31c325c332ddb0c6aed47a08\u0026amp;signature=1406a1bf6a877fc7be760c3b3915739a7bb1a177c28d65253f4147d7c83cf541\">\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/data/api/position-aave-liquidation-distance\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/data/api/position-aave-liquidation-distance.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/data/api/position-aave-liquidation-distance#webpage\",\"url\":\"https://docs.molpha.io/data/api/position-aave-liquidation-distance\",\"name\":\"Aave v3 distance to liquidation\",\"description\":\"How far an account's collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor. Returns: a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt - All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them. - An account with debt and no collateral reads 0. A signed round on the derived source: see the document's description for paying with a session or x402.\",\"dateModified\":\"2026-11-30T22:09:09.605Z\",\"isPartOf\":{\"@id\":\"https://docs.molpha.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.molpha.io/data/api/position-aave-liquidation-distance#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.molpha.io/data/api/position-aave-liquidation-distance#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Data templates\",\"item\":\"https://docs.molpha.io/data/api/supply-reconcile\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Position\",\"item\":\"https://docs.molpha.io/data/api/position-aave-health\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Aave v3 distance to liquidation\",\"item\":\"https://docs.molpha.io/data/api/position-aave-liquidation-distance\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.molpha.io/data/api/position-aave-liquidation-distance#apireference\",\"headline\":\"Aave v3 distance to liquidation\",\"name\":\"Aave v3 distance to liquidation\",\"description\":\"How far an account's collateral value can fall, debt unchanged, before the position can be liquidated: 1 - 1/healthFactor. Returns: a fraction, 18 decimals (int256): 0.25 means a 25% fall in all collateral; 0 or below means liquidatable now; 1 means no debt - All collateral is assumed to fall together and debt to stay put; a position with several assets can reach liquidation sooner through one of them. - An account with debt and no collateral reads 0. A signed round on the derived source: see the document's description for paying with a session or x402.\",\"url\":\"https://docs.molpha.io/data/api/position-aave-liquidation-distance\",\"mainEntityOfPage\":{\"@id\":\"https://docs.molpha.io/data/api/position-aave-liquidation-distance#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":"/data/api/position-aave-liquidation-distance.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","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","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","description":"An account's health factor on an Aave v3 (or Spark) market, from Pool.getUserAccountData.\n\n**Returns:** the health factor, 18 decimals (uint256); below 1 the position can be liquidated; 10^18 means no debt\n\n- An account without debt reads 1000000000000000000 (10^18), not Aave's type(uint256).max.\n\nA signed round on the derived source: see the document's description for paying with a session or x402.","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","description":"A user's health factor on an Aave v4 Spoke, from the Spoke's getUserAccountData.\n\n**Returns:** health factor, 18 decimals (uint256); 10^18 (as a value) when the account has no debt, as position.aave.health\n\n- A position can be liquidated below 1. An account without debt has an unbounded health factor (uint256.max on chain), signed as 10^18 as Aave v3's template does.\n\n- The health factor uses the Spoke's oracle prices and each collateral's dynamic configuration at the read's block.\n\nA signed round on the derived source: see the document's description for paying with a session or x402.","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":"Aave v3 distance to liquidation - 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"]}