What are Swaps
Swaps connect wallets managed using Turnkey to DEX aggregators and liquidity providers through a single interface. Relay is supported today with more options coming soon. A swap is two steps: you request a quote, then execute it. Execution is a signed intent carrying the caller-supplied economics — input and output assets, input amount, quoted and minimum output amounts, and the quote it executes against. Turnkey matches that intent to the bound quote, then constructs the transaction from the quote’s attested execution (including ERC-20 approvals) and submits it for broadcast. You never handle provider quote payloads, transaction calldata, or approval data. The signed intent is the only caller-supplied source of trade economics. Calldata and approvals come from the attested quote. For EVM ↔ SVM, you also setdestinationAddress on the quote and execute intents. Turnkey exercises no discretion over token selection, amounts, or order routing.
Every swap is a quote, a signed intent, and a poll. Submit ACTIVITY_TYPE_UPSERT_SWAP_CONFIG only if you want to charge a client fee.
If your application presents Swap functionality to end users, you are responsible for disclosing that: (1) swaps are executed through independent third-party decentralized protocols; (2) quoted prices are estimates and actual execution prices may differ; (3) the transaction is subject to fees, including your fee and gas (or network) fees; (4) swaps are subject to slippage, and that failed transactions may still incur gas costs even when the swap does not complete; and (5) for cross-chain swaps, value is moved across networks by third-party bridge providers, which carries additional risk, including loss of funds. Do not claim or imply that swaps are executed by your application or by Turnkey.
How it works
- Optionally set your fee. Submit
ACTIVITY_TYPE_UPSERT_SWAP_CONFIGon the parent organization to charge a client fee.feeBpssets your rate;feeReceiverWalletAddressmust be an EVM wallet account in your parent organization. Private key addresses are not accepted. IffeeBpsis a non-empty string and no receiver is provided, Turnkey auto-generates a parent HD wallet."0"is non-empty and still generates a wallet. To charge no client fee, omit both fields. Enterprise organizations can also set a separate stablepair fee (stableFeeBps), applied when both assets in a trade are stablecoins. - Request a quote. Submit
ACTIVITY_TYPE_CREATE_SWAP_QUOTE_V2with the signing address, asset pair, input amount, and optional slippage tolerance. For EVM ↔ SVM, also setdestinationAddressto a raw address on the output protocol. Each quote returns the output amount net of all fees, a minimum output amount, an expiry, and a quoteId. Quotes reflect your active fee configuration, or a client fee of 0 if you have none. - Execute the swap. Submit
ACTIVITY_TYPE_EXECUTE_SWAP_V3from the organization that owns the swapping wallet — parent or sub-organization — referencing thequoteIdand restating the trade parameters, includingdestinationAddresswhen the quote set one. Turnkey constructs the transaction from the bound quote, handles ERC-20 approvals, and broadcasts it. For cross-chain routes, this broadcasts the origin-chain transaction, with the cross-chain swap provider broadcasting the destination-chain transaction. - Poll swap status until settlement. Query
get_swap_statuswith the returnedswapRequestIduntil a terminal state. Same-chain swaps areCOMPLETEDorFAILEDfrom the origin transaction. Cross-chain swaps stayPENDINGuntil the destination leg settles or the provider reports a fill failure. Refund fields on a cross-chainFAILEDcan arrive after the status flip. See Track swap status.
Supported providers, chains, and routes
Route support:
- Same-chain EVM ↔ EVM — e.g., USDC → USDT on Base.
- Cross-chain EVM ↔ EVM — e.g., Arbitrum USDC → Base USDC, where supported by the provider.
- Same-chain Solana ↔ Solana — e.g., SOL → USDC on Solana.
- Cross-protocol EVM ↔ SVM — e.g., Base USDC → Solana USDC. Set
destinationAddresson quote and execute.
Fees
Two fees apply to a swap: Turnkey’s fee and, optionally, your own. Both are deducted from the swap output — quoted and minimum output amounts are always net of all fees, so the quote’soutputAmount is what the recipient receives. Your fee is the only one surfaced in the quote, as clientFeeBps; Turnkey’s fee is baked into the quoted amounts and does not appear as a separate field.
Turnkey’s fee and your fee are settled as separate claim payouts — they do not appear in the user’s swap transaction itself. With Relay, these are two distinct payouts, one for each party. Regardless of how a provider settles them onchain, the quoted amounts you receive from Turnkey are always net of both.
Turnkey’s fee
A stablepair swap is one where both assets carry the
stable flag in list_supported_assets.
Supported stablecoins
Both assets must appear in the list for their network for a swap to qualify for the stablepair fee tier. Turnkey uses the canonical asset identifiers returned bylist_supported_assets, not token symbols alone.
Mainnets
This list describes fee classification only. A listed asset does not guarantee that a provider offers a route or sufficient liquidity.
These are Turnkey’s current default fee rates and may be revised on notice in accordance with the Terms. Enterprise rates shown are defaults and are negotiable with an Order Form; where an Order Form sets Turnkey Fee rates, the Order Form controls.
Your fee
You can charge your own fee on every swap, expressed in basis points. Your fee options mirror your plan’s rate structure: Pay-as-you-go and Pro organizations set a singlefeeBps applied to every swap; Enterprise organizations can additionally set stableFeeBps, applied to stablepair swaps.
Set your fee and fee receiver via ACTIVITY_TYPE_UPSERT_SWAP_CONFIG:
feeBps— your fee in basis points, bounded by a maximum of 5%. Requests above the cap will fail with an error. To charge no client fee, omit bothfeeBpsandfeeReceiverWalletAddress. Do not send"0"with an omitted receiver: that combination auto-generates a wallet.feeReceiverWalletAddress— an EVM wallet account in your parent organization. Private key addresses are not accepted. The address is validated at upsert; an address that isn’t a parent-organization EVM wallet account will fail. Fees can only accrue to wallet accounts you generate through Turnkey.
ACTIVITY_TYPE_CLAIM_SWAP_FEES.
Fees are configured on the parent organization and apply to every swap submitted by any sub-organization under it. Sub-organizations cannot override the parent’s configuration.
API surface
Swaps add four activities:
and one query:
Swap requests are stamped and submitted like any other Turnkey request. See Stamps and Submissions. The examples on these pages use cURL and
@turnkey/http’s TurnkeyClient, but generated SDK methods are available: createSwapQuote, executeSwap, executeSwapV2, getSwapStatus, upsertSwapConfig, and claimSwapFees.Trust boundary
Swaps never expose executable provider data to you or your users. Provider quote payloads, transaction calldata, and approval payloads are constructed and handled entirely server-side — they are never accepted from callers, so they cannot be tampered with before signing. What the user signs is the execute intent. It is the only caller-supplied source of trade economics: the input and output assets, input amount, quoted and minimum output amounts, sponsorship, thequoteId it executes against, and destinationAddress when the route is cross-protocol. Optional replay-protection fields (evmNonce, recentBlockhash, gasStationNonce) can also be signed; omit them to auto-fetch. Turnkey matches the intent to the bound quote and constructs the transaction from that quote’s attested execution. Fees come from the quote snapshot; execute does not re-read your live configuration. This is why execute restates parameters the quote already carries; the signed intent must be self-contained, so a quote cannot be substituted or its economics altered after signing.
Turnkey does not exercise discretion over the selection, routing, or execution of any swap transaction. The user-signed intent determines the trade economics, and the provider determines routing and execution.
Next steps
Enable swaps
One-time parent-org setup with fee configuration.
Get a quote
Request executable quotes for an asset pair, net of all fees.
Execute a swap
One signed activity, optionally gas-sponsored.
Track swap status
Poll to settlement across same-chain and cross-chain lifecycles.