This API allows fetching quotes for token swaps and provides transaction data (calldata) for execution if the parameters slippageTolerance, deadline, and recipient are specified. This enables direct interaction with smart contracts.
Endpoint
URL:https://api.kodiak.finance/quote
Method:GET
Content Type:application/json
Query Parameters
Parameter
Required
Description
protocols
â
The protocols used for the swap. Possible values: v2, v3, mixed.
tokenInAddress
â
Address of the input token for the swap.
tokenInChainId
â
Chain ID of the input token.
tokenOutAddress
â
Address of the output token for the swap.
tokenOutChainId
â
Chain ID of the output token.
amount
â
Amount of tokens to swap in humman terms
type
â
Type of swap: exactIn (fixed input amount) or exactOut (fixed output amount).
recipient
â
The address of the recipient of the swapped tokens. Required for generating calldata.
deadline
â
Time in seconds until the transaction expires.
slippageTolerance
â
Allowed slippage percentage as an integer (e.g., 1 for 1%).
Example Request
GET https://api.kodiak.finance/quote?protocols=v2,v3,mixed&tokenInAddress=0x7507c1dc16935B82698e4C63f2746A2fCf994dF8&tokenInChainId=80084&tokenOutAddress=0x1740F679325ef3686B2f574e392007A92e4BeD41&tokenOutChainId=80084&amount=40862354775778842528071&type=exactIn&recipient=0xA54e745BFf14816Ec6D323d894E7861b6Ef3F2aE&deadline=1000&slippageTolerance=1