Skip to main content
POST
/
api
/
quote
Calculate Best Path Quote
curl --request POST \
  --url https://ws.staging.kuru.io/api/quote \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "userAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "tokenIn": "0xA0b86a33E6441051686442d3a1BA4Fab4F85d2b2",
  "tokenOut": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "amount": "1000000000000000000",
  "slippageTolerance": 50,
  "autoSlippage": true,
  "referrerAddress": "0x5678567856785678567856785678567856785678",
  "referrerFeeBps": 25
}'
{
"type": "swap_calculation",
"status": "success",
"output": "950000000000000000",
"path": {},
"buildResponse": {},
"gasPrices": {}
}

Authorizations

Authorization
string
header
required

JWT token obtained from /api/generate-token endpoint

Body

application/json
  • Option 1
  • Option 2
userAddress
string
required

Ethereum address of the user

Example:

"0x1234567890abcdef1234567890abcdef12345678"

tokenIn
string
required

Address of the input token

Example:

"0xA0b86a33E6441051686442d3a1BA4Fab4F85d2b2"

tokenOut
string
required

Address of the output token

Example:

"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"

amount
string
required

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

Example:

"1000000000000000000"

autoSlippage
boolean
required

Whether to use automatic slippage calculation

Example:

true

slippageTolerance
integer

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

Example:

"0x5678567856785678567856785678567856785678"

referrerFeeBps
integer

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)