Swap
Last updated
Last updated
POST
/trade/warp/swap
Send a warp transaction to trade a token.
Headers
Body
action
"buy" | "sell"
Yes
buy or sell the token
mint
string
Yes
Contract address of token to trade
amount
number
Either amount OR percentage must be provided
Amount to buy/sell denominated by ccy field.
ccy
"sol" | "lamports" | "token" | "usd"
Yes IF amount is provided; No IF using percentage
Denomination for amount field (buy 1 sol, buy 1 usd, etc...)
percentage
number > 0 & <=100
Either amount OR percentage must be provided
Percentage of account to buy/sell (1 =1%, 10=10%). Buying 10% means spending 10% of sol in your wallet; Selling 10% means selling 10% of the tokens you own. There is a known bug when buying super high percentages due to fees. We have acknowledged this issue and are actively working on a fix. We recommend not buying more than 80%; Sells are unaffected you may sell 100% still.
slippage
number ≥ 0
No - defaults to 5
% tolerated slippage for transaction (10 = 10%, 1 = 1%. Recommended value is 5%.
priorityFee
number > 0.00001
No - defaults to 0.001
pool
"pump" | "raydium" | "auto"
No - defaults to auto
Response
Priority Fee denominated in solana. The higher it is, the faster and higher success rate for the transaction is. You can get the optimal priority fee from
The current pool the token is trading in. pump means it has not yet bonded, and raydium means it has. auto will determine for you using the endpoint. Providing the known pool will slightly increase response time.
X-PUMPLIFY-WKEY
your WKey