Skip to main content
POST
/
trade
/
create
cURL
curl --request POST \
  --url https://core-api-dev.vanish.trade/trade/create \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "user_address": "<string>",
  "source_token_address": "<string>",
  "target_token_address": "<string>",
  "amount": "<string>",
  "jito_tip_amount": "<string>",
  "swap_transaction": "<string>",
  "loan_additional_sol": "<string>",
  "timestamp": "<string>",
  "user_signature": "<string>",
  "split_repay": 9,
  "one_time_wallet": "<string>",
  "prefer_non_jito": {
    "compute_unit_price": "<string>",
    "compute_unit_limit": "<string>",
    "custom_tip_address": "<string>",
    "custom_tip_amount": "<string>"
  }
}
'
{
  "tx_id": "<string>",
  "jito_bundle_id": "<string>",
  "transaction": "<string>"
}

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

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

swap_transaction
string
required

Serialized or encoded data representing the swap transaction

loan_additional_sol
required

Additional SOL (in lamports) required to support the loan/trade operation, typically used for creating associated token accounts (ATAs). Can be provided as a string or a number

timestamp
required

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

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

How many splits to use for the swap repay (capped at 10). Lower values increase chance of single-tx routing.

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

If present, prefer a single‐tx non‐Jito route when possible; uses these fields for priority fee.

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.