Most integrations should use the SDK, which builds the transaction for you on every supported chain.Go directly to the API when you are working in a language the SDK does not cover, running quotes on a backend that never touches a wallet, or building the transaction yourself for another reason. This page covers the API surface and what you are responsible for once you skip the SDK.
For an ERC20 input on EVM, approve the Mayan Forwarder contract for at least effectiveAmountIn64 before sending the swap. The address is in forwarderAddress on the quote request, and documented on Forwarder Contract.Tokens supporting EIP-2612 can use a permit signature instead, which saves the user a transaction.Native inputs need no approval.
getSwapFromEvmTxPayload returns the payload without sending it, and its _forwarder object gives you the method name and parameters for a contract-level call. See manual transaction building.
GET https://sia.mayan.finance/v10/init returns every supported chain, with originActive and destinationActive telling you which direction each supports.
GET https://price-api.mayan.finance/v3/tokens?chain=solana returns the whitelisted token list. Drop chain for all chains. Any token with a contract address is routable, whitelisted or not, given liquidity.
The API does not return a documented error-code enum. The SDK handles quote and execution failures for you, so if you can use it, use it.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Mayan Docs","description":"Integrate cross-chain swaps with Mayan. SDK, APIs, and guides for moving any asset to any chain.","colors":{"primary":"#6C2A87","light":"#F4D9D7","dark":"#F0CEE8"},"logo":{"light":"https://mintcdn.com/mayan/Ivxrs0esdid731no/logo/light.svg?fit=max\u0026auto=format\u0026n=Ivxrs0esdid731no\u0026q=85\u0026s=1d8956e57978829816e2a2b2b4596ef0","dark":"https://mintcdn.com/mayan/Ivxrs0esdid731no/logo/dark.svg?fit=max\u0026auto=format\u0026n=Ivxrs0esdid731no\u0026q=85\u0026s=aeb3f239274998894ef55a8479547848"},"favicon":"https://mintcdn.com/mayan/9cbQIrAX62bh_PS2/favicon.jpg?fit=max\u0026auto=format\u0026n=9cbQIrAX62bh_PS2\u0026q=85\u0026s=4c106d1704be8a588bc623f31764bb2c","background":{"decoration":"grid","color":{"dark":"#1A1A1F"}},"navbar":{"links":[{"href":"https://github.com/mayan-finance/swap-sdk","label":"Integrate SDK"},{"href":"https://widget.mayan.finance/","label":"Add Widget"},{"href":"https://explorer.mayan.finance/","label":"Explorer"}],"primary":{"type":"button","label":"Start Bridging","href":"https://swap.mayan.finance/"}},"footer":{"socials":{"x":"https://x.com/mayan","discord":"https://discord.com/invite/MayanFinance"},"links":[{"header":"Resources","items":[{"label":"GitHub","href":"https://github.com/mayan-finance"},{"label":"Brand Kit","href":"https://drive.google.com/drive/folders/1rTsnJrREco-ygz37ZzFNPHN68mIPeAby"},{"label":"Mayan Explorer","href":"https://explorer.mayan.finance/"}]},{"header":"Product","items":[{"label":"Mayan App","href":"https://swap.mayan.finance/"},{"label":"Blog","href":"https://mayan.finance/blog"}]}]},"seo":{"metatags":{"og:image":"https://docs.mayan.finance/images/docs.mayan.finance.png","og:image:height":"630","og:image:width":"1200","og:type":"website","twitter:card":"summary_large_image","twitter:image":"https://docs.mayan.finance/images/docs.mayan.finance.png","twitter:site":"@mayan"}},"fonts":{"heading":{"family":"Space Grotesk"},"body":{"family":"Titillium Web"}},"integrations":{"mixpanel":{"projectToken":"f4732326d84c14f00a5dc597ae8dc8dc"}},"banner":{"content":"π **Integrators:** Swift v1 is now deprecated. Update the SDK to the latest version to run on Swift v2.","dismissible":true,"color":{"light":"#111111","dark":"#6C2A87"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.com/invite/MayanFinance"},{"anchor":"Blog","icon":"newspaper","href":"https://mayan.finance/blog"},{"anchor":"X","icon":"x-twitter","href":"https://x.com/mayan"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"mayan","hasAudioNarration":false,"actualSubdomain":"mayan","customDomains":["docs.mayan.finance"],"gitSource":{"type":"github","owner":"mayan-finance","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae1fa94661bff0c6e732daf","collectionId":"934dcbe7-7aad-4476-b8d0-32398d9e0238","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae1fa94661bff0c6e732daf"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae1fa94661bff0c6e732daf","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"INTEGRATION","count":16},{"language":"default","tag":"FEATURES","count":11},{"language":"default","tag":"SDK","count":7},{"language":"default","tag":"HOW MAYAN WORKS","count":6},{"language":"default","tag":"Deposit Addresses","count":6},{"language":"default","tag":"USE CASES","count":5},{"language":"default","tag":"GET STARTED","count":4},{"language":"default","tag":"SOLUTIONS","count":4},{"language":"default","tag":"Routes","count":3},{"language":"default","tag":"APIs","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":".dark li[id=topbar-cta-button]>a>div>span,li[id=topbar-cta-button]>a>div>span{color:#1a1a1f!important}li[id=topbar-cta-button]>a>div>svg>path{stroke:#1a1a1f!important}li[id=topbar-cta-button]>a>span{background:linear-gradient(90deg,#aeefff 0,#e0bfff 30%,#fff6b3 65%,#f8ffe5 100%)!important}.dark li[id=topbar-cta-button]>a>span{background:linear-gradient(90deg,#aeefff 0,#e0bfff 25%,#fff6b3 50%,#fff 100%)!important}.dark div[id=navbar]>div{background-color:#25252b!important}"}],"page":{"pagePath":"build/integrate-swap-api","slug":"/build/integrate-swap-api","pageMetadata":{"title":"Integrate the Swap API","description":"Build a cross-chain swap from scratch.","og:title":"Integrate the Swap API","href":"/build/integrate-swap-api"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Build a cross-chain swap from scratch.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Most integrations should use the `,_jsx(_components.a,{href:`/build/sdk`,children:`SDK`}),`, which builds the transaction for you on every supported chain.`]}),`\n`,_jsx(_components.p,{children:`Go directly to the API when you are working in a language the SDK does not cover, running quotes on a backend that never touches a wallet, or building the transaction yourself for another reason. This page covers the API surface and what you are responsible for once you skip the SDK.`}),`\n`,_jsx(Heading,{level:`2`,id:`what-you-implement-yourself`,children:`What you implement yourself`}),`\n`,_jsx(_components.p,{children:`Four things the SDK would otherwise handle:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Building the transaction for each source chain, including Solana instructions and Sui Move calls.`}),`\n`,_jsx(_components.li,{children:`ERC20 allowance against the Forwarder contract, or an EIP-2612 permit.`}),`\n`,_jsx(_components.li,{children:`Encoding the referrer addresses and verifying they match the quote.`}),`\n`,_jsxs(_components.li,{children:[`Reading route-specific fields off the quote and branching on `,_jsx(_components.code,{children:`type`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`get-a-quote`,children:`Get a quote`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://price-api.mayan.finance/v3/quote?amountIn=100\u0026fromToken=0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\u0026fromChain=avalanche\u0026toToken=0x0000000000000000000000000000000000000000\u0026toChain=solana\u0026slippageBps=300\u0026gasDrop=0\u0026swift=true\u0026mctp=true\u0026fastMctp=true\u0026wormhole=true\u0026forwarderAddress=0x337685fdaB40D39bd02028545a4FfA7D287cC3E2\u0026sdkVersion=15_3_0'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The full parameter list is on the `,_jsx(_components.a,{href:`/integration/quote-api`,children:`Quote API`}),` page. The ones that matter most:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Param`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amountIn64`})}),_jsxs(_components.td,{children:[`Base units. `,_jsx(_components.code,{children:`amountIn`}),` takes a human-readable number instead.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`slippageBps`})}),_jsx(_components.td,{children:`Basis points, max 500.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`swift`}),`, `,_jsx(_components.code,{children:`mctp`}),`, `,_jsx(_components.code,{children:`fastMctp`}),`, `,_jsx(_components.code,{children:`wormhole`}),`, `,_jsx(_components.code,{children:`monoChain`})]}),_jsxs(_components.td,{children:[`The route families to quote. Each one defaults to `,_jsx(_components.code,{children:`false`}),`, so set every route you want to `,_jsx(_components.code,{children:`true`}),`. A request with none of them set returns `,_jsx(_components.code,{children:`ROUTE_NOT_FOUND`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sdkVersion`})}),_jsxs(_components.td,{children:[`Required. Requests without it fail with `,_jsx(_components.code,{children:`406 SDK_VERSION_TOO_OLD`}),`. Send the latest SDK version, for example `,_jsx(_components.code,{children:`15_3_0`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`forwarderAddress`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.a,{href:`/integration/forwarder-contract`,children:`Forwarder`}),` address. Pass it on every EVM-source request, because Swift quotes are not returned without it.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`fullList`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),` returns every option, unsorted. Default returns at most two.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`apiKey`})}),_jsx(_components.td,{children:`Raises the per-IP rate limit.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`destinationAddress`})}),_jsx(_components.td,{children:`Improves accuracy, and is required for deposit addresses.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`read-the-quote`,children:`Read the quote`}),`\n`,_jsxs(_components.p,{children:[`The response is `,_jsx(_components.code,{children:`{ quotes: [...], minimumSdkVersion: [...] }`}),`. For each quote:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Use`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`SWIFT`}),`, `,_jsx(_components.code,{children:`MCTP`}),`, `,_jsx(_components.code,{children:`FAST_MCTP`}),`, or `,_jsx(_components.code,{children:`WH`}),`. Determines which contract you interact with.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`expectedAmountOut`})}),_jsx(_components.td,{children:`Display this to the user.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`minAmountOut`})}),_jsx(_components.td,{children:`The floor.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`minReceived`})}),_jsx(_components.td,{children:`The floor after relayer fees are deducted.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`etaSeconds`}),` / `,_jsx(_components.code,{children:`clientEta`})]}),_jsx(_components.td,{children:`Estimated settlement, in seconds and as a display string.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`deadline64`})}),_jsx(_components.td,{children:`After this, the order can no longer be filled and becomes refundable.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`swiftAuctionMode`})}),_jsxs(_components.td,{children:[`Swift only. `,_jsx(_components.code,{children:`3`}),` means `,_jsx(_components.a,{href:`/features/guaranteed-price`,children:`Guaranteed Price`}),`: the user receives exactly `,_jsx(_components.code,{children:`expectedAmountOut`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`protocolBps`}),` / `,_jsx(_components.code,{children:`referrerBps`})]}),_jsx(_components.td,{children:`Fees applied to this quote.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`swiftMayanContract`})}),_jsx(_components.td,{children:`Swift only. The contract to send to.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`gasless`})}),_jsx(_components.td,{children:`Whether this quote executes without source-chain gas.`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Do not assume every quote in the array is the same route type. Check `,_jsx(_components.code,{children:`type`}),` on the specific quote you selected before building anything.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`approve-the-input-token`,children:`Approve the input token`}),`\n`,_jsxs(_components.p,{children:[`For an ERC20 input on EVM, approve the Mayan Forwarder contract for at least `,_jsx(_components.code,{children:`effectiveAmountIn64`}),` before sending the swap. The address is in `,_jsx(_components.code,{children:`forwarderAddress`}),` on the quote request, and documented on `,_jsx(_components.a,{href:`/integration/forwarder-contract`,children:`Forwarder Contract`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Tokens supporting `,_jsx(_components.a,{href:`https://eips.ethereum.org/EIPS/eip-2612`,children:`EIP-2612`}),` can use a permit signature instead, which saves the user a transaction.`]}),`\n`,_jsx(_components.p,{children:`Native inputs need no approval.`}),`\n`,_jsx(Heading,{level:`2`,id:`send-the-transaction`,children:`Send the transaction`}),`\n`,_jsxs(_components.p,{children:[`The contract and calldata depend on `,_jsx(_components.code,{children:`type`}),`. Read the route page for the one you are using:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/architecture/swift`,children:`Swift`}),`, the default for most pairs.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/architecture/mctp`,children:`MCTP and Fast MCTP`}),`, built around Circleβs CCTP.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/architecture/wh-swap`,children:`Wormhole Swap`}),`.`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`getSwapFromEvmTxPayload`}),` returns the payload without sending it, and its `,_jsx(_components.code,{children:`_forwarder`}),` object gives you the method name and parameters for a contract-level call. See `,_jsx(_components.a,{href:`/build/sdk/manual-transactions`,children:`manual transaction building`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`track-it`,children:`Track it`}),`\n`,_jsxs(_components.p,{children:[`Poll the `,_jsx(_components.a,{href:`/integration/explorer-api`,children:`Explorer API`}),` with the source transaction hash and read `,_jsx(_components.code,{children:`clientStatus`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://explorer-api.mayan.finance/v3/swap/trx/{sourceTxHash}'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`INPROGRESS`}),`, `,_jsx(_components.code,{children:`COMPLETED`}),`, or `,_jsx(_components.code,{children:`REFUNDED`}),`. See `,_jsx(_components.a,{href:`/build/track-transactions`,children:`Track Transactions`}),` for handling each state.`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-chains-and-tokens`,children:`Supported chains and tokens`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`GET https://sia.mayan.finance/v10/init`}),` returns every supported chain, with `,_jsx(_components.code,{children:`originActive`}),` and `,_jsx(_components.code,{children:`destinationActive`}),` telling you which direction each supports.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`GET https://price-api.mayan.finance/v3/tokens?chain=solana`}),` returns the whitelisted token list. Drop `,_jsx(_components.code,{children:`chain`}),` for all chains. Any token with a contract address is routable, whitelisted or not, given liquidity.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The API does not return a documented error-code enum. The `,_jsx(_components.a,{href:`/build/sdk`,children:`SDK`}),` handles quote and execution failures for you, so if you can use it, use it.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Integrate the Swap API","description":"Build a cross-chain swap from scratch.","og:title":"Integrate the Swap API","href":"/build/integrate-swap-api"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What you implement yourself","slug":"what-you-implement-yourself","depth":2,"children":[]},{"title":"Get a quote","slug":"get-a-quote","depth":2,"children":[]},{"title":"Read the quote","slug":"read-the-quote","depth":2,"children":[]},{"title":"Approve the input token","slug":"approve-the-input-token","depth":2,"children":[]},{"title":"Send the transaction","slug":"send-the-transaction","depth":2,"children":[]},{"title":"Track it","slug":"track-it","depth":2,"children":[]},{"title":"Supported chains and tokens","slug":"supported-chains-and-tokens","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"mayan","siteName":"Mayan Docs","title":"Integrate the Swap API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-27T08:20:23.870Z","originalFileLocation":"build/integrate-swap-api.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Build a cross-chain swap from scratch.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Mayan Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mayan/51m6s7MvVlAr2I5C/_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/mayan/51m6s7MvVlAr2I5C/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mayan/51m6s7MvVlAr2I5C/_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/mayan/51m6s7MvVlAr2I5C/_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/mayan/51m6s7MvVlAr2I5C/_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/mayan/51m6s7MvVlAr2I5C/_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/mayan/51m6s7MvVlAr2I5C/_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/mayan/51m6s7MvVlAr2I5C/_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/mayan/51m6s7MvVlAr2I5C/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Integrate the Swap API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Build a cross-chain swap from scratch.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Mayan Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.mayan.finance/build/integrate-swap-api\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.mayan.finance/images/docs.mayan.finance.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=\"Integrate the Swap API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Build a cross-chain swap from scratch.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.mayan.finance/images/docs.mayan.finance.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=\"/mintlify-assets/_mintlify/favicons/mayan/51m6s7MvVlAr2I5C/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Mayan Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6C2A87\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.mayan.finance/build/integrate-swap-api\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/build/integrate-swap-api.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.mayan.finance/#organization\",\"name\":\"Mayan Docs\",\"url\":\"https://docs.mayan.finance\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/mayan/Ivxrs0esdid731no/logo/light.svg?fit=max\u0026auto=format\u0026n=Ivxrs0esdid731no\u0026q=85\u0026s=1d8956e57978829816e2a2b2b4596ef0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.mayan.finance#website\",\"name\":\"Mayan Docs\",\"url\":\"https://docs.mayan.finance\",\"publisher\":{\"@id\":\"https://docs.mayan.finance/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.mayan.finance/build/integrate-swap-api#webpage\",\"url\":\"https://docs.mayan.finance/build/integrate-swap-api\",\"name\":\"Integrate the Swap API\",\"description\":\"Build a cross-chain swap from scratch.\",\"dateModified\":\"2026-10-27T08:20:23.870Z\",\"isPartOf\":{\"@id\":\"https://docs.mayan.finance#website\"},\"breadcrumb\":{\"@id\":\"https://docs.mayan.finance/build/integrate-swap-api#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.mayan.finance/build/integrate-swap-api#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"INTEGRATION\",\"item\":\"https://docs.mayan.finance/build/sdk\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integrate the Swap API\",\"item\":\"https://docs.mayan.finance/build/integrate-swap-api\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.mayan.finance/build/integrate-swap-api#article\",\"headline\":\"Integrate the Swap API\",\"name\":\"Integrate the Swap API\",\"description\":\"Build a cross-chain swap from scratch.\",\"url\":\"https://docs.mayan.finance/build/integrate-swap-api\",\"mainEntityOfPage\":{\"@id\":\"https://docs.mayan.finance/build/integrate-swap-api#webpage\"},\"image\":\"https://docs.mayan.finance/images/docs.mayan.finance.png\",\"dateModified\":\"2026-10-27T08:20:23.870Z\",\"publisher\":{\"@id\":\"https://docs.mayan.finance/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.mayan.finance#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Mayan Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Mayan Docs","nav":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.com/invite/MayanFinance"},{"anchor":"Blog","icon":"newspaper","href":"https://mayan.finance/blog"},{"anchor":"X","icon":"x-twitter","href":"https://x.com/mayan"}]},"groups":[{"group":"GET STARTED","pages":[{"title":"What is Mayan?","sidebarTitle":"What is Mayan","href":"/index"},{"title":"Quickstart","sidebarTitle":"Quickstart","href":"/get-started/quickstart"},{"title":"Why Mayan","href":"/get-started/why-mayan"},{"title":"How to Use Mayan","sidebarTitle":"How to Use Mayan","href":"/application/user-manual"}]},{"group":"USE CASES","pages":[{"title":"Swap","href":"/use-cases/swap"},{"title":"Bridge","href":"/use-cases/bridge"},{"title":"Deposit \u0026 Withdraw","sidebarTitle":"Deposit \u0026 Withdraw","href":"/use-cases/deposit"},{"title":"Pay","href":"/use-cases/pay"},{"title":"Orchestrate","href":"/use-cases/orchestrate"}]},{"group":"SOLUTIONS","pages":[{"title":"Wallets","href":"/solutions/wallets"},{"title":"Applications","href":"/solutions/applications"},{"title":"Chains","href":"/solutions/chains"},{"title":"Merchants","sidebarTitle":"Merchants","href":"/solutions/commerce"}]},{"group":"HOW MAYAN WORKS","pages":[{"title":"Intents","sidebarTitle":"Intents","href":"/how-mayan-works/intent-based-swaps"},{"group":"Routes","pages":[{"title":"Swift","href":"/architecture/swift"},{"title":"MCTP","sidebarTitle":"MCTP / Fast MCTP","href":"/architecture/mctp"},{"title":"Wormhole Swap","href":"/architecture/wh-swap"}]},{"title":"Refunds","href":"/how-mayan-works/refunds"},{"title":"Mayan Explorer","href":"/application/mayan-explorer"}]},{"group":"FEATURES","pages":[{"title":"Guaranteed Price","href":"/features/guaranteed-price"},{"group":"Deposit Addresses","pages":[{"title":"Deposit Addresses","sidebarTitle":"Overview","href":"/features/deposit-addresses"},{"title":"Payments Quickstart","sidebarTitle":"Quickstart","href":"/payment-service/quickstart"},{"title":"Swap Statuses","href":"/payment-service/statuses"},{"title":"Events","href":"/payment-service/events"},{"title":"API Reference","href":"/payment-service/api-reference"},{"title":"Examples","href":"/payment-service/examples"}]},{"title":"Hyperliquid (HyperCore)","sidebarTitle":"HyperCore Deposit \u0026 Withdraw","href":"/integration/hyperliquid"},{"title":"Zaps (Custom Payloads)","sidebarTitle":"Zaps (Custom Payloads)","href":"/integration/custom-payload"},{"title":"Gas Drop On Destination","sidebarTitle":"Gas on Destination","href":"/application/gas-on-destination"},{"title":"Gasless Execution","href":"/features/gasless-execution"}]},{"group":"INTEGRATION","pages":[{"group":"SDK","pages":[{"title":"SDK","sidebarTitle":"Overview","href":"/build/sdk"},{"title":"Fetching Quotes","href":"/build/sdk/fetching-quotes"},{"title":"Executing Swaps","href":"/build/sdk/executing-swaps"},{"title":"Swap SDK","url":"https://www.npmjs.com/package/@mayanfinance/swap-sdk","hidden":true,"href":"/link/swap"},{"title":"Fees \u0026 Earning","href":"/build/fees-earning"},{"title":"Fee Splitting","href":"/build/sdk/fee-splitting"},{"title":"Manual Transaction Building","href":"/build/sdk/manual-transactions"},{"title":"Mayan Forwarder Contract","sidebarTitle":"Forwarder Contract","href":"/integration/forwarder-contract"}]},{"title":"Swap Widget","sidebarTitle":"Widget","description":null,"href":"/integration/swap-widget"},{"group":"APIs","pages":[{"title":"Integrate the Swap API","href":"/build/integrate-swap-api"},{"title":"Quote API","description":null,"href":"/integration/quote-api"},{"title":"Explorer API","href":"/integration/explorer-api"}]},{"group":"Guides","pages":[{"title":"Track Transactions","href":"/build/track-transactions"},{"title":"Direct Route Linking","sidebarTitle":"Direct Route Linking","href":"/build/direct-route-linking"}]},{"title":"Relayer Fees","hidden":true,"href":"/application/relayer-fees"},{"title":"Chains \u0026 Contracts","href":"/resources/chains-contracts"},{"title":"Technical FAQ","href":"/resources/technical-faq"},{"title":"Compliance","href":"/resources/compliance"}]},{"group":"RESOURCES","pages":[{"title":"Brand Kit","url":"https://drive.google.com/drive/folders/1rTsnJrREco-ygz37ZzFNPHN68mIPeAby","sidebarTitle":"Brand Kit","href":"/link/brand"},{"title":"Security \u0026 Audits","href":"/resources/audits"},{"title":"Github","url":"https://github.com/mayan-finance","sidebarTitle":"GitHub","href":"/link/github"}]},{"group":"AI AGENTS","pages":[{"title":"llms.txt \u0026 Markdown","href":"/ai-agents/llms-txt"},{"title":"AGENTS.md","href":"/ai-agents/agents-md"}]}]},"basePath":"","title":"Integrate the Swap API","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["10e4515597"],"chunks":["BannerMarkdown-DHaG7hr_.js","dist-DKZWslLH.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-BIWXJmsZ.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}