Skip to main content
POST
cURL

Authorizations

x-api-key
string
header
required

Body

application/json

Details of the trade request.

user_address
string
required

The wallet address of the user making the trade.

source_token_address
string
required

The address of the token being traded (source token).

target_token_address
string
required

The address of the token the user wants to receive (target token).

amount
required

The amount of the source token to be traded, expressed in the smallest unit (e.g., lamports for SOL). Can be provided as a string or a number

Pattern: ^[0-9]+$
jito_tip_amount
required

The amount of Jito tip, expressed in the smallest unit (e.g., lamports for SOL). Can be provided as a string or a number

Pattern: ^[0-9]+$
swap_transaction
string
required

Serialized or encoded swap transaction data. The transaction must be provided unsigned.

loan_additional_sol
required

Additional SOL (in lamports) for ATA creation and account initialization. Recommended 12000000; the actual requirement may be lower, and any unused amount is refunded. Can be provided as a string or a number

Pattern: ^[0-9]+$
timestamp
required

Unix timestamp of when the trade was initiated (in milliseconds). Can be provided as a string or a number

Pattern: ^[0-9]+$
user_signature
string
required

A digital signature of 'By signing, I hereby agree to Vanish's Terms of Service and agree to be bound by them (docs.vanish.trade/legal/TOS)

Details: trade:{source_token_address}:{target_token_address}:{amount}:{loan_additional_sol}:{timestamp}:{jito_tip_amount}', signed by the user's wallet.

split_repay
integer<uint8>
required

Number of trading accounts the purchased tokens are distributed across. Lower values keep the transaction smaller and work better with prefer_non_jito. Use 1 unless amount_out exceeds 0.5% of token supply.

Required range: x <= 10
one_time_wallet
string
required

The wallet address for the swap transaction, returned by the /trade/one-time-wallet endpoint.

prefer_non_jito
object

When provided, prioritizes single-transaction (non-Jito) routing, using the supplied priority fee fields. Works best with low split_repay values, since smaller transactions are likelier to fit in one transaction.

Response

Successful trade transaction data response.

tx_id
string
required

Transaction ID of the (possibly bundled) trade.

jito_bundle_id
string | null

If routed via Jito bundle, its bundle ID; otherwise null.

transaction
string | null

Serialized single‐tx trade body for non‐Jito route; null if Jito bundle used.