Skip to main content

/pump-fun/swap REST API Endpoint

Returns a transaction that you can use to swap on Pump.fun.

Updated on
Jan 10, 2025

/pump-fun/swap REST API Endpoint

Please note that this method is available for Free and Paid subscribers of Metis - Jupiter V6 Swap API, along with jupiterapi.com users. 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

tx
string
The base-64 encoded transaction that can be signed and submitted to the network
Request
1
curl --location --request POST 'https://docs-demo.solana-mainnet.quiknode.pro/pump-fun/swap' \
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