# swap-sol

{% hint style="warning" %}
This endpoint does not submit the transaction to the network.
{% endhint %}

The endpoint allows you to specify priority fees and tips to later control the transaction inclusion and propagation. Refer to the[ Transaction Submission ](/solana/trader-api/quick-start/transaction-submission.md)& [Front-Running Protection, Revert Protection, & Transaction Bundle](broken://pages/m1AKjUIvurlMSeFEAkVv) page for additional information about these parameters.

### Request

#### Method:

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

#### Parameters:

<table><thead><tr><th width="196.71896910191123">Parameter</th><th width="92">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>userAddress</code></td><td>string</td><td>Solana address which is placing swap.</td></tr><tr><td><code>bondingCurveAddress</code></td><td>string</td><td>Bonding Curve program address.</td></tr><tr><td><code>tokenAddress</code></td><td>string</td><td>Token address.</td></tr><tr><td><code>solAmount</code></td><td>double</td><td>The SOL amount users expected to swap.</td></tr><tr><td><code>creator</code></td><td>string</td><td>The token creator address.</td></tr><tr><td><code>computeLimit</code></td><td>uint32</td><td>OPTIONAL. Specifies total compute limit to be allocated for all instructions within the created tx</td></tr><tr><td><code>computePrice</code></td><td>uint64</td><td>OPTIONAL. Specifies compute price in Lamport (0.000001 SOL = 1,000 Lamport) to be included as a part of instruction, known as priority fee.</td></tr><tr><td><code>tip</code></td><td>unit64</td><td><strong>OPTIONAL.</strong> Specifies a tip amount.</td></tr><tr><td><code>slippage</code></td><td>double</td><td>Specify the slippage of your transaction. Can be from 0-1000. (E.g. 1 = 1%)</td></tr></tbody></table>

#### Request example:

{% tabs %}
{% tab title="HTTP" %}

```bash
curl -X 'POST' \
  -H "Authorization: $AUTH_HEADER" \
  -H 'Content-Type: application/json' \
  'https://pump-ny.solana.dex.blxrbdn.com/api/v2/pumpfun/swap-sol' \
  -d '{
    "userAddress": "9VUYmJa8NAB8uDe9P9aiFw3DEfezdkg5P5nQH6gcK5Kq",
    "bondingCurveAddress": "BcVzydVqA4C9c3u4NJhkJZs3BBkqzwa2cqAkMUqfgHV9",
    "tokenAddress": "Ds37SDZNukQj1aQYKgyWDkDz5xvpNx7PhiwE58TApump",
    "creator": "JBYTEiKue7TdNMWtSKUZwyyRpHpTV9UKgkioQP4JttPn"
    "solAmount": 1
    "slippage" : 1
}'
```

{% endtab %}
{% endtabs %}

### Response:

#### Fields:

<table><thead><tr><th width="177.5236885968357">Field</th><th width="245">Type</th><th width="419.58916051319363">Description</th></tr></thead><tbody><tr><td><code>transaction</code></td><td><code>TransactionMessage</code></td><td>See <code>TransactionMessage</code> below for details</td></tr></tbody></table>

`TransactionMessage`

<table><thead><tr><th width="184">Parameter</th><th width="178.2"></th><th width="369">Description</th></tr></thead><tbody><tr><td><code>content</code></td><td>string</td><td>Raw bytes of unsigned transaction (should be in base64)</td></tr></tbody></table>

#### Example:

{% tabs %}
{% tab title="JSON" %}

```json
{
    "transaction": {
        "content": "AQAA...QXBp"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bloxroute.com/solana/trader-api/api-endpoints/pump.fun/swap-sol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
