{
"error": "Invalid amount: must be greater than 0",
"code": 400
}
{
"error": "Failed to get quote: No multi-hop route found",
"code": 422
}
{
"error": "Failed to build swap: Execution plan expired",
"code": 500
}
API Reference
Build swap transaction
Turn a quote into a base64 transaction for the user to sign.
Send the quote exactly as /quote returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (dexes, maxHops and so on) belong on /quote and are ignored here.
The quote the transaction was built from. Show these amounts to the user if they differ from the original quote.
Show child attributes
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Solana Tracker","colors":{"primary":"#222","light":"#fafafa","dark":"#fff"},"logo":{"light":"https://mintcdn.com/solanatracker/tbRGxreenJeMeUiS/logo/light.png?fit=max\u0026auto=format\u0026n=tbRGxreenJeMeUiS\u0026q=85\u0026s=6de175e4a3183972f09414aef7c09e03","dark":"https://mintcdn.com/solanatracker/tbRGxreenJeMeUiS/logo/dark.png?fit=max\u0026auto=format\u0026n=tbRGxreenJeMeUiS\u0026q=85\u0026s=f0e85b8285a592294510eddfdc897951"},"favicon":"https://mintcdn.com/solanatracker/L_Q6q-7aVovpQheP/favicon.ico?fit=max\u0026auto=format\u0026n=L_Q6q-7aVovpQheP\u0026q=85\u0026s=7bf5f9749399d6d8bbc9c072bd984dee","appearance":{"default":"dark","strict":false},"background":{"color":{"light":"#fafafa","dark":"#050505"}},"navbar":{"links":[{"href":"mailto:contact@solanatracker.io","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://www.solanatracker.io/account"}},"footer":{"socials":{"x":"https://x.com/solanatrackr","github":"https://github.com/solanatracker","discord":"https://discord.gg/JH2e9rR9fc","website":"https://www.solanatracker.io"}},"search":{"prompt":"Search docs..."},"seo":{"metatags":{"robots":"index"},"indexing":"all"},"fonts":{"family":"Geist","source":"fonts/Geist-Variable.woff2","format":"woff2"},"icons":{"library":"fontawesome"},"integrations":{"ga4":{"measurementId":"G-6Y3G67KM1H"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"API Status","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/signal.svg","href":"https://status.solanatracker.io"},{"anchor":"SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/npm.svg","href":"https://www.npmjs.com/package/@solana-tracker/data-api"},{"anchor":"Discord","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/discord.svg","href":"https://discord.gg/JH2e9rR9fc"},{"anchor":"Changelog","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/rss.svg","href":"https://docs.solanatracker.io/changelog"},{"anchor":"Data API","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/database.svg","href":"https://www.solanatracker.io/data-api"},{"anchor":"Solana RPC","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/server.svg","href":"https://www.solanatracker.io/solana-rpc"},{"anchor":"Yellowstone gRPC","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/bolt.svg","href":"https://www.solanatracker.io/yellowstone-grpc"},{"anchor":"Dedicated Nodes","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/hard-drive.svg","href":"https://www.solanatracker.io/dedicated-nodes"}]},"languages":[{"language":"en","default":true,"href":""},{"language":"cn","href":"cn"},{"language":"es","href":"es"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"solanatracker","hasAudioNarration":false,"actualSubdomain":"solanatracker","customDomains":["docs.solanatracker.io"],"gitSource":{"type":"github","owner":"yzylab","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae5b7b43aae848cfc967550","collectionId":"6f15dc96-d779-4b61-aa40-f8f832a2430b","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae5b7b43aae848cfc967550"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae5bd3bf146f7c5c1de4195","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"en","tag":"Websockets","count":107},{"language":"cn","tag":"Websockets","count":104},{"language":"es","tag":"Websockets","count":104},{"language":"en","tag":"Solana RPC","count":89},{"language":"cn","tag":"Solana RPC","count":89},{"language":"es","tag":"Solana RPC","count":89},{"language":"en","tag":"Data API","count":87},{"language":"en","tag":"Datastream","count":86},{"language":"cn","tag":"Data API","count":83},{"language":"cn","tag":"Datastream","count":83},{"language":"es","tag":"Data API","count":83},{"language":"es","tag":"Datastream","count":83},{"language":"en","tag":"API Reference","count":73},{"language":"cn","tag":"API Reference","count":71},{"language":"es","tag":"API Reference","count":71},{"language":"en","tag":"Prediction Markets","count":61},{"language":"cn","tag":"Prediction Markets","count":61},{"language":"es","tag":"Prediction Markets","count":61},{"language":"en","tag":"Endpoints","count":53},{"language":"cn","tag":"Endpoints","count":53},{"language":"es","tag":"Endpoints","count":53},{"language":"en","tag":"Guides","count":37},{"language":"cn","tag":"指南","count":29},{"language":"es","tag":"Guías","count":29},{"language":"en","tag":"Markets","count":24},{"language":"cn","tag":"Markets","count":24},{"language":"es","tag":"Markets","count":24},{"language":"en","tag":"PnL V2","count":22},{"language":"cn","tag":"PnL V2","count":22},{"language":"es","tag":"PnL V2","count":22}],"searchSettings":{"showContentSnippets":true,"maxResults":7}},"assistantConfig":{"enableStarterQuestions":false,"deflection":{"enabled":true,"email":"contact@solanatracker.io"}},"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":"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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","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":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","href":"/_mintlify/custom/solanatracker/4322030c60828a31/style.css"},{"filePath":"hugeicons.css","href":"/_mintlify/custom/solanatracker/d8041e42f4d4ecdf/hugeicons.css"},{"filePath":"release-badges.css","content":"#navigation-items a:is(\n [href$=\"/datastream/websockets/liquiditytoken\"],\n [href$=\"/datastream/websockets/liquiditytokenpool\"],\n [href$=\"/datastream/websockets/liquiditytokenpoolwallet\"],\n [href$=\"/datastream/websockets/liquiditypool\"],\n [href$=\"/datastream/websockets/liquiditywallet\"],\n [href$=\"/guides/liquidity\"]\n){--release-label:\"NEW\";--release-ink:#066345;--release-fill:#e3f4eb}#navigation-items a:is(\n [href$=\"/data-api/trades/get-token-trades\"],\n [href$=\"/data-api/trades/get-pool-specific-trades\"],\n [href$=\"/data-api/trades/get-user-specific-token-trades\"],\n [href$=\"/data-api/trades/get-user-specific-pool-trades\"]\n){--release-label:\"UPDATED\";--release-ink:#1d4ed8;--release-fill:#e8efff}#navigation-items a:is(\n [href$=\"/datastream/websockets/liquiditytoken\"],\n [href$=\"/datastream/websockets/liquiditytokenpool\"],\n [href$=\"/datastream/websockets/liquiditytokenpoolwallet\"],\n [href$=\"/datastream/websockets/liquiditypool\"],\n [href$=\"/datastream/websockets/liquiditywallet\"],\n [href$=\"/guides/liquidity\"],\n [href$=\"/data-api/trades/get-token-trades\"],\n [href$=\"/data-api/trades/get-pool-specific-trades\"],\n [href$=\"/data-api/trades/get-user-specific-token-trades\"],\n [href$=\"/data-api/trades/get-user-specific-pool-trades\"]\n)::after{content:var(--release-label);margin-inline-start:auto;flex-shrink:0;align-self:center;padding:2px 5px;border-radius:5px;background:var(--release-fill);color:var(--release-ink);font:600 9px/1.4 var(--st-font);letter-spacing:.035em}.dark #navigation-items a{--release-ink:#86efac;--release-fill:#123025}.dark #navigation-items a[href*=\"/data-api/trades/\"]{--release-ink:#93c5fd;--release-fill:#172b49}#navigation-items [data-nav-tag=NEW]{background:#e3f4eb;color:#066345;font:600 9px/1.4 var(--st-font);padding:2px 5px;border-radius:5px;letter-spacing:.035em}.dark #navigation-items [data-nav-tag=NEW]{background:#123025;color:#86efac}"}],"page":{"pagePath":"raptor/http/build-swap-transaction","slug":"/raptor/http/build-swap-transaction","pageMetadata":{"title":"Build swap transaction","description":"Turn a quote into a base64 transaction for the user to sign.\n\nSend the quote exactly as `/quote` returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (`dexes`, `maxHops` and so on) belong on `/quote` and are ignored here.","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json post /swap","href":"/raptor/http/build-swap-transaction","autogeneratedByOpenApi":true},"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: [_jsx(_components.p, {\n children: \"Turn a quote into a base64 transaction for the user to sign.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Send the quote exactly as \", _jsx(_components.code, {\n children: \"/quote\"\n }), \" returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (\", _jsx(_components.code, {\n children: \"dexes\"\n }), \", \", _jsx(_components.code, {\n children: \"maxHops\"\n }), \" and so on) belong on \", _jsx(_components.code, {\n children: \"/quote\"\n }), \" and are ignored here.\"]\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":{"config":{},"pageMetadata":{"title":"Build swap transaction","description":"Turn a quote into a base64 transaction for the user to sign.\n\nSend the quote exactly as `/quote` returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (`dexes`, `maxHops` and so on) belong on `/quote` and are ignored here.","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json post /swap","href":"/raptor/http/build-swap-transaction","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/solanatracker/4f7d4267eda669e2/datafast.js","/_mintlify/custom/solanatracker/b54537c43919e41e/ws.js","/_mintlify/custom/solanatracker/a5628f7eaa705f66/assistant.js"],"openApiReferenceData":{"operation":{"summary":"Build swap transaction","operationId":"buildSwap","description":"Turn a quote into a base64 transaction for the user to sign.\n\nSend the quote exactly as `/quote` returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (`dexes`, `maxHops` and so on) belong on `/quote` and are ignored here.","requestBody":"067528bf-3b6d-42f3-ab2d-01d9ed0f9647","responses":{"200":"7811a7e8-d0da-40b2-82e3-55254d840cdc","400":"273563ec-f2df-4fa6-bb01-86afa9460cdf","422":"7b0e39ca-5ad8-464d-b9e3-7b506c803ecf","500":"7c7f8f95-20dd-4983-ae0d-269909e7292f"},"method":"post","type":"path","servers":["68cff0d5-d585-4a1d-ad40-e34129f48d56"],"security":[],"path":"/swap","baseUrlOptions":["https://raptor.solanatracker.io"],"title":"Build swap transaction","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userPublicKey","quoteResponse"],"properties":{"userPublicKey":{"type":"string","description":"Wallet that signs and pays for the swap","isRequired":true,"uniqueKey":"userPublicKey","typeLabel":"string"},"quoteResponse":{"type":"object","description":"Quote returned by `GET /quote`. Send it back unchanged as `quoteResponse`.","required":["inputMint","outputMint","amountIn","amountOut","minAmountOut","priceImpact","slippageBps","routePlan","contextSlot","timeTaken"],"properties":{"inputMint":{"type":"string","description":"Mint of the token sold","isRequired":true,"uniqueKey":"quoteResponse.inputMint","typeLabel":"string"},"outputMint":{"type":"string","description":"Mint of the token bought","isRequired":true,"uniqueKey":"quoteResponse.outputMint","typeLabel":"string"},"amountIn":{"type":"string","description":"Amount sold, in the input token's smallest unit","isRequired":true,"uniqueKey":"quoteResponse.amountIn","typeLabel":"string"},"amountOut":{"type":"string","description":"Expected amount received, in the output token's smallest unit","isRequired":true,"uniqueKey":"quoteResponse.amountOut","typeLabel":"string"},"minAmountOut":{"type":"string","description":"Least amount the swap will accept after slippage. The transaction fails rather than fill below this.","isRequired":true,"uniqueKey":"quoteResponse.minAmountOut","typeLabel":"string"},"priceImpact":{"type":"number","description":"Price impact in percent (`0.25` = 0.25%)","isRequired":true,"uniqueKey":"quoteResponse.priceImpact","typeLabel":"number"},"slippageBps":{"type":"integer","description":"Slippage used, in basis points","isRequired":true,"uniqueKey":"quoteResponse.slippageBps","typeLabel":"integer"},"routePlan":{"type":"array","description":"Steps of the route, in order","items":{"type":"object","required":["programId","dex","pool","inputMint","outputMint","amountIn","amountOut","priceImpact"],"properties":{"programId":{"type":"string","description":"DEX program ID","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].programId","typeLabel":"string"},"dex":{"type":"string","description":"DEX name","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].dex","typeLabel":"string"},"pool":{"type":"string","description":"Pool address","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].pool","typeLabel":"string"},"inputMint":{"type":"string","description":"Mint going into this step","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].inputMint","typeLabel":"string"},"outputMint":{"type":"string","description":"Mint coming out of this step","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].outputMint","typeLabel":"string"},"amountIn":{"type":"string","description":"Amount into this step","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].amountIn","typeLabel":"string"},"amountOut":{"type":"string","description":"Amount out of this step","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].amountOut","typeLabel":"string"},"priceImpact":{"type":"number","description":"Price impact of this step, in percent","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].priceImpact","typeLabel":"number"},"feeAmount":{"type":"string","description":"Pool fee for this step, when reported","uniqueKey":"quoteResponse.routePlan.items.[INDEX].feeAmount","typeLabel":"string"},"percent":{"type":"integer","description":"Share of the input sent through this step","uniqueKey":"quoteResponse.routePlan.items.[INDEX].percent","typeLabel":"integer"}},"uniqueKey":"quoteResponse.routePlan.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"quoteResponse.routePlan","typeLabel":"object[]"},"contextSlot":{"type":"integer","description":"Slot the quote was computed at","isRequired":true,"uniqueKey":"quoteResponse.contextSlot","typeLabel":"integer"},"timeTaken":{"type":"number","description":"Time to compute the quote, in seconds","isRequired":true,"uniqueKey":"quoteResponse.timeTaken","typeLabel":"number"},"feeAmount":{"type":"string","description":"Pool fees for the route, when reported","uniqueKey":"quoteResponse.feeAmount","typeLabel":"string"},"swapUsdValue":{"type":"string","description":"USD value of the input amount","uniqueKey":"quoteResponse.swapUsdValue","typeLabel":"string"},"platformFee":{"type":"object","description":"Your platform fee settings, as applied to the quote","properties":{"feeAccount":{"type":"string","description":"Wallet that receives the fee","uniqueKey":"quoteResponse.platformFee.feeAccount","typeLabel":"string"},"feeBps":{"type":"integer","description":"Fee in basis points","uniqueKey":"quoteResponse.platformFee.feeBps","typeLabel":"integer"},"feeFromInput":{"type":"boolean","description":"`true` if the fee is taken from the input token","uniqueKey":"quoteResponse.platformFee.feeFromInput","typeLabel":"boolean"},"chargeBps":{"type":"integer","description":"Fee on positive slippage, in basis points","uniqueKey":"quoteResponse.platformFee.chargeBps","typeLabel":"integer"}},"uniqueKey":"quoteResponse.platformFee","typeLabel":"object"},"tokenTransfers":{"type":"object","description":"Present only when the input or output token charges a Token-2022 transfer fee. Amounts are strings in the token's smallest unit.","properties":{"depositFee":{"type":"string","description":"Transfer fee charged on the input token","uniqueKey":"quoteResponse.tokenTransfers.depositFee","typeLabel":"string"},"deliveryFee":{"type":"string","description":"Transfer fee charged on the output token","uniqueKey":"quoteResponse.tokenTransfers.deliveryFee","typeLabel":"string"},"netOutput":{"type":"string","description":"What reaches the wallet after platform and transfer fees","uniqueKey":"quoteResponse.tokenTransfers.netOutput","typeLabel":"string"}},"uniqueKey":"quoteResponse.tokenTransfers","typeLabel":"object"},"jitRouting":{"type":"boolean","description":"`true` when the quote uses a just-in-time route","uniqueKey":"quoteResponse.jitRouting","typeLabel":"boolean"},"quoteId":{"type":"string","description":"Reference to the stored execution plan. Expires after a few seconds.","uniqueKey":"quoteResponse.quoteId","typeLabel":"string"},"searchMode":{"type":"string","enum":["fast","deep"],"description":"Search mode used","uniqueKey":"quoteResponse.searchMode","typeLabel":"enum\u003cstring>"}},"isRequired":true,"uniqueKey":"quoteResponse","typeLabel":"object"},"wrapUnwrapSol":{"type":"boolean","default":true,"description":"Wrap and unwrap native SOL automatically","uniqueKey":"wrapUnwrapSol","typeLabel":"boolean"},"txVersion":{"type":"string","enum":["V0","LEGACY","V1"],"default":"V0","description":"Transaction format. Case-sensitive. `LEGACY` and `V1` do not support JIT routes; quote with `jitRouting=false` to use them.","uniqueKey":"txVersion","typeLabel":"enum\u003cstring>"},"priorityFee":{"type":"string","description":"A level (`min`, `low`, `medium`, `auto`, `high`, `veryHigh`, `turbo`, `unsafeMax`) or a total fee in lamports as a string, such as `\"50000\"`. Default `auto`.","example":"high","uniqueKey":"priorityFee","typeLabel":"string"},"maxPriorityFee":{"type":"integer","description":"Cap on the compute unit price, in micro-lamports","uniqueKey":"maxPriorityFee","typeLabel":"integer"},"computeUnitPriceMicroLamports":{"type":"integer","description":"Exact compute unit price in micro-lamports. Overrides `priorityFee`.","uniqueKey":"computeUnitPriceMicroLamports","typeLabel":"integer"},"computeUnitLimit":{"type":"integer","description":"Compute unit limit","uniqueKey":"computeUnitLimit","typeLabel":"integer"},"tipAccount":{"type":"string","description":"Account that receives a SOL tip, such as a Jito tip account","uniqueKey":"tipAccount","typeLabel":"string"},"tipLamports":{"type":"integer","description":"Tip amount in lamports","uniqueKey":"tipLamports","typeLabel":"integer"},"feeAccount":{"type":"string","description":"Wallet that receives your platform fee","uniqueKey":"feeAccount","typeLabel":"string"},"feeBps":{"type":"integer","description":"Platform fee in basis points","uniqueKey":"feeBps","typeLabel":"integer"},"feeFromInput":{"type":"boolean","default":false,"description":"Take the platform fee from the input token","uniqueKey":"feeFromInput","typeLabel":"boolean"},"chargeBps":{"type":"integer","description":"Fee on positive slippage, in basis points","uniqueKey":"chargeBps","typeLabel":"integer"},"jitRouting":{"type":"string","enum":["auto","true","false"],"default":"auto","description":"On `/swap`, `auto` keeps the quote's route. On `/swap-instructions`, you get a JIT swap only when this is `true`.","uniqueKey":"jitRouting","typeLabel":"enum\u003cstring>"}},"uniqueKey":"","typeLabel":"object"},"example":{"userPublicKey":"YOUR_WALLET_ADDRESS","quoteResponse":{"inputMint":"So11111111111111111111111111111111111111112","outputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amountIn":"100000000","amountOut":"11703794","minAmountOut":"11645275","priceImpact":0,"slippageBps":50,"routePlan":[{"programId":"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp","dex":"Humidifi","pool":"8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu","inputMint":"So11111111111111111111111111111111111111112","outputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amountIn":"100000000","amountOut":"11703794","priceImpact":0,"percent":100}],"contextSlot":454215309,"timeTaken":0.026,"quoteId":"AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU"},"priorityFee":"high"},"examples":{"Example":{"title":"Example","value":{"userPublicKey":"YOUR_WALLET_ADDRESS","quoteResponse":{"inputMint":"So11111111111111111111111111111111111111112","outputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amountIn":"100000000","amountOut":"11703794","minAmountOut":"11645275","priceImpact":0,"slippageBps":50,"routePlan":[{"programId":"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp","dex":"Humidifi","pool":"8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu","inputMint":"So11111111111111111111111111111111111111112","outputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amountIn":"100000000","amountOut":"11703794","priceImpact":0,"percent":100}],"contextSlot":454215309,"timeTaken":0.026,"quoteId":"AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU"},"priorityFee":"high"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"7811a7e8-d0da-40b2-82e3-55254d840cdc":{"description":"Unsigned transaction","content":{"application/json":{"schema":{"type":"object","required":["swapTransaction","lastValidBlockHeight","prioritizationFeeLamports"],"properties":{"swapTransaction":{"type":"string","description":"Unsigned transaction, base64. Sign it with the user's wallet.","isRequired":true,"uniqueKey":"swapTransaction","typeLabel":"string"},"lastValidBlockHeight":{"type":"integer","description":"The transaction expires after this block height","isRequired":true,"uniqueKey":"lastValidBlockHeight","typeLabel":"integer"},"prioritizationFeeLamports":{"type":"integer","description":"Priority fee included, in lamports","isRequired":true,"uniqueKey":"prioritizationFeeLamports","typeLabel":"integer"},"contextSlot":{"type":"integer","description":"Slot the transaction was built at","uniqueKey":"contextSlot","typeLabel":"integer"},"quoteResponse":{"type":"object","description":"The quote the transaction was built from. Show these amounts to the user if they differ from the original quote.","required":["inputMint","outputMint","amountIn","amountOut","minAmountOut","priceImpact","slippageBps","routePlan","contextSlot","timeTaken"],"properties":{"inputMint":{"type":"string","description":"Mint of the token sold","isRequired":true,"uniqueKey":"quoteResponse.inputMint","typeLabel":"string"},"outputMint":{"type":"string","description":"Mint of the token bought","isRequired":true,"uniqueKey":"quoteResponse.outputMint","typeLabel":"string"},"amountIn":{"type":"string","description":"Amount sold, in the input token's smallest unit","isRequired":true,"uniqueKey":"quoteResponse.amountIn","typeLabel":"string"},"amountOut":{"type":"string","description":"Expected amount received, in the output token's smallest unit","isRequired":true,"uniqueKey":"quoteResponse.amountOut","typeLabel":"string"},"minAmountOut":{"type":"string","description":"Least amount the swap will accept after slippage. The transaction fails rather than fill below this.","isRequired":true,"uniqueKey":"quoteResponse.minAmountOut","typeLabel":"string"},"priceImpact":{"type":"number","description":"Price impact in percent (`0.25` = 0.25%)","isRequired":true,"uniqueKey":"quoteResponse.priceImpact","typeLabel":"number"},"slippageBps":{"type":"integer","description":"Slippage used, in basis points","isRequired":true,"uniqueKey":"quoteResponse.slippageBps","typeLabel":"integer"},"routePlan":{"type":"array","description":"Steps of the route, in order","items":{"type":"object","required":["programId","dex","pool","inputMint","outputMint","amountIn","amountOut","priceImpact"],"properties":{"programId":{"type":"string","description":"DEX program ID","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].programId","typeLabel":"string"},"dex":{"type":"string","description":"DEX name","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].dex","typeLabel":"string"},"pool":{"type":"string","description":"Pool address","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].pool","typeLabel":"string"},"inputMint":{"type":"string","description":"Mint going into this step","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].inputMint","typeLabel":"string"},"outputMint":{"type":"string","description":"Mint coming out of this step","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].outputMint","typeLabel":"string"},"amountIn":{"type":"string","description":"Amount into this step","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].amountIn","typeLabel":"string"},"amountOut":{"type":"string","description":"Amount out of this step","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].amountOut","typeLabel":"string"},"priceImpact":{"type":"number","description":"Price impact of this step, in percent","isRequired":true,"uniqueKey":"quoteResponse.routePlan.items.[INDEX].priceImpact","typeLabel":"number"},"feeAmount":{"type":"string","description":"Pool fee for this step, when reported","uniqueKey":"quoteResponse.routePlan.items.[INDEX].feeAmount","typeLabel":"string"},"percent":{"type":"integer","description":"Share of the input sent through this step","uniqueKey":"quoteResponse.routePlan.items.[INDEX].percent","typeLabel":"integer"}},"uniqueKey":"quoteResponse.routePlan.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"quoteResponse.routePlan","typeLabel":"object[]"},"contextSlot":{"type":"integer","description":"Slot the quote was computed at","isRequired":true,"uniqueKey":"quoteResponse.contextSlot","typeLabel":"integer"},"timeTaken":{"type":"number","description":"Time to compute the quote, in seconds","isRequired":true,"uniqueKey":"quoteResponse.timeTaken","typeLabel":"number"},"feeAmount":{"type":"string","description":"Pool fees for the route, when reported","uniqueKey":"quoteResponse.feeAmount","typeLabel":"string"},"swapUsdValue":{"type":"string","description":"USD value of the input amount","uniqueKey":"quoteResponse.swapUsdValue","typeLabel":"string"},"platformFee":{"type":"object","description":"Your platform fee settings, as applied to the quote","properties":{"feeAccount":{"type":"string","description":"Wallet that receives the fee","uniqueKey":"quoteResponse.platformFee.feeAccount","typeLabel":"string"},"feeBps":{"type":"integer","description":"Fee in basis points","uniqueKey":"quoteResponse.platformFee.feeBps","typeLabel":"integer"},"feeFromInput":{"type":"boolean","description":"`true` if the fee is taken from the input token","uniqueKey":"quoteResponse.platformFee.feeFromInput","typeLabel":"boolean"},"chargeBps":{"type":"integer","description":"Fee on positive slippage, in basis points","uniqueKey":"quoteResponse.platformFee.chargeBps","typeLabel":"integer"}},"uniqueKey":"quoteResponse.platformFee","typeLabel":"object"},"tokenTransfers":{"type":"object","description":"Present only when the input or output token charges a Token-2022 transfer fee. Amounts are strings in the token's smallest unit.","properties":{"depositFee":{"type":"string","description":"Transfer fee charged on the input token","uniqueKey":"quoteResponse.tokenTransfers.depositFee","typeLabel":"string"},"deliveryFee":{"type":"string","description":"Transfer fee charged on the output token","uniqueKey":"quoteResponse.tokenTransfers.deliveryFee","typeLabel":"string"},"netOutput":{"type":"string","description":"What reaches the wallet after platform and transfer fees","uniqueKey":"quoteResponse.tokenTransfers.netOutput","typeLabel":"string"}},"uniqueKey":"quoteResponse.tokenTransfers","typeLabel":"object"},"jitRouting":{"type":"boolean","description":"`true` when the quote uses a just-in-time route","uniqueKey":"quoteResponse.jitRouting","typeLabel":"boolean"},"quoteId":{"type":"string","description":"Reference to the stored execution plan. Expires after a few seconds.","uniqueKey":"quoteResponse.quoteId","typeLabel":"string"},"searchMode":{"type":"string","enum":["fast","deep"],"description":"Search mode used","uniqueKey":"quoteResponse.searchMode","typeLabel":"enum\u003cstring>"}},"uniqueKey":"quoteResponse","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"swapTransaction":"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAHEf…","lastValidBlockHeight":432253042,"contextSlot":454215309,"prioritizationFeeLamports":80000},"examples":{"Example":{"title":"Example","value":{"swapTransaction":"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAHEf…","lastValidBlockHeight":432253042,"contextSlot":454215309,"prioritizationFeeLamports":80000}}},"exampleType":"examples"}},"exampleType":"examples"},"273563ec-f2df-4fa6-bb01-86afa9460cdf":{"description":"A parameter is missing or invalid","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"integer","description":"HTTP status code","uniqueKey":"code","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":"Invalid amount: must be greater than 0","code":400},"examples":{"Example":{"title":"Example","value":{"error":"Invalid amount: must be greater than 0","code":400}}},"exampleType":"examples"},"text/plain":{"schema":{"type":"string","uniqueKey":"","typeLabel":"string"},"example":"Failed to deserialize query string: missing field `amount`","examples":{"Example":{"title":"Example","value":"Failed to deserialize query string: missing field `amount`"}},"exampleType":"examples"}},"exampleType":"examples"},"7b0e39ca-5ad8-464d-b9e3-7b506c803ecf":{"description":"No route was found (JSON), or the JSON body has a missing, unknown-value or wrongly typed field, or the quote was changed or expired (plain text).","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"integer","description":"HTTP status code","uniqueKey":"code","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":"Failed to get quote: No multi-hop route found","code":422},"examples":{"Example":{"title":"Example","value":{"error":"Failed to get quote: No multi-hop route found","code":422}}},"exampleType":"examples"},"text/plain":{"schema":{"type":"string","uniqueKey":"","typeLabel":"string"},"examples":{"staleQuote":{"title":"staleQuote","value":"Failed to deserialize the JSON body into the target type: quoteResponse: Quote expired, modified or unavailable on this API instance; request a fresh quote"},"badTxVersion":{"title":"badTxVersion","value":"Failed to deserialize the JSON body into the target type: txVersion: unknown variant `v0`, expected one of `V1`, `V0`, `LEGACY`"}},"exampleType":"examples"}},"exampleType":"examples"},"7c7f8f95-20dd-4983-ae0d-269909e7292f":{"description":"The transaction could not be built. If the error mentions an expired plan, get a new quote and retry.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"code":{"type":"integer","description":"HTTP status code","uniqueKey":"code","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":"Failed to build swap: Execution plan expired","code":500},"examples":{"Example":{"title":"Example","value":{"error":"Failed to build swap: Execution plan expired","code":500}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{},"servers":{"68cff0d5-d585-4a1d-ad40-e34129f48d56":{"url":"https://raptor.solanatracker.io","description":"Hosted Raptor"}}},"originalFileLocation":"raptor/http/openapi.json"},"subdomain":"solanatracker","siteName":"Solana Tracker","title":"Build swap transaction - Solana Tracker","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/raptor/http/build-swap-transaction","matchLevel":0},"cn":{"href":"/cn/raptor/http/build-swap-transaction","matchLevel":1},"es":{"href":"/es/raptor/http/build-swap-transaction","matchLevel":1}}},"lastModified":"2026-10-08T14:53:52.836Z","originalFileLocation":"raptor/http/build-swap-transaction.mdx","locale":"en"},"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=\"dark\"}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=\"Turn a quote into a base64 transaction for the user to sign. Send the quote exactly as /quote returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (dexes, maxHops and so on) belong on /quote and are ignored here.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Solana Tracker\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/solanatracker/4Yx8Mp_J_BbpYlxI/_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/solanatracker/4Yx8Mp_J_BbpYlxI/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/solanatracker/4Yx8Mp_J_BbpYlxI/_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/solanatracker/4Yx8Mp_J_BbpYlxI/_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/solanatracker/4Yx8Mp_J_BbpYlxI/_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/solanatracker/4Yx8Mp_J_BbpYlxI/_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/solanatracker/4Yx8Mp_J_BbpYlxI/_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/solanatracker/4Yx8Mp_J_BbpYlxI/_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/solanatracker/4Yx8Mp_J_BbpYlxI/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Build swap transaction - Solana Tracker\">\u003cmeta data-mint-head property=\"og:description\" content=\"Turn a quote into a base64 transaction for the user to sign. Send the quote exactly as /quote returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (dexes, maxHops and so on) belong on /quote and are ignored here.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Solana Tracker\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.solanatracker.io/raptor/http/build-swap-transaction\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://solanatracker.mintlify.app/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Build+swap+transaction\u0026amp;description=Turn+a+quote+into+a+base64+transaction+for+the+user+to+sign.%0A%0ASend+the+quote+exactly+as+%60%2Fquote%60+returned+it%2C+within+a+few+seconds.+If+the+quote+has+expired%2C+th\u0026amp;theme=a0bb09d11a04a4fc1eebd874\u0026amp;signature=14f4c8fdf88b7af8842c5d8bae4cca3a2e2e8265cc57d758b4ab100419b0d221\">\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=\"Build swap transaction - Solana Tracker\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Turn a quote into a base64 transaction for the user to sign. Send the quote exactly as /quote returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (dexes, maxHops and so on) belong on /quote and are ignored here.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://solanatracker.mintlify.app/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Build+swap+transaction\u0026amp;description=Turn+a+quote+into+a+base64+transaction+for+the+user+to+sign.%0A%0ASend+the+quote+exactly+as+%60%2Fquote%60+returned+it%2C+within+a+few+seconds.+If+the+quote+has+expired%2C+th\u0026amp;theme=a0bb09d11a04a4fc1eebd874\u0026amp;signature=14f4c8fdf88b7af8842c5d8bae4cca3a2e2e8265cc57d758b4ab100419b0d221\">\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/solanatracker/4Yx8Mp_J_BbpYlxI/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Solana Tracker\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#222\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.solanatracker.io/raptor/http/build-swap-transaction\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/raptor/http/build-swap-transaction.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.solanatracker.io/raptor/http/build-swap-transaction\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.solanatracker.io/cn/raptor/http/build-swap-transaction\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.solanatracker.io/es/raptor/http/build-swap-transaction\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.solanatracker.io/raptor/http/build-swap-transaction\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.solanatracker.io/#organization\",\"name\":\"Solana Tracker\",\"url\":\"https://docs.solanatracker.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/solanatracker/tbRGxreenJeMeUiS/logo/light.png?fit=max\u0026auto=format\u0026n=tbRGxreenJeMeUiS\u0026q=85\u0026s=6de175e4a3183972f09414aef7c09e03\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.solanatracker.io#website\",\"name\":\"Solana Tracker\",\"url\":\"https://docs.solanatracker.io\",\"publisher\":{\"@id\":\"https://docs.solanatracker.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.solanatracker.io/raptor/http/build-swap-transaction#webpage\",\"url\":\"https://docs.solanatracker.io/raptor/http/build-swap-transaction\",\"name\":\"Build swap transaction\",\"description\":\"Turn a quote into a base64 transaction for the user to sign. Send the quote exactly as /quote returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (dexes, maxHops and so on) belong on /quote and are ignored here.\",\"dateModified\":\"2026-10-08T14:53:52.836Z\",\"isPartOf\":{\"@id\":\"https://docs.solanatracker.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.solanatracker.io/raptor/http/build-swap-transaction#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.solanatracker.io/raptor/http/build-swap-transaction#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.solanatracker.io/raptor/http/get-swap-quote\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API Reference\",\"item\":\"https://docs.solanatracker.io/raptor/http/get-swap-quote\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Build swap transaction\",\"item\":\"https://docs.solanatracker.io/raptor/http/build-swap-transaction\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.solanatracker.io/raptor/http/build-swap-transaction#apireference\",\"headline\":\"Build swap transaction\",\"name\":\"Build swap transaction\",\"description\":\"Turn a quote into a base64 transaction for the user to sign. Send the quote exactly as /quote returned it, within a few seconds. If the quote has expired, the call fails; get a new quote and try again. Routing options (dexes, maxHops and so on) belong on /quote and are ignored here.\",\"url\":\"https://docs.solanatracker.io/raptor/http/build-swap-transaction\",\"mainEntityOfPage\":{\"@id\":\"https://docs.solanatracker.io/raptor/http/build-swap-transaction#webpage\"},\"dateModified\":\"2026-10-08T14:53:52.836Z\",\"publisher\":{\"@id\":\"https://docs.solanatracker.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.solanatracker.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Solana Tracker\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Solana Tracker","nav":{"global":{"anchors":[{"anchor":"API Status","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/signal.svg","href":"https://status.solanatracker.io"},{"anchor":"SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/npm.svg","href":"https://www.npmjs.com/package/@solana-tracker/data-api"},{"anchor":"Discord","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/discord.svg","href":"https://discord.gg/JH2e9rR9fc"},{"anchor":"Changelog","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/rss.svg","href":"https://docs.solanatracker.io/changelog"},{"anchor":"Data API","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/database.svg","href":"https://www.solanatracker.io/data-api"},{"anchor":"Solana RPC","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/server.svg","href":"https://www.solanatracker.io/solana-rpc"},{"anchor":"Yellowstone gRPC","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/bolt.svg","href":"https://www.solanatracker.io/yellowstone-grpc"},{"anchor":"Dedicated Nodes","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/hard-drive.svg","href":"https://www.solanatracker.io/dedicated-nodes"}]},"languages":[{"language":"en","default":true,"tabs":[{"tab":"Getting Started","pages":[{"title":"Getting Started","href":""}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides"}]},{"tab":"Data API","pages":[{"title":"Data API","href":"/data-api/search/token-search"}]},{"tab":"Datastream","pages":[{"title":"Datastream","href":"/datastream/websockets/latesttokens"}]},{"tab":"Prediction Markets","pages":[{"title":"Prediction Markets","href":"/prediction-markets/overview"}]},{"tab":"Raptor Swap API","groups":[{"group":"Getting Started","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/rocket.svg","pages":[{"title":"Raptor Swap API","sidebarTitle":"Overview","href":"/raptor/overview"}]},{"group":"Recent changes","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/clock-rotate-left.svg","pages":[{"title":"Recent changes","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/clock-rotate-left.svg","href":"/raptor/recent-changes"}]},{"group":"API Reference","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/code.svg","expanded":true,"pages":[{"group":"API Reference","pages":[{"title":"Get swap quote","description":"Find the best route for a swap and return the expected output. No wallet is needed.\n\nPass the whole response to `POST /swap` unchanged, and do it within a few seconds: quotes that carry a `quoteId` point to a short-lived execution plan.","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json get /quote","href":"/raptor/http/get-swap-quote"},{"title":"Build swap transaction","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json post /swap","href":"/raptor/http/build-swap-transaction"},{"title":"Build swap instructions","description":"Same input as `/swap`, but returns the individual instructions so you can add your own and build the transaction yourself.\n\nThe swap is built as an ordinary swap unless you send `jitRouting: true`, so it can be called from your own program. If the response includes `quoteResponse`, use its amounts. When `topLevelOnly` is `true`, put `swapInstruction` last in the transaction and do not call it through CPI.","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json post /swap-instructions","href":"/raptor/http/build-swap-instructions"},{"title":"Quote and swap in one request","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json post /quote-and-swap","href":"/raptor/http/quote-and-swap-in-one-request"},{"title":"Send a signed transaction","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json post /send-transaction","href":"/raptor/http/send-a-signed-transaction"},{"title":"Get transaction status","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json get /transaction/{signature}","href":"/raptor/http/get-transaction-status"},{"title":"Health check","deprecated":null,"version":null,"openapi":"/raptor/http/openapi.json get /health","href":"/raptor/http/health-check"}]}]},{"group":"WebSocket","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/code.svg","expanded":true,"pages":[{"group":"Websockets","pages":[{"asyncapi":"raptor/websocket/asyncapi.json quoteStream","href":"/raptor/websocket/websockets/quote-stream","title":"Quote stream","version":null},{"asyncapi":"raptor/websocket/asyncapi.json swapStream","href":"/raptor/websocket/websockets/swap-stream","title":"Swap stream","version":null}]}]},{"group":"Resources","icon":"https://mintlify.s3.us-west-1.amazonaws.com/solanatracker/icons/hugeicons/book-open.svg","pages":[{"title":"Send and track transactions","sidebarTitle":"Transactions","href":"/raptor/transactions"},{"title":"Self-host Raptor","sidebarTitle":"Self-hosting","href":"/raptor/self-hosting"}]}]},{"tab":"Solana RPC","pages":[{"title":"Solana RPC","href":"/solana-rpc"}]},{"tab":"Yellowstone gRPC","pages":[{"title":"Yellowstone gRPC","href":"/yellowstone-grpc"}]}]},{"language":"cn","pages":[{"title":"cn","href":"/cn/raptor/http/build-swap-transaction"}]},{"language":"es","pages":[{"title":"es","href":"/es/raptor/http/build-swap-transaction"}]}]},"basePath":"","title":"Build swap transaction - Solana Tracker","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DCDCdBVX.js","utils-ME8dDnLe.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-0e84ACsd.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-wgRBj-ia.js","snippetPresets-C11Sgb-o.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-C0lapOpP.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ZeRQV8fF.js","shallow-BupWh095.js","getApiPlaygroundDisplay-BnYQO2Ss.js","CodeSnippet-RKKOc8c_.js","CodeSnippets-Drf_m8wS.js","Page-Bevw23-4.js","getPastedJson-u6QiPzNZ.js","icon-Bb-CBSxO.js","MethodPill-F7l5AI7V.js","DuplicateIcon-IiAXkdSg.js","createIcon-FliI8EBc.js","DynamicMarkdown-B62XqCSI.js","SectionHeading-Dj31pT03.js","axios-vUo_bRtp.js","Markdown-BOgQCTwD.js","clsx-BIWXJmsZ.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DKZWslLH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-UDqbR6xh.js"]}