How to test token-to-token swap flows in the sandbox environment
Prerequisite: Your organization must be approved before it can quote. Swaps do not need a bank account. For onboarding your customers, see KYC Overview.
A swap exchanges one asset for another on the same chain. In v2 a swap is a quote and an order between two wallet payment accounts, the same way an onramp or offramp is. The destination can be the same wallet as the source, or another wallet on the same chain.Every call below runs for one organization, set as $ORGANIZATION_ID in the examples. Use your own organization’s id from GET /me, or a customer organization’s id when you swap for that customer. Register the wallets, quote and order under the same id. See Organizations in the route.
export ORGANIZATION_ID=<organization_id>
Swaps run on Stellar, Solana and Monad. The source and destination wallets must be on the same chain. To move the same token to a wallet on another chain, quote a cross-chain transfer instead. A quote between different tokens on different chains returns 400invalid-request. Base, Polygon and Avalanche support onramps and offramps, not swaps.
Stellar swaps need a funded, trustlined wallet. The wallet must hold XLM for the network fee and a trustline for the asset it receives. See the Stellar, Solana and Monad chain guides for per-chain setup.
Register the wallets: POST /organization/{organizationId}/payment_account
Show Details
Register the wallet that sends the source asset. To deliver to a different wallet, register that one too. See Register payment account for the full schema.
Create a quote: POST /organization/{organizationId}/quote
Show Details
Quote between the two wallet accounts. Each account must belong to the organization in the route or to your API key’s organization. Quotes expire 2 minutes after they are created (expiresAt). The response includes rateBeforeFees, rateAfterFees and midMarketRate. See Create quote for the full schema.
Partner fees: We apply your organization’s partner fee automatically. To set it for one quote, add "partnerFeeBpsOverride": 100. We cap values above 500. See Partner fees.
4
Create the order: POST /organization/{organizationId}/order
Show Details
Send the quoteId. The response is 201 with the full order, and the order’s id equals the quoteId. See Create order for the full schema.
As on an offramp, fundingInstructions.rail is the chain, and fundingInstructions.destination gives the address to send to, a memo when one is needed, and a preparedTransaction when we built one.
5
Send the source asset
Show Details
The swap does not start until the customer’s wallet sends the source asset. Fund the order before fundingDeadline in one of two ways:
Sign the prepared transaction. When preparedTransaction is present, sign transaction with the customer’s wallet and submit it to the network.
Send a transfer yourself. Send the order’s source.amount of source.asset to address, with memo when it is present.
Prepared transactions go stale. A Solana or Stellar transaction goes stale after refreshAfter. A Stellar or EVM transaction also goes stale when the wallet sends another transaction first. In either case, call POST /organization/{organizationId}/order/{id}/funding_instructions/refresh. The new funding instructions arrive a moment later in an orderUpdated webhook and on GET.
6
Track the order: GET /organization/{organizationId}/order/{id}
Show Details
We receive the source asset, run the swap on the chain’s venue, and deliver the result to the destination wallet. The status moves created → funded → completed. Read the order with Get order, or subscribe to orderUpdated with POST /webhook_subscription.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Etherfuse API","colors":{"primary":"#141414","light":"#E4FF3F","dark":"#141414"},"logo":{"light":"https://mintcdn.com/etherfuse/XRSchVFGUgreQatD/img/logo-black.svg?fit=max\u0026auto=format\u0026n=XRSchVFGUgreQatD\u0026q=85\u0026s=92cf84eca27df4a19f7b032da398d110","dark":"https://mintcdn.com/etherfuse/XRSchVFGUgreQatD/img/logo-white.svg?fit=max\u0026auto=format\u0026n=XRSchVFGUgreQatD\u0026q=85\u0026s=7c87780c9a248347ffe6357ccf6762ed","href":"https://etherfuse.com"},"favicon":"https://mintcdn.com/etherfuse/pF4txuzXWQE790kS/img/favicon.png?fit=max\u0026auto=format\u0026n=pF4txuzXWQE790kS\u0026q=85\u0026s=ac74be5f7f4605e75bc961be0c6e5ff9","api":{"playground":{"display":"interactive"},"examples":{"languages":["curl","javascript","python"],"autogenerate":true}},"navbar":{"links":[{"href":"https://cal.com/team/etherfuse/api-overview?overlayCalendar=true","label":"Book a demo"},{"href":"https://app.etherfuse.com","label":"App"}],"primary":{"type":"button","label":"Get sandbox keys","href":"https://sandbox.etherfuse.com/sign-in?returnTo=%2Faccount%2Fmanage"}},"footer":{"links":[{"items":[{"label":"Website","href":"https://etherfuse.com"},{"label":"App","href":"https://app.etherfuse.com"},{"label":"Book a demo","href":"https://cal.com/team/etherfuse/api-overview?overlayCalendar=true"}]}]},"fonts":{"family":"Figtree"},"integrations":{"posthog":{"apiKey":"phc_vJEpZk4aZr9PxdPqapjg8ZKWFybTTmDvAxZNg88LTuPu","apiHost":"https://us.i.posthog.com"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"etherfuse","hasAudioNarration":false,"actualSubdomain":"etherfuse","customDomains":["docs.etherfuse.com"],"gitSource":{"type":"github","owner":"etherfuse","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae547dfd382909612c83cf7","collectionId":"eee1a3e5-d040-4b45-980d-cc540ca77f29","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae547dfd382909612c83cf7"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae547dfd382909612c83cf7","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"API Reference","count":151},{"language":"default","tag":"Ramp API","count":72},{"language":"default","tag":"Guides","count":65},{"language":"default","tag":"KYC","count":20},{"language":"default","tag":"Lookup API","count":18},{"language":"default","tag":"Orders","count":17},{"language":"default","tag":"Organizations","count":16},{"language":"default","tag":"User Authentication","count":12},{"language":"default","tag":"Blockchains","count":12},{"language":"default","tag":"Integration Guides","count":12}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":true},"customCss":[{"filePath":"global.css","content":"body{scrollbar-gutter:stable}.sandbox-playground-cta{display:block;margin:1rem 0 1.25rem;padding:1rem 1.25rem;border-radius:.75rem;border:1px solid #141414;background-color:#e4ff3f;color:#141414!important;text-decoration:none;transition:background-color .15s ease,box-shadow .15s ease}.sandbox-playground-cta:hover{background-color:#d8f32f;box-shadow:0 2px 8px rgba(20,20,20,.12);color:#141414!important}.sandbox-playground-cta__body,.sandbox-playground-cta__detail,.sandbox-playground-cta__title{color:inherit!important}.dark .sandbox-playground-cta{border-color:#e4ff3f;background-color:#e4ff3f;color:#141414!important}.dark .sandbox-playground-cta:hover{background-color:#d8f32f;color:#141414!important}.sandbox-playground-cta__title{display:block;font-size:1rem;font-weight:600;margin-bottom:.35rem}.sandbox-playground-cta__body{display:block;font-size:.95rem;line-height:1.45;font-weight:500}.sandbox-playground-cta__detail{display:block;margin-top:.35rem;font-size:.85rem;line-height:1.45;opacity:.85}"}],"page":{"pagePath":"v2/guides/testing-swaps","slug":"/v2/guides/testing-swaps","pageMetadata":{"title":"Swaps","description":"How to test token-to-token swap flows in the sandbox environment","href":"/v2/guides/testing-swaps"},"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: \"How to test token-to-token swap flows in the sandbox environment\"\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`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Expandable,Heading,Info,Step,Steps,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Prerequisite:`}),` Your organization must be approved before it can quote. Swaps do not need a bank account. For onboarding your customers, see `,_jsx(_components.a,{href:`/v2/guides/onboarding`,children:`KYC Overview`}),`.`]})}),`\n`,_jsx(_components.p,{children:`A swap exchanges one asset for another on the same chain. In v2 a swap is a quote and an order between two wallet payment accounts, the same way an onramp or offramp is. The destination can be the same wallet as the source, or another wallet on the same chain.`}),`\n`,_jsxs(_components.p,{children:[`Every call below runs for one organization, set as `,_jsx(_components.code,{children:`$ORGANIZATION_ID`}),` in the examples. Use your own organization’s id from `,_jsx(_components.code,{children:`GET /me`}),`, or a customer organization’s id when you swap for that customer. Register the wallets, quote and order under the same id. See `,_jsx(_components.a,{href:`/v2/overview#organizations-in-the-route`,children:`Organizations in the route`}),`.`]}),`\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:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ORGANIZATION_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`organization_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Swaps run on `,_jsx(_components.strong,{children:`Stellar`}),`, `,_jsx(_components.strong,{children:`Solana`}),` and `,_jsx(_components.strong,{children:`Monad`}),`. The source and destination wallets must be on the `,_jsx(_components.strong,{children:`same chain`}),`. To move the same token to a wallet on another chain, quote a `,_jsx(_components.a,{href:`/v2/overview`,children:`cross-chain transfer`}),` instead. A quote between different tokens on different chains returns `,_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`invalid-request`}),`. Base, Polygon and Avalanche support onramps and offramps, not swaps.`]})}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Stellar swaps need a funded, trustlined wallet.`}),` The wallet must hold XLM for the network fee and a trustline for the asset it receives. See the `,_jsx(_components.a,{href:`/v2/guides/chains/stellar#offramps-and-swaps-fund-the-wallet-first`,children:`Stellar`}),`, `,_jsx(_components.a,{href:`/v2/guides/chains/solana`,children:`Solana`}),` and `,_jsx(_components.a,{href:`/v2/guides/chains/monad`,children:`Monad`}),` chain guides for per-chain setup.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`swap-flow`,children:`Swap flow`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Discover assets`,children:_jsxs(Expandable,{title:`Details`,children:[_jsx(_components.p,{children:`Either of these endpoints gives you the asset identifiers for a quote:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/v2/api-reference/assets/list-supported-assets`,children:`GET /supported_assets`}),` requires auth. Pass `,_jsx(_components.code,{children:`paymentAccountId`}),` with a wallet’s id to list the tokens on that wallet’s chain.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/v2/api-reference/lookup/list-stablebonds`,children:`GET /lookup/stablebonds`}),` is public. It returns every stablebond on every chain, with pricing and supply data.`]}),`\n`]}),_jsxs(_components.p,{children:[`Use a token’s `,_jsx(_components.code,{children:`asset`}),` from the first, or the `,_jsx(_components.code,{children:`identifier`}),` from the second, as `,_jsx(_components.code,{children:`sourceAsset`}),` and `,_jsx(_components.code,{children:`destinationAsset`}),`.`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Swap rules:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`At least one side must be a stablebond. The other side can be a stablecoin such as USDC, so `,_jsx(_components.code,{children:`USDC → CETES`}),` and `,_jsx(_components.code,{children:`CETES → USDC`}),` both work.`]}),`\n`,_jsxs(_components.li,{children:[`Both assets must be stablebonds or supported stablecoins. Non-stable tokens (SOL, XLM) return `,_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`invalid-request`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Stablecoin-to-stablecoin swaps (`,_jsx(_components.code,{children:`USDC → USDT`}),`) return `,_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`invalid-request`}),`.`]}),`\n`,_jsx(_components.li,{children:`The two assets must differ.`}),`\n`]}),_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Asset identifier format differs by chain:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Solana:`}),` Base58 mint address (for example `,_jsx(_components.code,{children:`AvvetPGuuB5FD5m86fpw3LtDKyQoUFT1mG9WarNQLW4q`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Stellar:`}),` `,_jsx(_components.code,{children:`CODE:ISSUER`}),` (for example `,_jsx(_components.code,{children:`CETES:GC3CW7...`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Monad:`}),` the raw token contract address only (for example `,_jsx(_components.code,{children:`0xcC77c598d42f2f78Beb42C91d12B9d4041a5cE29`}),`)`]}),`\n`]})]}),_jsxs(Tip,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`USDC identifiers:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Stellar sandbox:`}),` `,_jsx(_components.code,{children:`USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Stellar production:`}),` `,_jsx(_components.code,{children:`USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Solana sandbox:`}),` `,_jsx(_components.code,{children:`4D4r1KuS9WxbPCzzAJnWtYUJSSzDEZzrF1CbwajWGVjg`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Solana production:`}),` `,_jsx(_components.code,{children:`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`})]}),`\n`]})]})]})}),_jsx(Step,{title:`Register the wallets: POST /organization/{organizationId}/payment_account`,children:_jsxs(Expandable,{title:`Details`,children:[_jsxs(_components.p,{children:[`Register the wallet that sends the source asset. To deliver to a different wallet, register that one too. See `,_jsx(_components.a,{href:`/v2/api-reference/payment-accounts/register-payment-account`,children:`Register payment account`}),` for the full schema.`]}),_jsx(CodeBlock,{filename:`Sandbox`,numberOfLines:`12`,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:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.sand.etherfuse.com/organization/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ORGANIZATION_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/payment_account`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: \u003capi_key>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"kind\": \"wallet\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"label\": \"Treasury wallet\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"accountDetails\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"kind\": \"address\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"address\": \"GDUKMGUGD3V6VXTU2RLAUM7A2FABLMHCPWTMDHKP7HHJ6FCZKEY4PVWL\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"chain\": \"stellar\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsxs(_components.p,{children:[`The source wallet needs `,_jsx(_components.code,{children:`source`}),` ready on its chain rail, and the destination wallet needs `,_jsx(_components.code,{children:`destination`}),` ready. Read the account again with `,_jsx(_components.a,{href:`/v2/api-reference/payment-accounts/get-payment-account`,children:`GET /organization/{organizationId}/payment_account/{id}`}),` to check.`]})]})}),_jsx(Step,{title:`Create a quote: POST /organization/{organizationId}/quote`,children:_jsxs(Expandable,{title:`Details`,children:[_jsxs(_components.p,{children:[`Quote between the two wallet accounts. Each account must belong to the organization in the route or to your API key’s organization. Quotes expire `,_jsx(_components.strong,{children:`2 minutes`}),` after they are created (`,_jsx(_components.code,{children:`expiresAt`}),`). The response includes `,_jsx(_components.code,{children:`rateBeforeFees`}),`, `,_jsx(_components.code,{children:`rateAfterFees`}),` and `,_jsx(_components.code,{children:`midMarketRate`}),`. See `,_jsx(_components.a,{href:`/v2/api-reference/quotes/create-quote`,children:`Create quote`}),` for the full schema.`]}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Sandbox`,numberOfLines:`10`,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:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.sand.etherfuse.com/organization/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ORGANIZATION_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/quote`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: \u003capi_key>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"source\": { \"type\": \"stored\", \"id\": \"\u003cwallet_payment_account_id>\" },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"destination\": { \"type\": \"stored\", \"id\": \"\u003cwallet_payment_account_id>\" },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sourceAmount\": \"10\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sourceAsset\": \"USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"destinationAsset\": \"CETES:GC3CW7EDYRTWQ635VDIGY6S4ZUF5L6TQ7AA4MWS7LEQDBLUSZXV7UPS4\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Production`,numberOfLines:`10`,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:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.etherfuse.com/organization/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ORGANIZATION_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/quote`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: \u003capi_key>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"source\": { \"type\": \"stored\", \"id\": \"\u003cwallet_payment_account_id>\" },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"destination\": { \"type\": \"stored\", \"id\": \"\u003cwallet_payment_account_id>\" },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sourceAmount\": \"10\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sourceAsset\": \"USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"destinationAsset\": \"CETES:GC3CW7EDYRTWQ635VDIGY6S4ZUF5L6TQ7AA4MWS7LEQDBLUSZXV7UPS4\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})]}),_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Partner fees:`}),` We apply your organization’s partner fee automatically. To set it for one quote, add `,_jsx(_components.code,{children:`\"partnerFeeBpsOverride\": 100`}),`. We cap values above 500. See `,_jsx(_components.a,{href:`/v2/fees#partner-fees`,children:`Partner fees`}),`.`]})})]})}),_jsx(Step,{title:`Create the order: POST /organization/{organizationId}/order`,children:_jsxs(Expandable,{title:`Details`,children:[_jsxs(_components.p,{children:[`Send the `,_jsx(_components.code,{children:`quoteId`}),`. The response is `,_jsx(_components.code,{children:`201`}),` with the full order, and the order’s `,_jsx(_components.code,{children:`id`}),` equals the `,_jsx(_components.code,{children:`quoteId`}),`. See `,_jsx(_components.a,{href:`/v2/api-reference/orders/create-order`,children:`Create order`}),` for the full schema.`]}),_jsx(CodeBlock,{filename:`Sandbox`,numberOfLines:`4`,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:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.sand.etherfuse.com/organization/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ORGANIZATION_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/order`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: \u003capi_key>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{ \"quoteId\": \"\u003cquote_id>\" }'`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`As on an offramp, `,_jsx(_components.code,{children:`fundingInstructions.rail`}),` is the chain, and `,_jsx(_components.code,{children:`fundingInstructions.destination`}),` gives the `,_jsx(_components.code,{children:`address`}),` to send to, a `,_jsx(_components.code,{children:`memo`}),` when one is needed, and a `,_jsx(_components.code,{children:`preparedTransaction`}),` when we built one.`]})]})}),_jsx(Step,{title:`Send the source asset`,children:_jsxs(Expandable,{title:`Details`,children:[_jsxs(_components.p,{children:[`The swap does not start until the customer’s wallet sends the source asset. Fund the order before `,_jsx(_components.code,{children:`fundingDeadline`}),` in one of two ways:`]}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Sign the prepared transaction.`}),` When `,_jsx(_components.code,{children:`preparedTransaction`}),` is present, sign `,_jsx(_components.code,{children:`transaction`}),` with the customer’s wallet and submit it to the network.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Send a transfer yourself.`}),` Send the order’s `,_jsx(_components.code,{children:`source.amount`}),` of `,_jsx(_components.code,{children:`source.asset`}),` to `,_jsx(_components.code,{children:`address`}),`, with `,_jsx(_components.code,{children:`memo`}),` when it is present.`]}),`\n`]}),_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Prepared transactions go stale.`}),` A Solana or Stellar transaction goes stale after `,_jsx(_components.code,{children:`refreshAfter`}),`. A Stellar or EVM transaction also goes stale when the wallet sends another transaction first. In either case, call `,_jsx(_components.a,{href:`/v2/api-reference/orders/refresh-funding-instructions`,children:`POST /organization/{organizationId}/order/{id}/funding_instructions/refresh`}),`. The new funding instructions arrive a moment later in an `,_jsx(_components.code,{children:`orderUpdated`}),` webhook and on GET.`]})})]})}),_jsx(Step,{title:`Track the order: GET /organization/{organizationId}/order/{id}`,children:_jsxs(Expandable,{title:`Details`,children:[_jsxs(_components.p,{children:[`We receive the source asset, run the swap on the chain’s venue, and deliver the result to the destination wallet. The status moves `,_jsx(_components.code,{children:`created`}),` → `,_jsx(_components.code,{children:`funded`}),` → `,_jsx(_components.code,{children:`completed`}),`. Read the order with `,_jsx(_components.a,{href:`/v2/api-reference/orders/get-order`,children:`Get order`}),`, or subscribe to `,_jsx(_components.a,{href:`/v2/api-reference/webhook-events/orderupdated`,children:_jsx(_components.code,{children:`orderUpdated`})}),` with `,_jsx(_components.a,{href:`/v2/api-reference/webhook-subscriptions/create-webhook-subscription`,children:`POST /webhook_subscription`}),`.`]}),_jsx(CodeBlock,{filename:`Sandbox`,numberOfLines:`2`,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:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: \u003capi_key>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.sand.etherfuse.com/organization/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ORGANIZATION_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/order/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`order_i`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`d`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Swaps are orders, so `,_jsx(_components.a,{href:`/v2/api-reference/orders/list-orders`,children:`List orders`}),` returns them with your onramps and offramps.`]})]})})]}),`\n`,_jsxs(Expandable,{title:`Chain-specific swap examples`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Stellar:`}),` USDC to CETES:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stored\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cstellar_wallet_payment_account_id>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"destination\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stored\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cstellar_wallet_payment_account_id>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sourceAmount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sourceAsset\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"destinationAsset\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"CETES:GC3CW7EDYRTWQ635VDIGY6S4ZUF5L6TQ7AA4MWS7LEQDBLUSZXV7UPS4\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Solana:`}),` USDC to CETES:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stored\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003csolana_wallet_payment_account_id>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"destination\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stored\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003csolana_wallet_payment_account_id>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sourceAmount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sourceAsset\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"4D4r1KuS9WxbPCzzAJnWtYUJSSzDEZzrF1CbwajWGVjg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"destinationAsset\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AvvetPGuuB5FD5m86fpw3LtDKyQoUFT1mG9WarNQLW4q\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsxs(Expandable,{title:`Common errors`,children:[_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Error`}),_jsx(_components.th,{children:`Cause`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`invalid-request`}),`, no stablebond`]}),_jsx(_components.td,{children:`Neither side is a stablebond (for example a stablecoin-to-stablecoin swap)`}),_jsxs(_components.td,{children:[`Make one side a stablebond. Use identifiers from `,_jsx(_components.code,{children:`/lookup/stablebonds`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`invalid-request`}),`, non-stable asset`]}),_jsx(_components.td,{children:`A side is a non-stable token (SOL, XLM, ETH)`}),_jsx(_components.td,{children:`Use a stablebond or a supported stablecoin on both sides`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`invalid-request`}),`, cross-chain`]}),_jsx(_components.td,{children:`The two wallets are on different chains and hold different tokens`}),_jsx(_components.td,{children:`Swap on one chain, or send the same token across chains`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`invalid-request`}),`, same asset`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sourceAsset`}),` equals `,_jsx(_components.code,{children:`destinationAsset`})]}),_jsx(_components.td,{children:`Pick two different assets`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`quote-expired`})]}),_jsx(_components.td,{children:`The quote is older than 2 minutes, or does not exist`}),_jsx(_components.td,{children:`Create a new quote`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`payment-account-not-ready`})]}),_jsxs(_components.td,{children:[`A wallet is not `,_jsx(_components.code,{children:`ready`}),` in the needed direction`]}),_jsxs(_components.td,{children:[`Check the wallet’s `,_jsx(_components.code,{children:`rails`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`422`}),` `,_jsx(_components.code,{children:`quote-unavailable`})]}),_jsx(_components.td,{children:`We cannot quote this path right now, for example thin sandbox liquidity, or the chain has no swap venue`}),_jsx(_components.td,{children:`Retry with backoff. Swaps run only on Stellar, Solana and Monad`})]})]})]}),_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/v2/errors`,children:`Errors`}),` for every problem type.`]})]})]})}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":"Swaps","description":"How to test token-to-token swap flows in the sandbox environment","href":"/v2/guides/testing-swaps"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Swap flow","slug":"swap-flow","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"etherfuse","siteName":"Etherfuse API","title":"Swaps - Etherfuse API","navMaps":{"firstHrefInVersion":{"v2 (beta)":{"href":"/v2/guides/testing-swaps","matchLevel":0},"v1 (legacy)":{"href":"/guides/testing-swaps","matchLevel":1}},"firstHrefInLanguage":{}},"lastModified":"2026-10-20T18:16:44.602Z","originalFileLocation":"v2/guides/testing-swaps.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How to test token-to-token swap flows in the sandbox environment\">\u003cmeta data-mint-head name=\"application-name\" content=\"Etherfuse API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/etherfuse/2PYR-_ECBzhTGa_z/_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/etherfuse/2PYR-_ECBzhTGa_z/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/etherfuse/2PYR-_ECBzhTGa_z/_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/etherfuse/2PYR-_ECBzhTGa_z/_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/etherfuse/2PYR-_ECBzhTGa_z/_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/etherfuse/2PYR-_ECBzhTGa_z/_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/etherfuse/2PYR-_ECBzhTGa_z/_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/etherfuse/2PYR-_ECBzhTGa_z/_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/etherfuse/2PYR-_ECBzhTGa_z/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Swaps - Etherfuse API\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to test token-to-token swap flows in the sandbox environment\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Etherfuse API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.etherfuse.com/v2/guides/testing-swaps\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://etherfuse.mintlify.app/_mintlify/api/og/v2?division=Integration+Guides\u0026amp;title=Swaps\u0026amp;description=How+to+test+token-to-token+swap+flows+in+the+sandbox+environment\u0026amp;theme=a63046a1b6875a84019a21bc\u0026amp;signature=5a96f3b1aa69337000396617111d2c3be64232da7e857bfbedeedd017e82eb65\">\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=\"Swaps - Etherfuse API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to test token-to-token swap flows in the sandbox environment\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://etherfuse.mintlify.app/_mintlify/api/og/v2?division=Integration+Guides\u0026amp;title=Swaps\u0026amp;description=How+to+test+token-to-token+swap+flows+in+the+sandbox+environment\u0026amp;theme=a63046a1b6875a84019a21bc\u0026amp;signature=5a96f3b1aa69337000396617111d2c3be64232da7e857bfbedeedd017e82eb65\">\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/etherfuse/2PYR-_ECBzhTGa_z/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Etherfuse API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#141414\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.etherfuse.com/v2/guides/testing-swaps\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/v2/guides/testing-swaps.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.etherfuse.com/#organization\",\"name\":\"Etherfuse API\",\"url\":\"https://docs.etherfuse.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/etherfuse/XRSchVFGUgreQatD/img/logo-black.svg?fit=max\u0026auto=format\u0026n=XRSchVFGUgreQatD\u0026q=85\u0026s=92cf84eca27df4a19f7b032da398d110\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.etherfuse.com#website\",\"name\":\"Etherfuse API\",\"url\":\"https://docs.etherfuse.com\",\"publisher\":{\"@id\":\"https://docs.etherfuse.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.etherfuse.com/v2/guides/testing-swaps#webpage\",\"url\":\"https://docs.etherfuse.com/v2/guides/testing-swaps\",\"name\":\"Swaps\",\"description\":\"How to test token-to-token swap flows in the sandbox environment\",\"dateModified\":\"2026-10-20T18:16:44.602Z\",\"isPartOf\":{\"@id\":\"https://docs.etherfuse.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.etherfuse.com/v2/guides/testing-swaps#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.etherfuse.com/v2/guides/testing-swaps#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Integration Guides\",\"item\":\"https://docs.etherfuse.com/v2/guides/embedded-wallets\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Swaps\",\"item\":\"https://docs.etherfuse.com/v2/guides/testing-swaps\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.etherfuse.com/v2/guides/testing-swaps#article\",\"headline\":\"Swaps\",\"name\":\"Swaps\",\"description\":\"How to test token-to-token swap flows in the sandbox environment\",\"url\":\"https://docs.etherfuse.com/v2/guides/testing-swaps\",\"mainEntityOfPage\":{\"@id\":\"https://docs.etherfuse.com/v2/guides/testing-swaps#webpage\"},\"dateModified\":\"2026-10-20T18:16:44.602Z\",\"publisher\":{\"@id\":\"https://docs.etherfuse.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.etherfuse.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Etherfuse API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Etherfuse API","nav":{"global":null,"versions":[{"version":"v2 (beta)","default":true,"tabs":[{"tab":"Guides","groups":[{"group":"Get Started","icon":"rocket","pages":[{"title":"Introduction","href":"/v2"},{"title":"Quickstart","href":"/v2/quickstart"},{"title":"Initial Setup","href":"/v2/initial-setup"},{"title":"Sandbox Reference","href":"/v2/test-environment"}]},{"group":"Migration","icon":"arrow-right-arrow-left","pages":[{"title":"V1 → V2","href":"/v2/migration-guide"}]},{"group":"Concepts","icon":"lightbulb","pages":[{"title":"How it works","href":"/v2/overview"},{"title":"Webhooks","href":"/v2/webhooks"}]},{"group":"User Authentication","icon":"key","pages":[{"title":"JWT User Authentication","href":"/v2/guides/jwt-authentication"},{"title":"User Launch Flows","href":"/v2/guides/user-launch-flows"},{"title":"Authentication errors","href":"/v2/guides/authentication-errors"}]},{"group":"Integration Guides","icon":"code","pages":[{"group":"Embedded Wallets","root":{"title":"Embedded Wallets","href":"/v2/guides/embedded-wallets"},"directory":"card","pages":[{"title":"Embedded Wallets","href":"/v2/guides/embedded-wallets"},{"title":"Embedded Wallets Sandbox Onramp","sidebarTitle":"Sandbox onramp","href":"/v2/guides/embedded-wallets-walkthrough"}]},{"title":"Verifying Webhooks","description":"How to verify webhook signatures to ensure payloads are authentic","href":"/v2/guides/verifying-webhooks"},{"title":"Swaps","href":"/v2/guides/testing-swaps"},{"title":"Onramps","description":"How to test onramp flows in the sandbox environment","href":"/v2/guides/testing-onramps"},{"title":"Offramps","href":"/v2/guides/testing-offramps"}]},{"group":"KYC","icon":"id-card","pages":[{"title":"KYC Overview","sidebarTitle":"Overview","href":"/v2/guides/onboarding"},{"title":"KYC WebSDK","href":"/v2/guides/kyc-websdk"},{"title":"KYC API","href":"/v2/guides/kyc-api"},{"title":"KYC Sumsub Shared Token","href":"/v2/guides/kyc-sumsub-shared-token"}]},{"group":"KYB","icon":"building","pages":[{"title":"KYB Overview","sidebarTitle":"Overview","href":"/v2/guides/kyb"},{"title":"KYB WebSDK","href":"/v2/guides/kyb-websdk"}]},{"group":"Blockchains","icon":"cubes","pages":[{"title":"Stellar","href":"/v2/guides/chains/stellar"},{"title":"Solana","href":"/v2/guides/chains/solana"},{"title":"Monad","href":"/v2/guides/chains/monad"},{"title":"Base","href":"/v2/guides/chains/base"},{"title":"Polygon","href":"/v2/guides/chains/polygon"},{"title":"Avalanche","href":"/v2/guides/chains/avalanche"}]},{"group":"Resources","icon":"book-open","pages":[{"title":"Transaction Fees","href":"/v2/fees"},{"title":"Price Feeds","href":"/v2/price-feeds"},{"title":"Glossary","href":"/v2/glossary"},{"title":"SDKs","href":"/v2/sdks"},{"title":"MCP Server","href":"/v2/mcp-overview"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/v2/api-reference/introduction"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},{"version":"v1 (legacy)","pages":[{"title":"v1 (legacy)","href":"/guides/testing-swaps"}]}]},"basePath":"","title":"Swaps - Etherfuse API","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":[],"chunks":[]}