# amm/swap

{% 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 & Transaction Bundle](broken://pages/l1XxJpEiTHNboMs62P4Y) page for additional information about these parameters.

### Request

#### Method:

`POST ./api/v2/pumpfun/amm/swap`

#### Parameters:

<table><thead><tr><th width="196.71896910191123">Parameter</th><th width="92">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>ownerAddress</code></td><td>string</td><td>Solana address which is placing swap.</td></tr><tr><td><code>inToken</code></td><td>string</td><td>Address of the swap-in token.</td></tr><tr><td><code>outToken</code></td><td>string</td><td>Address of the swap-out token.</td></tr><tr><td><code>pool</code></td><td>string</td><td>Specify exact which liquidity pool wants to interact with.</td></tr><tr><td><code>inAmount</code></td><td>double</td><td>The amount of token wants to be swapped from.</td></tr><tr><td><code>slippage</code></td><td>double</td><td>The maximum slippage tolerance in percentage.</td></tr><tr><td><code>computeLimit</code></td><td>uint64</td><td><strong>OPTIONAL</strong>. 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><strong>OPTIONAL</strong>. 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 that will be used to pay for front-running protection or bundle submission services. <a href="/pages/l1XxJpEiTHNboMs62P4Y">What is <code>tip</code>?</a></td></tr></tbody></table>

#### Request example:

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

```bash
curl --location 'https://pump-ny.solana.dex.blxrbdn.com/api/v2/pumpfun/amm/swap' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: $AUTH_HEADER' \
--data '{
  "ownerAddress": "3RshvockaPKfPYZzsr6oxphcjQRbdhzCmQ11LSNxqkb2",
  "inToken": "So11111111111111111111111111111111111111112",
  "outToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "pool": "Gf7sXMoP8iRw4iiXmJ1nq4vxcRycbGXy5RL8a8LnTd3v",
  "inAmount": 0.01,
  "slippage": 1,
  "computeLimit": 130000,
  "computePrice": 100000,
  "tip": 10000
}'
```

{% endtab %}
{% endtabs %}

### Response:

#### Example:

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

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "transactions":[{
        "content":"AQAA...AAA==",
        "isCleanup":false
    }],
    "buyQuoteAmountIn":0.009970089,
    "buyUserQuoteAmountIn":0.01,
    "buyMaxQuoteAmountIn":0.0101,
    "buyBaseAmountOut":1.722171,
    "sellBaseAmountIn":0,
    "sellMinQuoteAmountOut":0,
    "sellQuoteAmountOut":0,
    "sellUserQuoteAmountOut":0,
    "fees":[{
        "amount":0.000029911,
        "mint":"So11111111111111111111111111111111111111112",
        "percent":0.3
    }]
}
</code></pre>

{% 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/amm-swap.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.
