Create a "swap" transactionCopy Pagepost https://api.valha.xyz/v0/{chain}/tokens/swapBETA FEATURE - Please contact team to be whitelisted. Create transaction objects to interact with an EVM blockchain for a specified user.Recent RequestsLog in to see full request historyTimeStatusUser Agent Retrieving recent requests…LoadingLoading…Path ParamschainstringenumrequiredDefaults to optimismThe blockchain that will be used for this request.ethereumarbitrumoptimismpolygonbscavalancheAllowed:ethereumarbitrumoptimismpolygonbscavalancheBody ParamsBETA FEATURE - Please contact team to be whitelisted. This endpoint creates a swap on the protocol you selected to execute the exchange between the tokens you chose.userstringrequiredDefaults to 0x45E954acf1Efc374478dF69B45f12AEFD8AE51a3from_tokenstringrequiredDefaults to 0x7f5c764cbc14f9669b88837ca1490cca17c31607to_tokenstringrequiredDefaults to 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58amountnumberDefaults to 20slippagenumberThe maximum acceptable slippage that will be accepted to perform the swap (0.02 for 2%). If no value for this optional parameter is provided in the API request, the default slippage percentage is 2%.protocolstringenumrequiredDefaults to 1inch/v50x/v11inch/v5uniswap/v3Allowed:0x/v11inch/v5uniswap/v3disable_checkbooleanDefaults to trueIf selected to true, the API will not check if the provided user's address has enought token to perform the action.truefalsemaximum_approvalbooleanDefaults to falseIf selected to true, the API will put the maximum amount for the approval action.truefalsereferrerstringReferrer string that will be used on the DEX aggregators API.Responses 200approveTx might be null if there is no need for an approval. 400Updated over 2 years ago Did this page help you?YesNo