Skip to main content
POST
Calculate Best Path Quote

Authorizations

Authorization
string
header
required

JWT token obtained from /api/generate-token endpoint

Body

application/json
autoSlippage
enum<boolean>
required

Whether to use automatic slippage calculation

Available options:
true
Example:

true

userAddress
string
required

Ethereum address of the user

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x1234567890abcdef1234567890abcdef12345678"

tokenIn
string
required

Address of the input token

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xA0b86a33E6441051686442d3a1BA4Fab4F85d2b2"

tokenOut
string
required

Address of the output token

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"

amount
string
required

Amount to swap (in wei for tokens with 18 decimals)

Example:

"1000000000000000000"

slippageTolerance
integer<uint16>

Slippage tolerance in basis points (e.g., 50 = 0.5%)

Required range: 1 <= x <= 10000
Example:

50

referrerAddress
string

Optional referrer address for fee sharing

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x5678567856785678567856785678567856785678"

referrerFeeBps
integer<uint16>

Optional referrer fee in basis points

Required range: 0 <= x <= 10000
Example:

25

Response

Successfully calculated best path

type
string

Response type identifier

Example:

"swap_calculation"

status
enum<string>

Status of the calculation

Available options:
success,
error
Example:

"success"

output
string

Expected output amount

Example:

"950000000000000000"

message
string

Status or error message

path
object

Swap route information (tx_builder.SwapRoute)

buildResponse
object

Transaction build response (tx_builder.BuildResponse)

gasPrices
object

Gas price information (swapcalc.GasPriceInfo)