v46

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-211591,0051.4 MB
Swaps

Get Swap Quote

Get a price quote for swapping tokens within a wallet.

post/v1/wallets/{wallet_id}/swap/quote

Path parameters

wallet_idstring required

ID of the wallet.

Headers

privy-app-idstring required

ID of your Privy app.

privy-authorization-signaturestring

Request authorization signature. If multiple signatures are required, they should be comma separated.

privy-request-expirystring

Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the request must be processed.

Request body

amount_type'exact_input' | 'exact_output'

Whether the amount refers to the input token (exact_input) or output token (exact_output).

base_amountstring required

Amount in base units (e.g., wei for ETH). Must be a non-negative integer string.

slippage_bpsinteger

Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, auto-slippage is used.

Example request

{
  "amount_type": "exact_input",
  "base_amount": "1000000000000000000",
  "destination": {
    "asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
  },
  "source": {
    "asset_address": "native",
    "caip2": "eip155:1"
  }
}

Response

Swap quote retrieved successfully.

caip2string required

Chain identifier.

destination_caip2string

Destination chain CAIP-2 identifier for cross-chain swaps. Only present for cross-chain swaps.

est_output_amountstring required

Estimated amount of output token in base units.

expires_atnumber

Quote expiry as Unix timestamp (seconds). Only present for cross-chain quotes.

gas_estimatestring required

Estimated gas cost in base units of the native token. @deprecated For cross-chain swaps, use estimated_gas instead.

input_amountstring required

Amount of input token in base units.

input_tokenstring required

Token address being sold.

minimum_output_amountstring required

Minimum output amount accounting for slippage, in base units.

output_tokenstring required

Token address being bought.

Example response

{
  "caip2": "eip155:1",
  "est_output_amount": "2000000000",
  "gas_estimate": "150000",
  "input_amount": "1000000000000000000",
  "input_token": "native",
  "minimum_output_amount": "1980000000",
  "output_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}