Generates a transaction for cross-chain swaps, bridges, and calls. The action includes transaction data, routing information, and fee calculations for executing the requested operation.
Limited demo key for API Reference: 5c951bc81da566bbd030ba8e20724063.
Type of action to perform Type of action to perform.
swap-action, evm-calldata-tx, polymarket The address of the sender/user Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Source chain ID Chain ID. Find in the list of supported networks.
Source token address Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Destination chain ID Chain ID. Find in the list of supported networks.
Destination token address Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Slippage tolerance in bps
0 <= x <= 10000The exact in or exact out amount of the swap
Required: for swap-action
Required: for polymarket action type
Swap direction for the action
Required: for swap-action
Required: for polymarket action type (use exact-amount-in)
Swap direction for the action.
exact-amount-in, exact-amount-out Address to receive the swapped tokens
Optional: for swap-action
Required: for polymarket action type (should be the proxy wallet address)
Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
The EVM address of the target contract (20 bytes hex)
Required: for evm-calldata-tx action type
Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Calldata for the transaction
Required: for evm-calldata-tx action type
Hex string with 0x prefix
Value to send with transaction
Optional: for evm-calldata-tx action type
The amount of Erc20 being transferred
Optional: for evm-calldata-tx action type (use for calls requiring Erc20 transfers)
The Erc20 spender requiring approval for the transaction call
Optional: for evm-calldata-tx action type (will default to the to address)
Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Specific bridge protocols to use
Optional: Will default to all available protocols
Bridge protocol identifier.
optimism, arbitrum, oft, yield-oft, hyperlane, ghost, mayan, across, relay, alt-vm-1, alt-vm-2 Alternate address to receive refunds
Optional: Will default to the sender
Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Return a deposit address for deposit-based flows
Optional: Set to true to receive a deposit address in the response
Application fees configuration as JSON array
Optional: Will default to fees configured for the application
Example: [{ "bps": 50, "receiverAddress": "0x..." }]
Polymarket user ID - returned from POST /create
Required: for polymarket action type
Order side for Polymarket orders
Required: for polymarket action type
BUY, SELL Polymarket CLOB token ID
Required: for polymarket action type
Polymarket order type
Required: for polymarket action type
FOK: Fill or Kill (market order)FAK: Fill and Kill (market order)FOK, FAK Fee rate in basis points (non-negative)
Required: for polymarket action type
x >= 0Price tick size for Polymarket orders
Required: for polymarket action type
0.01, 0.001, 0.0001 Negative risk flag for Polymarket
Required: for polymarket action type
true, false Successful response with action data
Transaction data for execution
Transaction ID
Virtual machine identifier.
evm, solana, alt-vm, hypercore Expected amount to input (exclusive of slippage - recommended value to display in frontend)
Maximum amount to input (inclusive of slippage)
Expected amount delivered to users (exclusive of slippage - recommended value to display in frontend)
Minimum amount delivered to users (inclusive of slippage)
Swaps.xyz fee
Application fee (your fee!)
Exchange rate for the swap.
Estimated transaction time in seconds.
Estimated price impact percentage.
Flag indicating whether the transaction object requires a source token approval check.
Flag indicating whether the transaction requires registration via the registerTxs endpoint. Mandatory for non-EVM transactions.
All available routes for the action.
Bridge fee (from aggregated providers)
Bridge IDs used in the route.
Bridge protocol identifier.
optimism, arbitrum, oft, yield-oft, hyperlane, ghost, mayan, across, relay, alt-vm-1, alt-vm-2 Bridge route information (src chain + token, dst chain + token, BridgeId)