# amm/swap

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

The endpoint allows you to specify priority fees and tips to later control the transaction inclusion and propagation.  Refer to the[ Transaction Submission ](https://docs.bloxroute.com/solana/trader-api/quick-start/transaction-submission)& [Front-Running Protection & Transaction Bundle](https://docs.bloxroute.com/solana/trader-api/api-endpoints/pump.fun/broken-reference) page for additional information about these parameters.&#x20;

### Request

#### Method:&#x20;

`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="broken-reference">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 %}
