Query Parameters
- walletstringREQUIRED
The wallet address of the user who wants to perform the swap
- typestringREQUIRED
The type of swap (BUY or SELL)
- mintstringREQUIRED
The pump.fun mint address of the token to swap
- inAmountstringREQUIRED
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.
- priorityFeeLevelstring
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.
- slippageBpsstring
Slippage tolerance in basis points (defaults to 100 if not provided)
- commitmentstring
The level of commitment required for the query. The options include: 'finalized', 'confirmed', and 'processed'. (default: 'confirmed')
- feeAccountstring
The wallet address of the user who wants to collect a fee on the swap. Must use with
platformFeeBps.
- platformFeeBpsinteger
The fee in basis points the feeAccount will receive on the swap (i.e 100 = 1%). Must use with
feeAccount.
Returns
- instructionsarray
Array of instructions to execute the swap
- keysarray
Array of account keys needed for the instruction
- pubkeystring
Public key of the account
- isSignerboolean
Whether this account needs to sign the transaction
- isWritableboolean
Whether this account will be written to
- programIdstring
The program that will process this instruction
- dataarray
The instruction data as an array of numbers
1{2"instructions": [3{4"keys": [5{6"pubkey": "6Cf7nWaodsE6vH4uctqURbEhJReYypifdhhB9Rn7NByU",7"isSigner": true,8"isWritable": true9},10{11"pubkey": "D5hjyQvdhkCHCLG9N9urDc4vQyY5bKoaQjAP9KH1EB6N",12"isSigner": false,13"isWritable": true14},15{16"pubkey": "2q7jMwWYFxUdxBqWbi8ohztyG1agjQMrasUXwqGCpump",17"isSigner": false,18"isWritable": true19},20{21"pubkey": "So11111111111111111111111111111111111111112",22"isSigner": false,23"isWritable": false24},25{26"pubkey": "97e6Yj6JhdN5DMKafQeYvyP6MQ9xHpd8TKUpCmzcPQnb",27"isSigner": false,28"isWritable": true29},30{31"pubkey": "11111111111111111111111111111111",32"isSigner": false,33"isWritable": false34},35{36"pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",37"isSigner": false,38"isWritable": false39},40{41"pubkey": "SysvarRent111111111111111111111111111111111",42"isSigner": false,43"isWritable": false44},45{46"pubkey": "ComputeBudget111111111111111111111111111111",47"isSigner": false,48"isWritable": false49}50],51"programId": "PumpFunuYiVXKEh6nkJulFPmqU6hQmzHME1Gxpn7U8y",52"data": [532,540,550,560,570,580,590,600,61100,620,630,640,650,660,670,680,69070]71},72{73"keys": [74{75"pubkey": "ComputeBudget111111111111111111111111111111",76"isSigner": false,77"isWritable": false78}79],80"programId": "ComputeBudget111111111111111111111111111111",81"data": [822,8364,84158,85217,860,870,880,890,90091]92}93]94}
1{2"instructions": [3{4"keys": [5{6"pubkey": "6Cf7nWaodsE6vH4uctqURbEhJReYypifdhhB9Rn7NByU",7"isSigner": true,8"isWritable": true9},10{11"pubkey": "D5hjyQvdhkCHCLG9N9urDc4vQyY5bKoaQjAP9KH1EB6N",12"isSigner": false,13"isWritable": true14},15{16"pubkey": "2q7jMwWYFxUdxBqWbi8ohztyG1agjQMrasUXwqGCpump",17"isSigner": false,18"isWritable": true19},20{21"pubkey": "So11111111111111111111111111111111111111112",22"isSigner": false,23"isWritable": false24},25{26"pubkey": "97e6Yj6JhdN5DMKafQeYvyP6MQ9xHpd8TKUpCmzcPQnb",27"isSigner": false,28"isWritable": true29},30{31"pubkey": "11111111111111111111111111111111",32"isSigner": false,33"isWritable": false34},35{36"pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",37"isSigner": false,38"isWritable": false39},40{41"pubkey": "SysvarRent111111111111111111111111111111111",42"isSigner": false,43"isWritable": false44},45{46"pubkey": "ComputeBudget111111111111111111111111111111",47"isSigner": false,48"isWritable": false49}50],51"programId": "PumpFunuYiVXKEh6nkJulFPmqU6hQmzHME1Gxpn7U8y",52"data": [532,540,550,560,570,580,590,600,61100,620,630,640,650,660,670,680,69070]71},72{73"keys": [74{75"pubkey": "ComputeBudget111111111111111111111111111111",76"isSigner": false,77"isWritable": false78}79],80"programId": "ComputeBudget111111111111111111111111111111",81"data": [822,8364,84158,85217,860,870,880,890,90091]92}93]94}