Skip to main content

/pump-fun/swap-instructions REST API Endpoint

Returns instructions that you can use to swap on Pump.fun.

Updated on
Jan 03, 2025

/pump-fun/swap-instructions REST API Endpoint

Please note that this method is only available for paid subscribers of Metis - Jupiter V6 Swap API. This endpoint is currently in BETA. If you have any feedback or run into any issues, please reach out to support.

Query Parameters

wallet
string
REQUIRED
The wallet address of the user who wants to perform the swap
type
string
REQUIRED
The type of swap (BUY or SELL)
mint
string
REQUIRED
The pump.fun mint address of the token to swap
inAmount
string
REQUIRED
The input amount for the swap. For type = BUY, the input token is SOL and its being swapped for the provided pump.fun token (mint). For type = SELL, the input token is the pump.fun mint token being sold, which is provided in the mint field. Note: All Pump.fun mints have 6 decimals. Specified amount should include those decimals here, e.g. Selling 100 tokens should be passed as 100000000.
priorityFeeLevel
string
Priority fee level for the transaction (low, medium, high, extreme). If you set a priority fee level, the transaction will be simulated before returning a response. If the simulation fails, the method will throw.
slippageBps
string
Slippage tolerance in basis points (defaults to 100 if not provided)

Returns

instructions
array
Array of instructions to execute the swap
keys
array
Array of account keys needed for the instruction
pubkey
string
Public key of the account
isSigner
boolean
Whether this account needs to sign the transaction
isWritable
boolean
Whether this account will be written to
programId
string
The program that will process this instruction
data
array
The instruction data as an array of numbers
Request
1
curl --location --request POST 'https://docs-demo.solana-mainnet.quiknode.pro/pump-fun/swap-instructions' \
2
--header 'Content-Type: application/json' \
3
--data '{
4
"wallet": "6Cf7nWaodsE6vH4uctqURbEhJReYypifdhhB9Rn7NByU",
5
"type": "BUY",
6
"mint": "2q7jMwWYFxUdxBqWbi8ohztyG1agjQMrasUXwqGCpump",
7
"inAmount": "100000000",
8
"priorityFeeLevel": "high"
9
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free