ACTIVITY_TYPE_UPSERT_SWAP_CONFIG is a parent-organization configuration activity that writes FEATURE_NAME_SWAP_CONFIG — the source of truth for your integrator fee configuration and the wallet that receives fees. This config must be set before any sub-organization can call get_swap_quote or execute_swap.
Prerequisites
- The activity is submitted against the parent organization. Sub-organization requests are rejected.
- You control a wallet that will receive integrator fees. It must be a valid address for the target route and provider (To Confirm — likely any EVM address in V1).
- You’ve decided on your fee rate in basis points. See Choose your fee configuration.
Submit upsert_swap_config
enum<string>
required
ACTIVITY_TYPE_UPSERT_SWAP_CONFIGstring
required
Timestamp (in milliseconds) of the request, used to verify liveness.
string
required
Unique identifier of the parent organization. Requests from sub-organizations are rejected.
string
required
The wallet address that receives integrator fees on-chain. Must be valid for the route and provider (To Confirm — likely any EVM address in V1).
string
required
Your integrator fee in basis points, expressed as a stringified integer. For example,
"50" = 0.5%. Must be non-negative and no greater than the Turnkey-defined maximum.string
Optional. A separate integrator fee in basis points applied to stablecoin-to-stablecoin swaps (To Confirm — verify this is the exact scope).
string
Optional. The DEX aggregator provider. Omit in V1 —
0x is the only supported provider and is used by default.cURL
JavaScript
upsert_swap_config completes inline. The activity result echoes the applied configuration:
To Confirm — assumes enableSwapResult.config echoes the applied configuration for confirmation.)
Choose your fee configuration
YourfeeBps applies to every swap submitted under any sub-organization of your parent org. Two constraints to keep in mind:
- Cap: Turnkey enforces a maximum
feeBps. Requests above the cap are rejected. The current maximum is documented in the API reference and may be adjusted over time (To Confirm — current cap value). - Fee currency: fees accrue on-chain to
feeReceiverWalletAddressin the token that the swap route settles the fee in (To Confirm — 0x currently collects the integrator fee in the sell token; document once verified).
feeBps that reflects your intended margin and confirm the receiver wallet is one you actively control. Fees paid to a wallet you don’t control cannot be recovered by Turnkey.
Change your fee configuration
Configuration changes go through the sameACTIVITY_TYPE_UPSERT_SWAP_CONFIG activity — submit again with the updated feeBps, feeReceiverWalletAddress, or stableFeeBps. There is no separate update activity.
Quote and execute activities submitted after the change immediately use the new configuration. Because executable provider data is fetched fresh during execute_swap, an in-flight quote followed by an execute will settle at the fee configuration active at execute time, not at quote time (To Confirm).
To disable swaps entirely, submit enable_swap with enabled: false.
Next steps
- Get a quote — fee-aware indicative pricing for display and selection
- Execute a swap — the signing activity that runs the swap end-to-end