Actions
Actions let you combine multiple operations β like buy, sell, create, transfer, claimCashback, burn, and more β into a single transaction.
Great for increasing token volume, making multiple sales to clean up an account, and other strategies.
Endpointβ
POST https://api.pumpapi.io
Basic Structureβ
{
"actions": [
{
"privateKey": "base58_private_key",
"action": "buy",
"mint": "token_address",
"amount": 0.1,
"denominatedInQuote": True,
"slippage": 99,
"priorityFee": 0.00002
},
{
"privateKey": "base58_private_key",
"action": "sell",
"mint": "token_address",
"amount": "100%",
"denominatedInQuote": True,
"slippage": 99,
"priorityFee": 0.00002
}
]
}
Each object in actions follows the same fields as the Trade API.
Priority Feeβ
priorityFee accumulates across actions β because each action adds complexity to the transaction. A transaction with two swaps is more complex than with one, so it requires a higher fee to land reliably.
Global Priority Feeβ
If you want a single priorityFee for the whole transaction, set it above the actions block. Per-action priorityFee values will be ignored.
{
"priorityFee": 0.00002,
"actions": [
{ "action": "buy", ... },
{ "action": "sell", ... }
]
}
Multiple Walletsβ
You can use different wallets for different actions. Just set privateKey inside each action.
You can also change the transaction signer (the wallet that pays the fee) by setting privateKey at the top level:
{
"privateKey": "base58_fee_payer_key",
"actions": [
{ "privateKey": "wallet_a_key", "action": "buy", ... },
{ "privateKey": "wallet_b_key", "action": "sell", ... }
]
}
Solana Transaction Limitsβ
Solana has a 1232-byte limit per transaction.
Transaction size grows when actions involve different AMMs, because each AMM requires loading additional accounts.
| Scenario | How many swaps fit |
|---|---|
| Same AMM (e.g. all Pump.fun) | ~4β5 swaps |
| Mixed AMMs | ~2 |
There's also a CPI limit of 49. A typical swap uses ~10 CPIs, so you'll hit this limit around 4β5 swaps even on a single AMM like Pump.fun.
Actions vs. Jito Bundlesβ
| Actions | Jito Bundles | |
|---|---|---|
| What it does | Combines multiple operations into 1 transaction | Combines multiple transactions into 1 bundle |
| Use case | Multi-step logic in one atomic tx | Atomic ordering of separate txs |
Local Transactionsβ
Actions also support local (unsigned) transactions β just use publicKey instead of privateKey, and sign + send the transaction yourself. See the Trade API page for the local logic.
Code Examplesβ
- Python
- JavaScript
- Rust
- Go
import requests
url = "https://api.pumpapi.io"
data = {
"actions": [
{
"privateKey": "base58_private_key",
"action": "buy",
"mint": "token_address",
"amount": 0.1,
"denominatedInQuote": True,
"slippage": 99,
"priorityFee": 0.00002,
},
{
"privateKey": "base58_private_key",
"action": "sell",
"mint": "token_address",
"amount": "100%",
"denominatedInQuote": True,
"slippage": 99,
"priorityFee": 0.00002,
}
]
}
response = requests.post(url, json=data)
print(response.json())
import axios from 'axios';
const data = {
actions: [
{
privateKey: "base58_private_key",
action: "buy",
mint: "token_address",
amount: 0.1,
denominatedInQuote: true,
slippage: 99,
priorityFee: 0.00002,
},
{
privateKey: "base58_private_key",
action: "sell",
mint: "token_address",
amount: "100%",
denominatedInQuote: true,
slippage: 99,
priorityFee: 0.00002,
}
]
};
axios.post("https://api.pumpapi.io", data)
.then(response => console.log(response.data))
.catch(error => console.error(error));
use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client
.post("https://api.pumpapi.io")
.json(&json!({
"actions": [
{
"privateKey": "base58_private_key",
"action": "buy",
"mint": "token_address",
"amount": 0.1,
"denominatedInQuote": true,
"slippage": 99,
"priorityFee": 0.00002
},
{
"privateKey": "base58_private_key",
"action": "sell",
"mint": "token_address",
"amount": "100%",
"denominatedInQuote": true,
"slippage": 99,
"priorityFee": 0.00002
}
]
}))
.send()
.await?
.text()
.await?;
println!("{}", res);
Ok(())
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
data := map[string]interface{}{
"actions": []map[string]interface{}{
{
"privateKey": "base58_private_key",
"action": "buy",
"mint": "token_address",
"amount": 0.1,
"denominatedInQuote": true,
"slippage": 99,
"priorityFee": 0.00002,
},
{
"privateKey": "base58_private_key",
"action": "sell",
"mint": "token_address",
"amount": "100%",
"denominatedInQuote": true,
"slippage": 99,
"priorityFee": 0.00002,
},
},
}
jsonData, _ := json.Marshal(data)
resp, err := http.Post("https://api.pumpapi.io", "application/json", bytes.NewBuffer(jsonData))
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
Need help? Join our Telegram group.