Create Swap Transaction by SOL

Creates an unsigned transaction for the best possible swap through the specified tokens provided by Pump.fun.

This endpoint does not submit the transaction to the network.

The endpoint allows you to specify priority fees and tips to later control the transaction inclusion and propagation. Refer to the Transaction Submission & Front-Running Protection & Transaction Bundle page for additional information about these parameters.

Request

Be aware that this endpoint is using a dedicated URL.

https://pump-ny.solana.dex.blxrbdn.com/

https://pump-uk.solana.dex.blxrbdn.com/

Method:

POST ./api/v2/pumpfun/swap-sol

Parameters:

Parameter
Type
Description

userAddress

string

Solana address which is placing swap.

bondingCurveAddress

string

Bonding Curve program address.

tokenAddress

string

Token address.

solAmount

double

The SOL amount users expected to swap. This is expected to be the pump.fun SOL threshold.

computeLimit

uint32

OPTIONAL. Specifies total compute limit to be allocated for all instructions within the created tx

computePrice

uint64

OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to be included as a part of instruction, known as priority fee.

tip

unit64

OPTIONAL. Specifies a tip amount that will be used to pay for front-running protection or bundle submission services. What is tip?

Request example:

curl -X 'POST' \
  -H "Authorization: $AUTH_HEADER" \
  -H 'Content-Type: application/json' \
  'https://pump-ny.solana.dex.blxrbdn.com/api/v2/pumpfun/swap' \
  -d '{
    "userAddress":"9VUYmJa8NAB8uDe9P9aiFw3DEfezdkg5P5nQH6gcK5Kq", 
    "bondingCurveAddress":"Fh8fnZUVEpPStJ2hKFNNjMAyuyvoJLMouENawg4DYCBc", 
    "tokenAddress":"2DEsbYgW94AtZxgUfYXoL8DqJAorsLrEWZdSfriipump", 
    "solAmount":1, 
    "computeLimit":300000, 
    "computePrice":"2000", 
    "tip":"2000001"}'

Response:

Fields:

Field
Type
Description

transaction

TransactionMessage

See TransactionMessage below for details

TransactionMessage

Parameter
Description

content

string

Raw bytes of unsigned transaction (should be in base64)

Example:

{
    "id": 1,
    "result": {
        "transaction": {
            "content": "AQAA...QXBp"
        }
    },
    "jsonrpc": "2.0"
}

Last updated