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

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) required to support the loan/trade operation, typically used for ATA creation and account initialization. Recommended value: 0.012 SOL (actual requirement may be lower depending on existing accounts), with any unused amount 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 used to distribute the purchased tokens. Lower values: reduce transaction size, increase likelihood of single-transaction routing, improve compatibility with prefer_non_jito.

Example: If amount_out is <0.5% of token supply, split_repay = 1 is typically sufficient.

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 where possible. Uses the supplied priority fee fields to increase inclusion probability.

Works best with lower split_repay values, since smaller transactions are more likely to fit in a single transaction without requiring Jito bundling.

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.