Skip to main content
POST
/
gateway
/
swap
/
quote
Get Swap Quote
curl --request POST \
  --url http://localhost:8000/gateway/swap/quote \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "connector": "<string>",
  "network": "<string>",
  "trading_pair": "<string>",
  "side": "<string>",
  "amount": 123,
  "slippage_pct": 1
}
'
{
  "base": "<string>",
  "quote": "<string>",
  "price": "<string>",
  "amount": "<string>",
  "slippage_pct": "<string>",
  "amount_in": "<string>",
  "amount_out": "<string>",
  "expected_amount": "<string>",
  "gas_estimate": "<string>"
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Request for swap price quote

connector
string
required

DEX router connector (e.g., 'jupiter', '0x')

network
string
required

Network ID in 'chain-network' format (e.g., 'solana-mainnet-beta', 'ethereum-mainnet')

trading_pair
string
required

Trading pair in BASE-QUOTE format (e.g., 'SOL-USDC')

side
string
required

Trade side: 'BUY' or 'SELL'

amount
required

Amount to swap (in base token for SELL, quote token for BUY)

slippage_pct
default:1

Maximum slippage percentage (default: 1.0)

Response

Successful Response

Response with swap quote details

base
string
required

Base token symbol

quote
string
required

Quote token symbol

price
string
required

Quoted price (base/quote)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
amount
string
required

Amount specified in request (BUY: base amount to receive, SELL: base amount to sell)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
slippage_pct
string
required

Applied slippage percentage

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
amount_in
string | null

Actual input amount (BUY: quote to spend, SELL: base to sell)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
amount_out
string | null

Actual output amount (BUY: base to receive, SELL: quote to receive)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
expected_amount
string | null

Deprecated: use amount_out instead

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
gas_estimate
string | null

Estimated gas cost

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$