Skip to main content
POST
Execute Swap

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 to execute a swap

connector
string
required

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

network
string
required

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

trading_pair
string
required

Trading pair (e.g., 'SOL-USDC')

side
string
required

Trade side: 'BUY' or 'SELL'

amount
required

Amount denominated in the BASE token (SELL: base to sell; BUY: base to receive)

slippage_pct

Maximum slippage percentage; omit to use the connector's configured slippagePct

wallet_address
string | null

Wallet address (optional, uses default if not provided)

extra_params
Extra Params · object | null

Connector-specific params passed through to Gateway under its own names: approximateIfNoExactOut (Solana routers). Unknown keys are rejected.

Response

Successful Response

Response after executing swap.

amount is what was asked for; the three fill fields are what happened. They were missing entirely, so a caller reconciling a position against this response was reconciling against its own intent: a BUY of 1000 tokens that delivered 951.68 answered amount: 1000 under the description "Amount swapped". Every one of these numbers was already in hand — the same call writes them to the swap history — so the only way to learn what a swap did was to execute it, discard the answer, and search the history by transaction hash.

transaction_hash
string
required

Transaction hash

trading_pair
string
required

Trading pair

side
string
required

Trade side

amount
string
required

Amount REQUESTED, denominated in the base token (SELL: base sold; BUY: base wanted). This is the request echoed back, not the fill — see input_amount / output_amount for what actually moved.

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

Amount actually spent, denominated in the input token (quote for BUY, base for SELL). None until the transaction confirms.

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

Amount actually received, denominated in the output token (base for BUY, quote for SELL). None until the transaction confirms.

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

Executed price in quote per base, computed from the amounts that moved. None until the transaction confirms.

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

Transaction status