Skip to main content

SwapParams

Parameters for executing a token swap.
chainIndex
string
Chain identifier (e.g., “501” for Solana, “1” for Ethereum)
fromTokenAddress
string
required
Contract address of the source token
toTokenAddress
string
required
Contract address of the destination token
amount
string
required
Amount to swap in the smallest unit (e.g., wei for ETH)
userWalletAddress
string
User’s wallet address executing the swap
slippagePercent
string
Slippage tolerance as a percentage (e.g., “0.5” for 0.5%)
autoSlippage
boolean
Enable automatic slippage calculation
maxAutoSlippagePercent
string
Maximum slippage percentage when using auto-slippage
swapReceiverAddress
string
Address to receive the swapped tokens (if different from sender)
fromTokenReferrerWalletAddress
string
Referrer wallet address for source token fees
toTokenReferrerWalletAddress
string
Referrer wallet address for destination token fees
positiveSlippagePercent
string
Positive slippage percentage to capture favorable price movements
dexIds
string
Comma-separated list of DEX IDs to route through
directRoute
boolean
Use direct routing without intermediate tokens
priceImpactProtectionPercent
string
Maximum acceptable price impact percentage
feePercent
string
Custom fee percentage for the swap
gasLimit
string
Gas limit for the transaction (EVM chains)
gasLevel
string
Gas price level: “low”, “medium”, or “high”
computeUnitPrice
string
Compute unit price for Solana transactions
computeUnitLimit
string
Compute unit limit for Solana transactions
callDataMemo
string
Memo data to include in the transaction
interface SwapParams extends BaseParams {
  slippagePercent?: string;
  autoSlippage?: boolean;
  maxAutoSlippagePercent?: string;
  swapReceiverAddress?: string;
  fromTokenReferrerWalletAddress?: string;
  toTokenReferrerWalletAddress?: string;
  positiveSlippagePercent?: string;
  gasLimit?: string;
  gasLevel?: string;
  computeUnitPrice?: string;
  computeUnitLimit?: string;
  callDataMemo?: string;
}

SwapResult

Result of a completed swap transaction.
success
boolean
required
Whether the swap was successful
transactionId
string
required
Transaction hash or signature
explorerUrl
string
required
Block explorer URL for the transaction
details
object
Additional swap details
details.fromToken
object
required
Source token information
details.fromToken.symbol
string
required
Token symbol
details.fromToken.amount
string
required
Amount swapped
details.fromToken.decimal
string
required
Token decimals
details.toToken
object
required
Destination token information
details.toToken.symbol
string
required
Token symbol
details.toToken.amount
string
required
Amount received
details.toToken.decimal
string
required
Token decimals
details.priceImpact
string
required
Price impact percentage
interface SwapResult {
  success: boolean;
  transactionId: string;
  explorerUrl: string;
  details?: {
    fromToken: {
      symbol: string;
      amount: string;
      decimal: string;
    };
    toToken: {
      symbol: string;
      amount: string;
      decimal: string;
    };
    priceImpact: string;
  };
}

SwapResponseData

API response structure for swap requests.
data
array
required
Array of swap execution data
data[].routerResult
RouterResult
required
Routing information for the swap
data[].tx
TransactionData
required
Transaction data to execute
code
string
required
API response code
msg
string
required
API response message
interface SwapResponseData {
  data: {
    routerResult: RouterResult;
    tx: TransactionData;
  }[];
  code: string;
  msg: string;
}

SwapExecutionData

Swap execution data containing routing and transaction information.
routerResult
RouterResult
required
Routing information for the swap
tx
TransactionData
Transaction data to execute (optional for some chains)
interface SwapExecutionData {
  routerResult: RouterResult;
  tx?: TransactionData;
}

Build docs developers (and LLMs) love