Wallet Actions

Execute a synchronous Solana token swap: fetch a quote, sign via the enclave, submit to Jito, and return the signed transaction and quote details — all in a single request.

post/v1/wallets/{wallet_id}/experimental/solana/advanced-swap

Request

  • Base URL
    https://api.privy.io
  • URL
    https://api.privy.io/v1/wallets/{wallet_id}/experimental/solana/advanced-swap
  • Auth
    HTTP basic

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.

Request body

input_tokenstring required

Input token address (base58 mint address).

output_tokenstring required

Output token address (base58 mint address).

caip2string

CAIP-2 chain identifier. Defaults to Solana mainnet.

amountstring required

Amount in the smallest unit of the input token (e.g. lamports for SOL).

dry_runboolean

When true, skip transaction submission (quote + sign only). The signed transaction is still returned.

platform_fee_bpsinteger

Platform fee in basis points, taken from the output token. Requires fee_recipient when > 0.

fee_recipientstring

Token account (base58) to receive the platform fee. Must exist on-chain for the output token.

Example request

{
  "input_token": "So11111111111111111111111111111111111111112",
  "output_token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "caip2": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
  "amount": "1000000000",
  "slippage_bps": 50,
  "platform_fee_bps": 100,
  "fee_recipient": "FeeAcct..."
}

Response

Swap executed successfully.

transaction_hashstring required

Solana transaction signature (base58).

submission_status'accepted' | 'rejected' | 'skipped' required

"accepted" if the network has acknowledged the transaction, "rejected" if the network refused it, "skipped" if dry_run was set. Not an onchain confirmation.

signed_transactionstring required

Fully signed transaction (base64). Callers can re-submit to any Solana RPC for redundancy.

providerstring required

Which aggregator fulfilled the swap (e.g. "dflow").

input_tokenstring required

Input token address (base58).

output_tokenstring required

Output token address (base58).

in_amountstring required

Input amount consumed (smallest unit).

out_amountstring required

Expected output amount before slippage (smallest unit).

min_out_amountstring required

Minimum output amount guaranteed by slippage tolerance (smallest unit).

slippage_bpsinteger required

Slippage applied in basis points. Reflects the resolved value if "auto" was requested.

Example response

{
  "transaction_hash": "5K4f...base58sig",
  "submission_status": "accepted",
  "signed_transaction": "AQAAAA...base64...",
  "provider": "dflow",
  "input_token": "So11111111111111111111111111111111111111112",
  "output_token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "in_amount": "1000000000",
  "out_amount": "173500000",
  "min_out_amount": "172632500",
  "slippage_bps": 50,
  "platform_fee": {
    "amount": "1735000",
    "bps": 100,
    "token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  }
}

Changes