Trade API
CobaltX trade API is the fastest and easiest way to interact with CobaltX liquidity. It allows you to swap for any asset with 2 requests and a signature.
Get quote parameters
inputMint
string
yes
Input token mint address
outputMint
string
yes
Output token mint address
amount
number
yes
Either inputAmount or outpoutAmount depending on the swap mode.
slippageBps
number
yes
Slippage tolerance in base points (0.01%).
Post parameters
version
string
yes
Use 'V0' for versioned transaction, and 'LEGACY' for legacy transaction.
wrapEth
boolean
no
Need to be true to accept ETH as inputToken.
unwrapEth
boolean
no
Need to set to true to unwrap wSol received as outputToken.
computeUnitPriceMicroLamports
string
yes
You can type it in manually or use CobaltX priority fee API to set an automatic amount with 'String(data.data.default.h)'. The 'h' here stands for high priority.
'vh' for very high and 'm' for medium are also accepted value.
wallet
string
yes
pubkey
inputTokenAccount
string
no
default to ATA
outpoutTokenAccount
string
no
default to ATA
Last updated