โšก

PlugyTrade API

Generate PumpFun trade transactions via a single API call

Send a POST request, get a serialized Solana transaction back. Sign it with your private key and send through your own RPC. Full control, zero custody.

Native EngineBuy & SellToken-2022 SupportMulti-Pool (WIP)Non-Custodial% Sell Support

โ–ธ How it works

01

Request transaction

POST to /api/trade with your wallet pubkey, token mint, amount, and trade direction.

02

Sign locally

Receive a serialized transaction. Deserialize and sign it with your private key โ€” never leaves your machine.

03

Send via your RPC

Submit the signed transaction through your preferred Solana RPC endpoint. Full control over execution.

โ–ธ Endpoint

POST/api/trade

Returns a base64-encoded serialized Solana transaction. Content-Type: application/json

โ–ธ Parameters

ParameterTypeRequiredDescription
publicKeystringโœ“ yesYour wallet public key
action"buy" | "sell"โœ“ yesTrade direction
mintstringโœ“ yesToken contract address (CA)
amountnumber | stringโœ“ yesSOL or token amount. Sell supports "100%" syntax
denominatedInSol"true" | "false"โœ“ yes"true" if amount is SOL, "false" if tokens
slippagenumberโœ“ yesPercent slippage allowed (0โ€“100)
priorityFeenumberโœ“ yesPriority fee in SOL
poolstringnoCurrently implemented: "pump". Planned: "pumpswap", "launchlab", "raydium", "raydium-cpmm", "bonk", "auto"

โ–ธ Response

200Success
{
  "success": true,
  "action": "buy",
  "pool": "pump",
  "transaction": "base64...",
  "estimatedTokens": 12345.678,
  "maxSolCost": 0.011,
  "tokenStandard": "SPL",
  "createsAta": true
}
200Sell response
{
  "success": true,
  "action": "sell",
  "pool": "pump",
  "transaction": "base64...",
  "estimatedSol": 0.05,
  "minSolOutput": 0.045,
  "sellAmount": 10000,
  "tokenBalance": 10000
}

โ–ธ Try it out

โ— Interactive Demo

cURL Command
curl -X POST /api/trade \
  -H "Content-Type: application/json" \
  -d '{
  "publicKey": "YOUR_PUBLIC_KEY",
  "action": "buy",
  "mint": "TOKEN_MINT_ADDRESS",
  "amount": 0.01,
  "denominatedInSol": "true",
  "slippage": 10,
  "priorityFee": 0.005,
  "pool": "auto"
}'

โ— Code Examples

JavaScript@solana/web3.js
import { Connection, Keypair, VersionedTransaction } from '@solana/web3.js';
import bs58 from 'bs58';

async function trade() {
  // 1. Request serialized transaction from Plugy API
  const response = await fetch('https://your-domain.com/api/trade', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      publicKey: "YOUR_WALLET_PUBLIC_KEY",
      action: "buy",                    // "buy" or "sell"
      mint: "TOKEN_MINT_ADDRESS",       // token contract address
      amount: 0.01,                     // SOL amount or token amount
      denominatedInSol: "true",         // "true" = SOL, "false" = tokens
      slippage: 10,                     // percent slippage
      priorityFee: 0.005,              // priority fee in SOL
      pool: "auto"                      // "pump", "raydium", "auto", etc.
    })
  });

  const data = await response.json();

  // 2. Decode and sign the transaction
  const txBytes = Buffer.from(data.transaction, 'base64');
  const tx = VersionedTransaction.deserialize(txBytes);

  const keypair = Keypair.fromSecretKey(bs58.decode('YOUR_PRIVATE_KEY'));
  tx.sign([keypair]);

  // 3. Send via your own RPC
  const connection = new Connection('YOUR_RPC_ENDPOINT');
  const sig = await connection.sendRawTransaction(tx.serialize(), {
    skipPreflight: false,
    maxRetries: 3,
  });

  console.log(`TX: https://solscan.io/tx/${sig}`);
}
Pythonsolders
import requests
from solders.transaction import VersionedTransaction
from solders.keypair import Keypair
from solders.commitment_config import CommitmentLevel
from solders.rpc.requests import SendVersionedTransaction
from solders.rpc.config import RpcSendTransactionConfig
import base64

# 1. Request serialized transaction from Plugy API
response = requests.post(
    url="https://your-domain.com/api/trade",
    json={
        "publicKey": "YOUR_WALLET_PUBLIC_KEY",
        "action": "buy",
        "mint": "TOKEN_MINT_ADDRESS",
        "amount": 0.01,
        "denominatedInSol": "true",
        "slippage": 10,
        "priorityFee": 0.005,
        "pool": "auto"
    }
)

data = response.json()

# 2. Decode and sign
tx_bytes = base64.b64decode(data["transaction"])
keypair = Keypair.from_base58_string("YOUR_PRIVATE_KEY")
tx = VersionedTransaction(
    VersionedTransaction.from_bytes(tx_bytes).message,
    [keypair]
)

# 3. Send via your RPC
commitment = CommitmentLevel.Confirmed
config = RpcSendTransactionConfig(preflight_commitment=commitment)
tx_payload = SendVersionedTransaction(tx, config)

rpc_response = requests.post(
    url="YOUR_RPC_ENDPOINT",
    headers={"Content-Type": "application/json"},
    data=tx_payload.to_json()
)

print(f"TX: {rpc_response.json()['result']}")
cURL
# Buy tokens
curl -X POST https://your-domain.com/api/trade \
  -H "Content-Type: application/json" \
  -d '{
    "publicKey": "YOUR_WALLET_PUBLIC_KEY",
    "action": "buy",
    "mint": "TOKEN_MINT_ADDRESS",
    "amount": 0.01,
    "denominatedInSol": "true",
    "slippage": 10,
    "priorityFee": 0.005,
    "pool": "auto"
  }'

# Sell all tokens (100%)
curl -X POST https://your-domain.com/api/trade \
  -H "Content-Type: application/json" \
  -d '{
    "publicKey": "YOUR_WALLET_PUBLIC_KEY",
    "action": "sell",
    "mint": "TOKEN_MINT_ADDRESS",
    "amount": "100%",
    "denominatedInSol": "false",
    "slippage": 10,
    "priorityFee": 0.005,
    "pool": "auto"
  }'

โ–ธ Supported Pools

pumpLIVE

PumpFun bonding curve

pumpswapSOON

PumpSwap AMM

launchlabSOON

LaunchLab pools

raydiumSOON

Raydium AMM

raydium-cpmmSOON

Raydium CPMM

bonkSOON

Bonk pools

autoSOON

Auto-detect best pool

โ–ธ For AI Agents

๐Ÿค–

Send Your AI Agent to Plugy

Teach your agent to trade on PumpFun

Read https://plugy.fun/skill.md and follow the instructions to add the Plugy Trade skill to your agent.

1.

Send your agent to https://plugy.fun/skill.md

2.

Agent reads the skill file and learns how to call the Plugy Trade API

3.

Agent can now generate buy/sell transactions on PumpFun autonomously