Prices a swap, or commits to one. Across chains a swap settles through two escrows and a solver: without
executionCondition the answer is an indicative price; with it, a firm quote with everything needed to fund it.
On one chain it settles in one transaction through the chain’s TernSwap and a DEX aggregator: indicative without
sender and recipient, firm with both.
A firm quote’s execute lists what to send: EVM transactions in order, or Starknet calls as one multicall. An
escrow quote also has a depositAddress, to which the exact from.amount can be sent from any wallet instead.
Firm quotes: repeats with the same key and body get the first response; 1 to 255 visible ASCII characters
Body
application/json
The body of POST /v1/quote. Across chains, executionCondition asks for a firm quote, which needs sender and
recipient. On one chain the quote is a swap through a DEX aggregator: firm with sender and recipient, and it
takes no executionCondition. A private swap (privacy: "shielded", Starknet only) takes neither: it is
indicative, and firm with firm: true.
Private swaps: true asks for the firm quote, with the actions for the wallet to prove. Other quotes are firm
by what they carry (executionCondition, recipient) and take no firm.
shielded: a private swap on Starknet, from the user's shielded balance in the privacy pool (STRK20) to a new
shielded note, sent by Tern's relayer. Same chain only; the request names no sender or recipient.
How far under the expected output the user accepts, in basis points: a swap reverts below it, and a cross-chain
solver commits to the expected amount less it. The server picks a default without it.
Escrows: to.amount is what the solver committed to deliver, the minimum to check before revealing. Swaps:
to.amount is the route's expected output and to.minAmount the least it delivers.
The fees' total in basis points of from.usd: from.usd − to.usd, plus the sender's own gas on the source
chain when network includes it. Everything the user gives up, when known.
What the sender's wallet pays in gas on the source chain, when known. An indicative quote with a sender
counts only the approvals that sender still needs; without one it counts the approval a token needs at most.
A private swap's is the relayer's fee in STRK, which the shielded balance pays instead of a wallet.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Tern","description":"Cross-chain and same-chain swaps on any supported chain. Every swap completes or refunds.","colors":{"primary":"#212121","light":"#F4F4F4","dark":"#212121"},"logo":{"light":"/logo/ink.svg","dark":"/logo/paper.svg","href":"https://ternswap.xyz"},"favicon":"/favicon.svg","api":{"openapi":"api-reference/openapi.json","playground":{"display":"interactive"}},"appearance":{"default":"light","strict":true},"background":{"color":{"light":"#EBEBEB","dark":"#EBEBEB"}},"navbar":{"links":[{"href":"mailto:[email protected]","label":"Contact"},{"href":"https://ternswap.xyz","label":"ternswap.xyz"}],"primary":{"type":"button","label":"Launch app","href":"https://tern-app-staging.unitlabs.xyz"}},"seo":{"metatags":{"og:image":"/images/og.png","twitter:card":"summary_large_image"}},"fonts":{"heading":{"family":"Satoshi","weight":700,"source":"fonts/Satoshi-Variable.woff2","format":"woff2"},"body":{"family":"Intrade","weight":400,"source":"fonts/Intrade-Regular.woff2","format":"woff2"}},"styling":{"codeblocks":"system"},"integrations":{"telemetry":{"enabled":false}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4110"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false,"isLoggedInCli":false,"mintExport":{}},"customCss":[{"filePath":"style.css","content":"@font-face{font-family:\"Geist Mono\";src:url(\"/fonts/GeistMono-Variable.woff2\") format(\"woff2\");font-weight:100 900;font-display:swap}@font-face{font-family:\"Satoshi\";src:url(\"/fonts/Satoshi-Variable.woff2\") format(\"woff2\");font-weight:300 900;font-display:swap}:root{--tern-ink: #212121;--tern-paper: #f4f4f4;--tern-surface: #ffffff;--tern-hairline: rgb(33 33 33 / 0.08);--tern-hairline-strong: rgb(33 33 33 / 0.16);--tern-track: rgb(33 33 33 / 0.06)}*,*::before,*::after{box-shadow:none!important;text-shadow:none!important}:focus-visible{outline:1.5px solid var(--tern-ink);outline-offset:2px}code,pre,kbd,samp,.font-mono{font-family:\"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, monospace!important}h1,h2,h3,h4{font-family:\"Satoshi\", ui-sans-serif, system-ui, sans-serif;letter-spacing:-0.01em}h1{font-weight:700}h2,h3,h4{font-weight:600}#search-bar-entry{background:var(--tern-surface)!important;border:1px solid var(--tern-hairline)!important}#sidebar a[aria-current=\"page\"],#sidebar li[data-active=\"true\"]>a{background:var(--tern-surface)!important;color:var(--tern-ink)!important;border:1px solid var(--tern-hairline)}[data-callout-type]{background:var(--tern-surface)!important;border:1px solid var(--tern-hairline)!important}[data-callout-type],[data-callout-type] *{color:var(--tern-ink)!important}[data-callout-type] svg{color:var(--tern-ink)!important;fill:currentColor}[data-callout-type=\"warning\"],[data-callout-type=\"danger\"]{border:1.5px solid var(--tern-ink)!important}pre,[data-component-part=\"code-block-root\"],.code-block,.card,[data-component-part=\"card\"]{border-color:var(--tern-hairline)!important}.method-pill,[class*=\"bg-green-400/20\"],[class*=\"bg-blue-400/20\"],[class*=\"bg-yellow-400/20\"],[class*=\"bg-orange-400/20\"],[class*=\"bg-red-400/20\"],[class*=\"bg-[#3064E3]\"]{color:var(--tern-ink)!important;border:1px solid transparent}[class*=\"bg-green-400/20\"]{background:var(--tern-surface)!important;border-color:var(--tern-hairline-strong)!important}[class*=\"bg-blue-400/20\"],[class*=\"bg-[#3064E3]\"]{background:var(--tern-ink)!important;color:var(--tern-paper)!important}[class*=\"bg-yellow-400/20\"],[class*=\"bg-orange-400/20\"]{background:var(--tern-track)!important}[class*=\"bg-red-400/20\"]{background:transparent!important;border:1px dashed var(--tern-ink)!important}.tryit-button{background:var(--tern-ink)!important;color:var(--tern-paper)!important}[data-component-part=\"field-required-pill\"]{background:var(--tern-track)!important;color:var(--tern-ink)!important}pre code,pre [class*=\"font-mono\"]{filter:grayscale(1)}html.lenis,html.lenis body{height:auto}.lenis:not(.lenis-autoToggle).lenis-stopped{overflow:clip}.lenis [data-lenis-prevent],.lenis [data-lenis-prevent-wheel],.lenis [data-lenis-prevent-touch],.lenis [data-lenis-prevent-vertical],.lenis [data-lenis-prevent-horizontal]{overscroll-behavior:contain}.lenis.lenis-smooth iframe{pointer-events:none}.lenis.lenis-autoToggle{transition-property:overflow;transition-duration:1ms;transition-behavior:allow-discrete}"}],"page":{"pagePath":"api-reference/quotes/get-a-quote","slug":"/api-reference/quotes/get-a-quote","pageMetadata":{"openapi":"/api-reference/openapi.json POST /v1/quote","description":"Prices a swap, or commits to one. Across chains a swap settles through two escrows and a solver: without\n`executionCondition` the answer is an indicative price; with it, a firm quote with everything needed to fund it.\nOn one chain it settles in one transaction through the chain's `TernSwap` and a DEX aggregator: indicative without\n`sender` and `recipient`, firm with both.\n\nA firm quote's `execute` lists what to send: EVM `transactions` in order, or Starknet `calls` as one multicall. An\nescrow quote also has a `depositAddress`, to which the exact `from.amount` can be sent from any wallet instead.","href":"/api-reference/quotes/get-a-quote","title":"Get a quote"},"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: [\"Prices a swap, or commits to one. Across chains a swap settles through two escrows and a solver: without\\n\", _jsx(_components.code, {\n children: \"executionCondition\"\n }), \" the answer is an indicative price; with it, a firm quote with everything needed to fund it.\\nOn one chain it settles in one transaction through the chain’s \", _jsx(_components.code, {\n children: \"TernSwap\"\n }), \" and a DEX aggregator: indicative without\\n\", _jsx(_components.code, {\n children: \"sender\"\n }), \" and \", _jsx(_components.code, {\n children: \"recipient\"\n }), \", firm with both.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"A firm quote’s \", _jsx(_components.code, {\n children: \"execute\"\n }), \" lists what to send: EVM \", _jsx(_components.code, {\n children: \"transactions\"\n }), \" in order, or Starknet \", _jsx(_components.code, {\n children: \"calls\"\n }), \" as one multicall. An\\nescrow quote also has a \", _jsx(_components.code, {\n children: \"depositAddress\"\n }), \", to which the exact \", _jsx(_components.code, {\n children: \"from.amount\"\n }), \" can be sent from any wallet instead.\"]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}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":{"codeStyling":"system","config":{},"pageMetadata":{"openapi":"/api-reference/openapi.json POST /v1/quote","description":"Prices a swap, or commits to one. Across chains a swap settles through two escrows and a solver: without\n`executionCondition` the answer is an indicative price; with it, a firm quote with everything needed to fund it.\nOn one chain it settles in one transaction through the chain's `TernSwap` and a DEX aggregator: indicative without\n`sender` and `recipient`, firm with both.\n\nA firm quote's `execute` lists what to send: EVM `transactions` in order, or Starknet `calls` as one multicall. An\nescrow quote also has a `depositAddress`, to which the exact `from.amount` can be sent from any wallet instead.","href":"/api-reference/quotes/get-a-quote","title":"Get a quote"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/localhost/095442d7f85c8988/smooth-scroll.js"],"openApiReferenceData":{"operation":{"tags":["quotes"],"summary":"Get a quote","description":"Prices a swap, or commits to one. Across chains a swap settles through two escrows and a solver: without\n`executionCondition` the answer is an indicative price; with it, a firm quote with everything needed to fund it.\nOn one chain it settles in one transaction through the chain's `TernSwap` and a DEX aggregator: indicative without\n`sender` and `recipient`, firm with both.\n\nA firm quote's `execute` lists what to send: EVM `transactions` in order, or Starknet `calls` as one multicall. An\nescrow quote also has a `depositAddress`, to which the exact `from.amount` can be sent from any wallet instead.","operationId":"create_quote","parameters":["3053e5f4-8853-408f-b244-06bbf8df0091"],"requestBody":"35b8a012-0d03-4609-bbfc-b58463c97e6b","responses":{"200":"1295c95d-e585-4ea5-91b1-3583ffbf2dd3","400":"6838915f-1a5c-4c4d-9666-00dc5ed1f2ce","401":"a2cbc62a-8f98-4c9a-af2e-40e366d4e6b4","409":"77ac77f0-23d0-4715-b172-04e621307315","422":"9f0ecbff-9fcf-4705-93ba-10f790954c09","429":"35916c2a-4341-43e9-b32b-29bb09fb682f","500":"a45ed3cc-77d9-4fff-aeb2-7db6a2d11e2a"},"security":["d0f1c703-1c57-473f-83d6-3a38bbf66c55","46fa81a3-7686-4238-a79c-537c9eaac53b"],"method":"post","type":"path","servers":["94e17e01-c458-4ed3-b14c-73d83eb8f534"],"path":"/v1/quote","baseUrlOptions":["https://api.ternswap.xyz"],"title":"Get a quote","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"3053e5f4-8853-408f-b244-06bbf8df0091":{"name":"Idempotency-Key","in":"header","description":"Firm quotes: repeats with the same key and body get the first response; 1 to 255 visible ASCII characters","required":false,"schema":{"oneOf":[{"type":"string","description":"Firm quotes: repeats with the same key and body get the first response; 1 to 255 visible ASCII characters","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","description":"Firm quotes: repeats with the same key and body get the first response; 1 to 255 visible ASCII characters","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"The body of `POST /v1/quote`. Across chains, `executionCondition` asks for a firm quote, which needs `sender` and\n`recipient`. On one chain the quote is a swap through a DEX aggregator: firm with `sender` and `recipient`, and it\ntakes no `executionCondition`. A private swap (`privacy: \"shielded\"`, Starknet only) takes neither: it is\nindicative, and firm with `firm: true`.","required":["from","to"],"properties":{"from":{"type":"object","description":"What the user pays.","required":["chain","asset","amount"],"properties":{"amount":{"type":"string","description":"Base units, base 10.","example":"1000000000000000000","isRequired":true,"uniqueKey":"from.amount","typeLabel":"string"},"asset":{"type":"string","description":"A token address, or `native` for an EVM chain's native coin.","example":"native","isRequired":true,"uniqueKey":"from.asset","typeLabel":"string"},"chain":{"type":"string","example":"base","isRequired":true,"uniqueKey":"from.chain","typeLabel":"string"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"from","typeLabel":"object"},"to":{"type":"object","description":"What the user receives; the solver names the amount.","required":["chain","asset"],"properties":{"asset":{"type":"string","isRequired":true,"uniqueKey":"to.asset","typeLabel":"string"},"chain":{"type":"string","example":"starknet","isRequired":true,"uniqueKey":"to.chain","typeLabel":"string"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"to","typeLabel":"object"},"executionCondition":{"oneOf":[{"type":"string","description":"SHA-256 of the client's 32-byte fulfillment, in hex. Never reuse one.","uniqueKey":"executionCondition.oneOf.0","typeLabel":"string"},{"type":"null","description":"SHA-256 of the client's 32-byte fulfillment, in hex. Never reuse one.","uniqueKey":"executionCondition.oneOf.1","typeLabel":"null"}],"uniqueKey":"executionCondition","typeLabel":"string | null"},"firm":{"type":"boolean","description":"Private swaps: `true` asks for the firm quote, with the actions for the wallet to prove. Other quotes are firm\nby what they carry (`executionCondition`, `recipient`) and take no `firm`.","uniqueKey":"firm","typeLabel":"boolean"},"privacy":{"oneOf":[{"type":"string","description":"`shielded`: a private swap on Starknet, from the user's shielded balance in the privacy pool (STRK20) to a new\nshielded note, sent by Tern's relayer. Same chain only; the request names no `sender` or `recipient`.","enum":["shielded"],"uniqueKey":"privacy.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"privacy.oneOf.1","typeLabel":"null"}],"uniqueKey":"privacy","typeLabel":"enum\u003cstring> | null"},"recipient":{"oneOf":[{"type":"string","description":"The user's address on the destination chain.","uniqueKey":"recipient.oneOf.0","typeLabel":"string"},{"type":"null","description":"The user's address on the destination chain.","uniqueKey":"recipient.oneOf.1","typeLabel":"null"}],"uniqueKey":"recipient","typeLabel":"string | null"},"sender":{"oneOf":[{"type":"string","description":"The user's refund address on the source chain.","uniqueKey":"sender.oneOf.0","typeLabel":"string"},{"type":"null","description":"The user's refund address on the source chain.","uniqueKey":"sender.oneOf.1","typeLabel":"null"}],"uniqueKey":"sender","typeLabel":"string | null"},"slippageBps":{"oneOf":[{"type":"integer","format":"int32","description":"How far under the expected output the user accepts, in basis points: a swap reverts below it, and a cross-chain\nsolver commits to the expected amount less it. The server picks a default without it.","example":50,"minimum":0,"uniqueKey":"slippageBps.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"How far under the expected output the user accepts, in basis points: a swap reverts below it, and a cross-chain\nsolver commits to the expected amount less it. The server picks a default without it.","example":50,"minimum":0,"uniqueKey":"slippageBps.oneOf.1","typeLabel":"null"}],"uniqueKey":"slippageBps","typeLabel":"integer\u003cint32> | null"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Firm":{"title":"Firm","value":{"executionCondition":"0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925","from":{"amount":"1000000","asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","chain":"base"},"recipient":"0x04a7c1e8f2d5b6a39e0c7d18b2f4e6a5c3d9b8a7f6e5d4c3b2a1908f7e6d5c4b","sender":"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266","to":{"asset":"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8","chain":"starknet"}}},"Indicative":{"title":"Indicative","value":{"from":{"amount":"1000000","asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","chain":"base"},"to":{"asset":"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8","chain":"starknet"}}},"Same-chain swap":{"title":"Same-chain swap","value":{"from":{"amount":"10000000000000000","asset":"native","chain":"base"},"recipient":"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266","sender":"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266","slippageBps":50,"to":{"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","chain":"base"}}}},"exampleType":"examples"}},"required":true,"exampleType":"examples"},"responses":{"1295c95d-e585-4ea5-91b1-3583ffbf2dd3":{"description":"An indicative or firm quote","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"`POST /v1/quote`'s answer.","required":["id","from","to","expiresAt","execute"],"properties":{"execute":{"type":"object","description":"How to fund a firm quote's source escrow, or send its swap.","properties":{"calls":{"oneOf":[{"type":"array","items":{"type":"object","description":"One call of the Starknet multicall the user's account sends.","required":["contractAddress","entrypoint","calldata"],"properties":{"calldata":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.execute.calls.oneOf.0.items.[INDEX].calldata.items.[INDEX]","typeLabel":"string"},"description":"Felts in lowercase hex.","isRequired":true,"uniqueKey":"oneOf.0.execute.calls.oneOf.0.items.[INDEX].calldata","typeLabel":"string[]"},"contractAddress":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.calls.oneOf.0.items.[INDEX].contractAddress","typeLabel":"string"},"entrypoint":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.calls.oneOf.0.items.[INDEX].entrypoint","typeLabel":"string"}},"uniqueKey":"oneOf.0.execute.calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"Starknet source: send these as one multicall.","uniqueKey":"oneOf.0.execute.calls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One call of the Starknet multicall the user's account sends.","required":["contractAddress","entrypoint","calldata"],"properties":{"calldata":{"type":"array","items":{"type":"string"},"description":"Felts in lowercase hex."},"contractAddress":{"type":"string"},"entrypoint":{"type":"string"}}},"description":"Starknet source: send these as one multicall.","uniqueKey":"oneOf.0.execute.calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.execute.calls","typeLabel":"object[] | null"},"depositAddress":{"oneOf":[{"type":"string","description":"Escrows: sending exactly `from.amount` here before `expiresAt`, from any wallet or exchange, funds the quote.\nSwaps have none: only `sender` can send them.","uniqueKey":"oneOf.0.execute.depositAddress.oneOf.0","typeLabel":"string"},{"type":"null","description":"Escrows: sending exactly `from.amount` here before `expiresAt`, from any wallet or exchange, funds the quote.\nSwaps have none: only `sender` can send them.","uniqueKey":"oneOf.0.execute.depositAddress.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.execute.depositAddress","typeLabel":"string | null"},"solana":{"oneOf":[{"type":"object","description":"Solana source: send this as one transaction.","required":["instructions","lookupTables"],"properties":{"instructions":{"type":"array","items":{"type":"object","description":"One instruction of a Solana transaction.","required":["programId","accounts","data"],"properties":{"accounts":{"type":"array","items":{"type":"object","description":"An account of a Solana instruction.","required":["pubkey","isSigner","isWritable"],"properties":{"isSigner":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions.items.[INDEX].accounts.items.[INDEX].isSigner","typeLabel":"boolean"},"isWritable":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions.items.[INDEX].accounts.items.[INDEX].isWritable","typeLabel":"boolean"},"pubkey":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions.items.[INDEX].accounts.items.[INDEX].pubkey","typeLabel":"string"}},"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions.items.[INDEX].accounts.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions.items.[INDEX].accounts","typeLabel":"object[]"},"data":{"type":"string","description":"Base64.","isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions.items.[INDEX].data","typeLabel":"string"},"programId":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions.items.[INDEX].programId","typeLabel":"string"}},"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.instructions","typeLabel":"object[]"},"lookupTables":{"type":"array","items":{"type":"object","description":"An address lookup table and the addresses it holds, in order.","required":["address","addresses"],"properties":{"address":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.lookupTables.items.[INDEX].address","typeLabel":"string"},"addresses":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.execute.solana.oneOf.0.lookupTables.items.[INDEX].addresses.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.lookupTables.items.[INDEX].addresses","typeLabel":"string[]"}},"uniqueKey":"oneOf.0.execute.solana.oneOf.0.lookupTables.items.[INDEX]","typeLabel":"object"},"description":"Address lookup tables the transaction needs to fit, with their contents, so compiling it takes no RPC call.","isRequired":true,"uniqueKey":"oneOf.0.execute.solana.oneOf.0.lookupTables","typeLabel":"object[]"}},"uniqueKey":"oneOf.0.execute.solana.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.0.execute.solana.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.execute.solana","typeLabel":"object | null"},"strk20":{"oneOf":[{"type":"object","description":"A private swap: prove these with the wallet (`strk20PrepareInvoke`) and post the result to\n`POST /v1/quote/{id}/submit`; Tern's relayer sends it.","required":["pool","actions","relayer","relayerFee"],"properties":{"actions":{"type":"array","items":{"oneOf":[{"type":"object","description":"One action of a private transaction, as the STRK20 wallet API takes it. Felts are hex; `calldata` may hold the\nwallet's placeholders (`${openNoteIds[0]}`).","required":["token","amount","recipient","type"],"properties":{"amount":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.0.amount","typeLabel":"string"},"recipient":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.0.recipient","typeLabel":"string"},"token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.0.token","typeLabel":"string"},"type":{"type":"string","enum":["withdraw"],"isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"One action of a private transaction, as the STRK20 wallet API takes it. Felts are hex; `calldata` may hold the\nwallet's placeholders (`${openNoteIds[0]}`).","required":["token","amount","recipient","type"],"properties":{"amount":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.1.amount","typeLabel":"string"},"recipient":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.1.recipient","typeLabel":"string"},"token":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.1.token","typeLabel":"string"},"type":{"type":"string","enum":["transfer"],"isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","description":"One action of a private transaction, as the STRK20 wallet API takes it. Felts are hex; `calldata` may hold the\nwallet's placeholders (`${openNoteIds[0]}`).","required":["contract","calldata","type"],"properties":{"calldata":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.2.calldata.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.2.calldata","typeLabel":"string[]"},"contract":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.2.contract","typeLabel":"string"},"type":{"type":"string","enum":["invoke"],"isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX].oneOf.2","typeLabel":"object"}],"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions.items.[INDEX]","typeLabel":"object"},"description":"The actions, in order: the amount sold withdrawn to Tern's private-swap helper, the relayer's fee in STRK\nwithdrawn to the relayer, an open note of the bought token for the user, and the helper's invoke, which swaps\nand fills that note. The server doesn't know the user's address: the note's `recipient` is\n[`Strk20Action::SELF`], for the client to replace with it before the wallet proves the actions.","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.actions","typeLabel":"object[]"},"pool":{"type":"string","description":"The privacy pool.","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.pool","typeLabel":"string"},"relayer":{"type":"string","description":"The account that sends the transaction, and receives `relayerFee`.","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.relayer","typeLabel":"string"},"relayerFee":{"type":"object","description":"What the relayer takes in STRK (fri): the pool's fee, which it pays when sending, and its gas.","required":["amount"],"properties":{"amount":{"type":"string","description":"Base units of the coin gas is paid in (wei, or fri on Starknet).","example":"3460000000000","isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.relayerFee.amount","typeLabel":"string"},"usd":{"oneOf":[{"type":"string","description":"The same in US dollars, when known.","example":"0.01","uniqueKey":"oneOf.0.execute.strk20.oneOf.0.relayerFee.usd.oneOf.0","typeLabel":"string"},{"type":"null","description":"The same in US dollars, when known.","example":"0.01","uniqueKey":"oneOf.0.execute.strk20.oneOf.0.relayerFee.usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.relayerFee.usd","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.0.execute.strk20.oneOf.0.relayerFee","typeLabel":"object"}},"uniqueKey":"oneOf.0.execute.strk20.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.0.execute.strk20.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.execute.strk20","typeLabel":"object | null"},"transactions":{"oneOf":[{"type":"array","items":{"type":"object","description":"One EVM transaction for the user's wallet, sent in list order.","required":["to","data","value"],"properties":{"data":{"type":"string","description":"The calldata, in lowercase hex.","isRequired":true,"uniqueKey":"oneOf.0.execute.transactions.oneOf.0.items.[INDEX].data","typeLabel":"string"},"to":{"type":"string","description":"The contract called, in lowercase hex.","isRequired":true,"uniqueKey":"oneOf.0.execute.transactions.oneOf.0.items.[INDEX].to","typeLabel":"string"},"value":{"type":"string","description":"Wei, in base 10: the amount for native-coin escrows, otherwise 0.","isRequired":true,"uniqueKey":"oneOf.0.execute.transactions.oneOf.0.items.[INDEX].value","typeLabel":"string"}},"uniqueKey":"oneOf.0.execute.transactions.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"EVM source: send these in order.","uniqueKey":"oneOf.0.execute.transactions.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One EVM transaction for the user's wallet, sent in list order.","required":["to","data","value"],"properties":{"data":{"type":"string","description":"The calldata, in lowercase hex."},"to":{"type":"string","description":"The contract called, in lowercase hex."},"value":{"type":"string","description":"Wei, in base 10: the amount for native-coin escrows, otherwise 0."}}},"description":"EVM source: send these in order.","uniqueKey":"oneOf.0.execute.transactions.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.execute.transactions","typeLabel":"object[] | null"}},"isRequired":true,"uniqueKey":"oneOf.0.execute","typeLabel":"object"},"expiresAt":{"type":"integer","format":"int64","description":"Escrows: the deposit deadline. Swaps: the time to send by (the route goes stale). Unix seconds.","minimum":0,"isRequired":true,"uniqueKey":"oneOf.0.expiresAt","typeLabel":"integer\u003cint64>"},"from":{"type":"object","description":"One leg with its amount.","required":["chain","asset","amount"],"properties":{"amount":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.from.amount","typeLabel":"string"},"asset":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.from.asset","typeLabel":"string"},"chain":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.from.chain","typeLabel":"string"},"minAmount":{"oneOf":[{"type":"string","description":"A `to` leg's least: what a swap delivers without reverting, or what a cross-chain solver signed for (it delivers\neverything its purchase yields, `amount` being the expectation).","uniqueKey":"oneOf.0.from.minAmount.oneOf.0","typeLabel":"string"},{"type":"null","description":"A `to` leg's least: what a swap delivers without reverting, or what a cross-chain solver signed for (it delivers\neverything its purchase yields, `amount` being the expectation).","uniqueKey":"oneOf.0.from.minAmount.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.from.minAmount","typeLabel":"string | null"},"usd":{"oneOf":[{"type":"string","description":"US dollars at quote time, when known.","uniqueKey":"oneOf.0.from.usd.oneOf.0","typeLabel":"string"},{"type":"null","description":"US dollars at quote time, when known.","uniqueKey":"oneOf.0.from.usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.from.usd","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.0.from","typeLabel":"object"},"id":{"type":"string","example":"q_01JB8Z5W3F6V9Q2X4K7M1N0P8R","isRequired":true,"uniqueKey":"oneOf.0.id","typeLabel":"string"},"to":{"type":"object","description":"Escrows: `to.amount` is what the solver committed to deliver, the minimum to check before revealing. Swaps:\n`to.amount` is the route's expected output and `to.minAmount` the least it delivers.","required":["chain","asset","amount"],"properties":{"amount":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.to.amount","typeLabel":"string"},"asset":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.to.asset","typeLabel":"string"},"chain":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.to.chain","typeLabel":"string"},"minAmount":{"oneOf":[{"type":"string","description":"A `to` leg's least: what a swap delivers without reverting, or what a cross-chain solver signed for (it delivers\neverything its purchase yields, `amount` being the expectation).","uniqueKey":"oneOf.0.to.minAmount.oneOf.0","typeLabel":"string"},{"type":"null","description":"A `to` leg's least: what a swap delivers without reverting, or what a cross-chain solver signed for (it delivers\neverything its purchase yields, `amount` being the expectation).","uniqueKey":"oneOf.0.to.minAmount.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.to.minAmount","typeLabel":"string | null"},"usd":{"oneOf":[{"type":"string","description":"US dollars at quote time, when known.","uniqueKey":"oneOf.0.to.usd.oneOf.0","typeLabel":"string"},{"type":"null","description":"US dollars at quote time, when known.","uniqueKey":"oneOf.0.to.usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.to.usd","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.0.to","typeLabel":"object"},"costBps":{"oneOf":[{"type":"integer","format":"int64","description":"The fees' total in basis points of `from.usd`: `from.usd − to.usd`, plus the sender's own gas on the source\nchain when `network` includes it. Everything the user gives up, when known.","minimum":0,"uniqueKey":"oneOf.0.costBps.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"The fees' total in basis points of `from.usd`: `from.usd − to.usd`, plus the sender's own gas on the source\nchain when `network` includes it. Everything the user gives up, when known.","minimum":0,"uniqueKey":"oneOf.0.costBps.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.costBps","typeLabel":"integer\u003cint64> | null"},"etaSecs":{"oneOf":[{"type":"integer","format":"int64","description":"Seconds from the deposit (or the swap) being seen until the recipient is paid, as estimated at quote time.","minimum":0,"uniqueKey":"oneOf.0.etaSecs.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Seconds from the deposit (or the swap) being seen until the recipient is paid, as estimated at quote time.","minimum":0,"uniqueKey":"oneOf.0.etaSecs.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.etaSecs","typeLabel":"integer\u003cint64> | null"},"fees":{"oneOf":[{"type":"object","description":"The fees at quote time, when known.","required":["totalUsd","items"],"properties":{"items":{"type":"array","items":{"type":"object","description":"One fee, in US dollars.","required":["kind","usd"],"properties":{"kind":{"type":"string","description":"What a fee pays for.","enum":["solver","network","partner","protocol","privacy"],"isRequired":true,"uniqueKey":"oneOf.0.fees.oneOf.0.\\items.items.[INDEX].kind","typeLabel":"enum\u003cstring>"},"usd":{"type":"string","description":"US dollars, two decimals.","example":"0.71","isRequired":true,"uniqueKey":"oneOf.0.fees.oneOf.0.\\items.items.[INDEX].usd","typeLabel":"string"}},"uniqueKey":"oneOf.0.fees.oneOf.0.\\items.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.0.fees.oneOf.0.\\items","typeLabel":"object[]"},"totalUsd":{"type":"string","description":"The sum of `items`, in US dollars.","isRequired":true,"uniqueKey":"oneOf.0.fees.oneOf.0.totalUsd","typeLabel":"string"}},"uniqueKey":"oneOf.0.fees.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.0.fees.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.fees","typeLabel":"object | null"},"priceImpactBps":{"oneOf":[{"type":"integer","format":"int64","description":"What the route loses against market price, router fees included, in basis points of `from.usd`, when known.","minimum":0,"uniqueKey":"oneOf.0.priceImpactBps.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"What the route loses against market price, router fees included, in basis points of `from.usd`, when known.","minimum":0,"uniqueKey":"oneOf.0.priceImpactBps.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.priceImpactBps","typeLabel":"integer\u003cint64> | null"},"route":{"type":"string","description":"How a quote settles.","enum":["escrow","swap"],"uniqueKey":"oneOf.0.route","typeLabel":"enum\u003cstring>"},"sourceGas":{"oneOf":[{"type":"object","description":"What the sender's wallet pays in gas on the source chain, when known. An indicative quote with a `sender`\ncounts only the approvals that sender still needs; without one it counts the approval a token needs at most.\nA private swap's is the relayer's fee in STRK, which the shielded balance pays instead of a wallet.","required":["amount"],"properties":{"amount":{"type":"string","description":"Base units of the coin gas is paid in (wei, or fri on Starknet).","example":"3460000000000","isRequired":true,"uniqueKey":"oneOf.0.sourceGas.oneOf.0.amount","typeLabel":"string"},"usd":{"oneOf":[{"type":"string","description":"The same in US dollars, when known.","example":"0.01","uniqueKey":"oneOf.0.sourceGas.oneOf.0.usd.oneOf.0","typeLabel":"string"},{"type":"null","description":"The same in US dollars, when known.","example":"0.01","uniqueKey":"oneOf.0.sourceGas.oneOf.0.usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.sourceGas.oneOf.0.usd","typeLabel":"string | null"}},"uniqueKey":"oneOf.0.sourceGas.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.0.sourceGas.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.sourceGas","typeLabel":"object | null"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"`POST /v1/quote`'s answer.","required":["from","to","expiresAt"],"properties":{"expiresAt":{"type":"integer","format":"int64","description":"Unix seconds the price is good until.","minimum":0,"isRequired":true,"uniqueKey":"oneOf.1.expiresAt","typeLabel":"integer\u003cint64>"},"from":{"type":"object","description":"One leg with its amount.","required":["chain","asset","amount"],"properties":{"amount":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.from.amount","typeLabel":"string"},"asset":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.from.asset","typeLabel":"string"},"chain":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.from.chain","typeLabel":"string"},"minAmount":{"oneOf":[{"type":"string","description":"A `to` leg's least: what a swap delivers without reverting, or what a cross-chain solver signed for (it delivers\neverything its purchase yields, `amount` being the expectation).","uniqueKey":"oneOf.1.from.minAmount.oneOf.0","typeLabel":"string"},{"type":"null","description":"A `to` leg's least: what a swap delivers without reverting, or what a cross-chain solver signed for (it delivers\neverything its purchase yields, `amount` being the expectation).","uniqueKey":"oneOf.1.from.minAmount.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.from.minAmount","typeLabel":"string | null"},"usd":{"oneOf":[{"type":"string","description":"US dollars at quote time, when known.","uniqueKey":"oneOf.1.from.usd.oneOf.0","typeLabel":"string"},{"type":"null","description":"US dollars at quote time, when known.","uniqueKey":"oneOf.1.from.usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.from.usd","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.1.from","typeLabel":"object"},"to":{"type":"object","description":"The best solver's price.","required":["chain","asset","amount"],"properties":{"amount":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.to.amount","typeLabel":"string"},"asset":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.to.asset","typeLabel":"string"},"chain":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.to.chain","typeLabel":"string"},"minAmount":{"oneOf":[{"type":"string","description":"A `to` leg's least: what a swap delivers without reverting, or what a cross-chain solver signed for (it delivers\neverything its purchase yields, `amount` being the expectation).","uniqueKey":"oneOf.1.to.minAmount.oneOf.0","typeLabel":"string"},{"type":"null","description":"A `to` leg's least: what a swap delivers without reverting, or what a cross-chain solver signed for (it delivers\neverything its purchase yields, `amount` being the expectation).","uniqueKey":"oneOf.1.to.minAmount.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.to.minAmount","typeLabel":"string | null"},"usd":{"oneOf":[{"type":"string","description":"US dollars at quote time, when known.","uniqueKey":"oneOf.1.to.usd.oneOf.0","typeLabel":"string"},{"type":"null","description":"US dollars at quote time, when known.","uniqueKey":"oneOf.1.to.usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.to.usd","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.1.to","typeLabel":"object"},"costBps":{"oneOf":[{"type":"integer","format":"int64","description":"The fees' total in basis points of `from.usd`: `from.usd − to.usd`, plus the sender's own gas on the source\nchain when `network` includes it. Everything the user gives up, when known.","minimum":0,"uniqueKey":"oneOf.1.costBps.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"The fees' total in basis points of `from.usd`: `from.usd − to.usd`, plus the sender's own gas on the source\nchain when `network` includes it. Everything the user gives up, when known.","minimum":0,"uniqueKey":"oneOf.1.costBps.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.costBps","typeLabel":"integer\u003cint64> | null"},"etaSecs":{"oneOf":[{"type":"integer","format":"int64","description":"Seconds from the deposit (or the swap) being seen until the recipient is paid, as estimated at quote time.","minimum":0,"uniqueKey":"oneOf.1.etaSecs.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Seconds from the deposit (or the swap) being seen until the recipient is paid, as estimated at quote time.","minimum":0,"uniqueKey":"oneOf.1.etaSecs.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.etaSecs","typeLabel":"integer\u003cint64> | null"},"fees":{"oneOf":[{"type":"object","description":"The fees at quote time, when known.","required":["totalUsd","items"],"properties":{"items":{"type":"array","items":{"type":"object","description":"One fee, in US dollars.","required":["kind","usd"],"properties":{"kind":{"type":"string","description":"What a fee pays for.","enum":["solver","network","partner","protocol","privacy"],"isRequired":true,"uniqueKey":"oneOf.1.fees.oneOf.0.\\items.items.[INDEX].kind","typeLabel":"enum\u003cstring>"},"usd":{"type":"string","description":"US dollars, two decimals.","example":"0.71","isRequired":true,"uniqueKey":"oneOf.1.fees.oneOf.0.\\items.items.[INDEX].usd","typeLabel":"string"}},"uniqueKey":"oneOf.1.fees.oneOf.0.\\items.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.1.fees.oneOf.0.\\items","typeLabel":"object[]"},"totalUsd":{"type":"string","description":"The sum of `items`, in US dollars.","isRequired":true,"uniqueKey":"oneOf.1.fees.oneOf.0.totalUsd","typeLabel":"string"}},"uniqueKey":"oneOf.1.fees.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.1.fees.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.fees","typeLabel":"object | null"},"priceImpactBps":{"oneOf":[{"type":"integer","format":"int64","description":"What the route loses against market price, router fees included, in basis points of `from.usd`, when known.","minimum":0,"uniqueKey":"oneOf.1.priceImpactBps.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"What the route loses against market price, router fees included, in basis points of `from.usd`, when known.","minimum":0,"uniqueKey":"oneOf.1.priceImpactBps.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.priceImpactBps","typeLabel":"integer\u003cint64> | null"},"route":{"type":"string","description":"How a quote settles.","enum":["escrow","swap"],"uniqueKey":"oneOf.1.route","typeLabel":"enum\u003cstring>"},"sourceGas":{"oneOf":[{"type":"object","description":"What the sender's wallet pays in gas on the source chain, when known. An indicative quote with a `sender`\ncounts only the approvals that sender still needs; without one it counts the approval a token needs at most.\nA private swap's is the relayer's fee in STRK, which the shielded balance pays instead of a wallet.","required":["amount"],"properties":{"amount":{"type":"string","description":"Base units of the coin gas is paid in (wei, or fri on Starknet).","example":"3460000000000","isRequired":true,"uniqueKey":"oneOf.1.sourceGas.oneOf.0.amount","typeLabel":"string"},"usd":{"oneOf":[{"type":"string","description":"The same in US dollars, when known.","example":"0.01","uniqueKey":"oneOf.1.sourceGas.oneOf.0.usd.oneOf.0","typeLabel":"string"},{"type":"null","description":"The same in US dollars, when known.","example":"0.01","uniqueKey":"oneOf.1.sourceGas.oneOf.0.usd.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.sourceGas.oneOf.0.usd","typeLabel":"string | null"}},"uniqueKey":"oneOf.1.sourceGas.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.1.sourceGas.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.sourceGas","typeLabel":"object | null"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"Firm":{"title":"Firm","value":{"etaSecs":95,"execute":{"depositAddress":"0x3c1f0e0a9b7d6c5e4f3a2b1c0d9e8f7a6b5c4d3e","transactions":[{"data":"0x095ea7b3…","to":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","value":"0"},{"data":"0x…","to":"0x53cac833e629e7453197a2808da550dd9c535d6d","value":"0"}]},"expiresAt":1793085830,"fees":{"items":[{"kind":"solver","usd":"0.80"},{"kind":"network","usd":"0.70"}],"totalUsd":"1.50"},"from":{"amount":"1000000","asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","chain":"base","usd":"1000.00"},"id":"q_01JB8Z5W3F6V9Q2X4K7M1N0P8R","route":"escrow","to":{"amount":"998500","asset":"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8","chain":"starknet","usd":"998.50"}}},"Indicative":{"title":"Indicative","value":{"etaSecs":95,"expiresAt":1793084230,"fees":{"items":[{"kind":"solver","usd":"0.80"},{"kind":"network","usd":"0.70"}],"totalUsd":"1.50"},"from":{"amount":"1000000","asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","chain":"base","usd":"1000.00"},"route":"escrow","to":{"amount":"998500","asset":"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8","chain":"starknet","usd":"998.50"}}},"Same-chain swap":{"title":"Same-chain swap","value":{"execute":{"transactions":[{"data":"0x…","to":"0xb67bca06e06f6c413564eee8d161888a37b2db4c","value":"10000000000000000"}]},"expiresAt":1793084914,"from":{"amount":"10000000000000000","asset":"native","chain":"base"},"id":"q_01M5Y2Z4APRNZWK2FQWZY1GAQ8","route":"swap","to":{"amount":"23046638","asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","chain":"base","minAmount":"22931404"}}}},"exampleType":"examples"}},"exampleType":"examples"},"6838915f-1a5c-4c4d-9666-00dc5ed1f2ce":{"description":"Invalid request, unsupported chain or asset","content":{"application/problem+json":{"schema":{"type":"object","description":"The body of every error response.","required":["type","title","status","code","detail"],"properties":{"code":{"type":"string","description":"A stable, machine-readable error code. Clients branch on this, never on `title` or `detail`.","enum":["invalid_request","unauthorized","not_found","method_not_allowed","rate_limited","unsupported_chain","unsupported_asset","amount_too_small","amount_too_large","no_route","condition_reused","quote_not_found","quote_expired","not_ready","invalid_fulfillment","destination_not_ready","invalid_private_transaction","payload_too_large","timeout","internal"],"isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence.","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"status":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"type":"string","description":"The HTTP status phrase.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"type":"string","description":"Always `about:blank`: `code` carries the error type.","isRequired":true,"uniqueKey":"type","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"invalid_request","detail":"\u003cstring>","status":1,"title":"\u003cstring>","type":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"a2cbc62a-8f98-4c9a-af2e-40e366d4e6b4":{"description":"x-api-key is not a valid API key","content":{"application/problem+json":{"schema":{"type":"object","description":"The body of every error response.","required":["type","title","status","code","detail"],"properties":{"code":{"type":"string","description":"A stable, machine-readable error code. Clients branch on this, never on `title` or `detail`.","enum":["invalid_request","unauthorized","not_found","method_not_allowed","rate_limited","unsupported_chain","unsupported_asset","amount_too_small","amount_too_large","no_route","condition_reused","quote_not_found","quote_expired","not_ready","invalid_fulfillment","destination_not_ready","invalid_private_transaction","payload_too_large","timeout","internal"],"isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence.","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"status":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"type":"string","description":"The HTTP status phrase.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"type":"string","description":"Always `about:blank`: `code` carries the error type.","isRequired":true,"uniqueKey":"type","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"invalid_request","detail":"\u003cstring>","status":1,"title":"\u003cstring>","type":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"77ac77f0-23d0-4715-b172-04e621307315":{"description":"The condition is already used, or a request with this Idempotency-Key is in progress","content":{"application/problem+json":{"schema":{"type":"object","description":"The body of every error response.","required":["type","title","status","code","detail"],"properties":{"code":{"type":"string","description":"A stable, machine-readable error code. Clients branch on this, never on `title` or `detail`.","enum":["invalid_request","unauthorized","not_found","method_not_allowed","rate_limited","unsupported_chain","unsupported_asset","amount_too_small","amount_too_large","no_route","condition_reused","quote_not_found","quote_expired","not_ready","invalid_fulfillment","destination_not_ready","invalid_private_transaction","payload_too_large","timeout","internal"],"isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence.","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"status":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"type":"string","description":"The HTTP status phrase.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"type":"string","description":"Always `about:blank`: `code` carries the error type.","isRequired":true,"uniqueKey":"type","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"invalid_request","detail":"\u003cstring>","status":1,"title":"\u003cstring>","type":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"9f0ecbff-9fcf-4705-93ba-10f790954c09":{"description":"No solver or aggregator quoted this route","content":{"application/problem+json":{"schema":{"type":"object","description":"The body of every error response.","required":["type","title","status","code","detail"],"properties":{"code":{"type":"string","description":"A stable, machine-readable error code. Clients branch on this, never on `title` or `detail`.","enum":["invalid_request","unauthorized","not_found","method_not_allowed","rate_limited","unsupported_chain","unsupported_asset","amount_too_small","amount_too_large","no_route","condition_reused","quote_not_found","quote_expired","not_ready","invalid_fulfillment","destination_not_ready","invalid_private_transaction","payload_too_large","timeout","internal"],"isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence.","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"status":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"type":"string","description":"The HTTP status phrase.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"type":"string","description":"Always `about:blank`: `code` carries the error type.","isRequired":true,"uniqueKey":"type","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"invalid_request","detail":"\u003cstring>","status":1,"title":"\u003cstring>","type":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"35916c2a-4341-43e9-b32b-29bb09fb682f":{"description":"Too many requests from this partner, or from this address without an API key","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until a request is accepted again"}},"content":{"application/problem+json":{"schema":{"type":"object","description":"The body of every error response.","required":["type","title","status","code","detail"],"properties":{"code":{"type":"string","description":"A stable, machine-readable error code. Clients branch on this, never on `title` or `detail`.","enum":["invalid_request","unauthorized","not_found","method_not_allowed","rate_limited","unsupported_chain","unsupported_asset","amount_too_small","amount_too_large","no_route","condition_reused","quote_not_found","quote_expired","not_ready","invalid_fulfillment","destination_not_ready","invalid_private_transaction","payload_too_large","timeout","internal"],"isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence.","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"status":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"type":"string","description":"The HTTP status phrase.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"type":"string","description":"Always `about:blank`: `code` carries the error type.","isRequired":true,"uniqueKey":"type","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"invalid_request","detail":"\u003cstring>","status":1,"title":"\u003cstring>","type":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"a45ed3cc-77d9-4fff-aeb2-7db6a2d11e2a":{"description":"Internal error","content":{"application/problem+json":{"schema":{"type":"object","description":"The body of every error response.","required":["type","title","status","code","detail"],"properties":{"code":{"type":"string","description":"A stable, machine-readable error code. Clients branch on this, never on `title` or `detail`.","enum":["invalid_request","unauthorized","not_found","method_not_allowed","rate_limited","unsupported_chain","unsupported_asset","amount_too_small","amount_too_large","no_route","condition_reused","quote_not_found","quote_expired","not_ready","invalid_fulfillment","destination_not_ready","invalid_private_transaction","payload_too_large","timeout","internal"],"isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"detail":{"type":"string","description":"A human-readable explanation of this occurrence.","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"status":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"status","typeLabel":"integer\u003cint32>"},"title":{"type":"string","description":"The HTTP status phrase.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"type":{"type":"string","description":"Always `about:blank`: `code` carries the error type.","isRequired":true,"uniqueKey":"type","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"invalid_request","detail":"\u003cstring>","status":1,"title":"\u003cstring>","type":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"d0f1c703-1c57-473f-83d6-3a38bbf66c55":{},"46fa81a3-7686-4238-a79c-537c9eaac53b":{"api_key":{"type":"apiKey","in":"header","name":"x-api-key","description":"A partner's API key. Optional: without it a request is anonymous. An invalid key is `401 unauthorized`.","scopes":[],"schemeName":"api_key"}}},"servers":{"94e17e01-c458-4ed3-b14c-73d83eb8f534":{"url":"https://api.ternswap.xyz"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"A partner's API key. Optional: without it a request is anonymous. An invalid key is `401 unauthorized`.","scopes":[],"schemeName":"api_key"},"schema":{"title":"x-api-key","type":"string","description":"A partner's API key. Optional: without it a request is anonymous. An invalid key is `401 unauthorized`.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"api_key","name":"x-api-key"}],"title":"api_key"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"localhost","siteName":"Tern","title":"Get a quote - Tern","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"api-reference/quotes/get-a-quote.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";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=\"light\"}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=\"Prices a swap, or commits to one. Across chains a swap settles through two escrows and a solver: without executionCondition the answer is an indicative price; with it, a firm quote with everything needed to fund it. On one chain it settles in one transaction through the chain\u0026#x27;s TernSwap and a DEX aggregator: indicative without sender and recipient, firm with both. A firm quote\u0026#x27;s execute lists what to send: EVM transactions in order, or Starknet calls as one multicall. An escrow quote also has a depositAddress, to which the exact from.amount can be sent from any wallet instead.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Tern\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicons/favicon-32x32.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicons/favicon-16x16.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicons/favicon.ico\">\u003cmeta data-mint-head property=\"og:title\" content=\"Get a quote - Tern\">\u003cmeta data-mint-head property=\"og:description\" content=\"Prices a swap, or commits to one. Across chains a swap settles through two escrows and a solver: without executionCondition the answer is an indicative price; with it, a firm quote with everything needed to fund it. On one chain it settles in one transaction through the chain\u0026#x27;s TernSwap and a DEX aggregator: indicative without sender and recipient, firm with both. A firm quote\u0026#x27;s execute lists what to send: EVM transactions in order, or Starknet calls as one multicall. An escrow quote also has a depositAddress, to which the exact from.amount can be sent from any wallet instead.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Tern\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./api-reference/quotes/get-a-quote\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://local.mintlify.site/images/og.png\">\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=\"Get a quote - Tern\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Prices a swap, or commits to one. Across chains a swap settles through two escrows and a solver: without executionCondition the answer is an indicative price; with it, a firm quote with everything needed to fund it. On one chain it settles in one transaction through the chain\u0026#x27;s TernSwap and a DEX aggregator: indicative without sender and recipient, firm with both. A firm quote\u0026#x27;s execute lists what to send: EVM transactions in order, or Starknet calls as one multicall. An escrow quote also has a depositAddress, to which the exact from.amount can be sent from any wallet instead.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://local.mintlify.site/images/og.png\">\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=\"/favicons/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Tern\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#212121\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./api-reference/quotes/get-a-quote\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/quotes/get-a-quote.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Tern\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Tern\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/quotes/get-a-quote.md","siteName":"Tern","nav":{"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":""}]},{"tab":"API reference","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Authentication and limits","href":"/api-reference/authentication"},{"title":"Idempotency","href":"/api-reference/idempotency"},{"title":"Errors","description":"What every error means, and how to handle it.","href":"/api-reference/errors"}]},{"group":"Quotes","pages":[{"title":"Get a quote","openapi":"/api-reference/openapi.json POST /v1/quote","href":"/api-reference/quotes/get-a-quote"},{"title":"Get a quote's status","description":"Where a firm quote stands. `status` is `awaiting_deposit` until the deposit is final, `deposit_confirmed` while the\nsolver fills, `in_progress` once the destination funds are locked, then `completed`, `refunded`, or `expired`. A\nswap is `awaiting_deposit` until its transaction is final, then `completed`. Amounts are the on-chain ones once\nknown.","openapi":"/api-reference/openapi.json GET /v1/quote/{id}","href":"/api-reference/quotes/get-a-quotes-status"},{"title":"Search quotes","openapi":"/api-reference/openapi.json GET /v1/quotes","href":"/api-reference/quotes/search-quotes"},{"title":"Reveal the fulfillment","openapi":"/api-reference/openapi.json POST /v1/quote/{id}/fulfill","href":"/api-reference/quotes/reveal-the-fulfillment"},{"title":"Submit a private swap","openapi":"/api-reference/openapi.json POST /v1/quote/{id}/submit","href":"/api-reference/quotes/submit-a-private-swap"}]},{"group":"Chains","pages":[{"title":"List chains","openapi":"/api-reference/openapi.json GET /v1/chains","href":"/api-reference/chains/list-chains"}]},{"group":"Indexing","pages":[{"title":"Index a transaction now","openapi":"/api-reference/openapi.json POST /v1/index","href":"/api-reference/index/index-a-transaction-now"}]}]}]},"basePath":"","title":"Get a quote - Tern","buildId":"f07417d3103b","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-ChNWifjS.js","utils-B09uz9kC.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CgWydDvv.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-ntwvlSPp.js","snippetPresets-VMJFyqCh.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BLDXeNDs.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-DHPXAtXl.js","shallow-Duo57Vxn.js","getApiPlaygroundDisplay-CJ0QNjPo.js","CodeSnippet-CwkzYS8z.js","CodeSnippets-BbGP_deU.js","Page-DhXAHNm9.js","getPastedJson-Dlkoi053.js","icon-CVIEM2zz.js","MethodPill-Ba__0K3g.js","DuplicateIcon-DqYcNKiH.js","createIcon-BLD1akSv.js","DynamicMarkdown-CVycGnMV.js","SectionHeading-FgN64qHU.js","axios-vUo_bRtp.js","Markdown-B4Xl-lWO.js","clsx-BFciZbw6.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BhSdXnAe.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-DWTt8oHl.js"]}