Gateway Swaps

Execute Swap Quote

Changed on

Execute a quote returned by /swap/quote, by its quote_id.

The two-step flow: quote, decide, then commit to THAT quote. /swap/execute prices again at execution, which discards the price the caller saw — the whole reason dflow, titan and 0x return a held quote. Router connectors only; a pool-scoped connector has no cached quote to execute and is rejected rather than quietly re-priced.

Example: connector: 'jupiter' network: 'solana-mainnet-beta' quote_id: '<quote_id from /swap/quote>' trading_pair: 'SOL-USDC' side: 'SELL' amount: 0.01

Returns: Transaction hash and what the swap actually moved

post/gateway/swap/execute-quote

Request

  • Base URL
    http://localhost:8000
  • URL
    http://localhost:8000/gateway/swap/execute-quote
  • Auth
    HTTP basic

Request body

connectorstring required

Router connector the quote came from (e.g., 'jupiter', '0x')

networkstring required

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

quote_idstring required

quote_id from a prior /swap/quote on the same connector

trading_pairstring required

Trading pair the quote was for (e.g., 'SOL-USDC'). Gateway identifies the swap by quote_id alone; this is what the recorded trade is filed under.

sidestring required

Trade side the quote was for: 'BUY' or 'SELL'

wallet_addressstring nullable

Wallet address (optional, uses default if not provided)

Response

Successful Response

transaction_hashstring required

Transaction hash

trading_pairstring required

Trading pair

sidestring required

Trade side

amountstring 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.

input_amountstring nullable

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

output_amountstring nullable

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

pricestring nullable

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

statusstring

Transaction status

Changes