▸ Human API — Non-Custodial

Generate unsigned Solana transactions via a single POST request. Sign them locally with your private key and submit through your own RPC. Your keys never leave your machine.

POSThttps://plugy.fun/api/trade

Returns a base64-encoded unsigned Solana transaction · No authentication required · Platform fee included in TX

Platform Fee

Every transaction includes a percentage-based SOL fee transferred to the PLUGy platform wallet. For buys, the fee is calculated on the SOL input amount. For sells, on the estimated SOL output. The fee instruction is embedded in the unsigned transaction — you can inspect it before signing. The exact fee amount is returned in the fee response field.

ParameterTypeReqDescription
publicKeystringYour wallet public key
action"buy" | "sell" | "create" | "collectCreatorFee"Trade direction, "create" to launch a token, or "collectCreatorFee" to claim accumulated creator rewards
mintstringToken contract address — not needed for create
amountnumber | stringSOL or token amount. Sell supports "100%" — not needed for create
denominatedInSol"true" | "false""true" if amount is in SOL, "false" if tokens — not needed for create
slippagenumberPercent slippage allowed (0–100)
priorityFeenumberPriority fee in SOL
poolstring"pump", "pumpswap", "launchlab" (Raydium), "meteora", or "auto" (default)
tokenMetadataobjectCreate only: { name, symbol, description, file (URL or base64), twitter?, telegram?, website? }
devBuyAmountnumberCreate only: dev-buy in SOL (default 0)
mintPublicKeystringCreate only: pass mint address only — server skips mint signing, you sign client-side with both wallet + mint keypair
mintSecretKeystringCreate only: base64 or bs58 secret key — server signs with mint keypair for you (agent use)
creatorRewardsbooleanCreate only: true = creator-rewards token · false (default) = cashback token
200Buy response
{
  "success": true,
  "action": "buy",
  "pool": "pump",
  "transaction": "base64...",
  "estimatedTokens": 12345.678,
  "maxSolCost": 0.011,
  "fee": { "sol": 0.000025, "rate": "0.25%" }
}
200Sell response
{
  "success": true,
  "action": "sell",
  "pool": "pump",
  "transaction": "base64...",
  "estimatedSol": 0.05,
  "minSolOutput": 0.045,
  "fee": { "sol": 0.000125, "rate": "0.25%" }
}
200Create response
{
  "success": true,
  "action": "create",
  "transaction": "base64...",
  "mintAddress": "NewToken...",
  "mintSignedByServer": true,
  "mintSecretKey": "base64... (only when server generated mint; absent when mintPublicKey was provided)",
  "metadataUri": "https://...",
  "hasDevBuy": true,
  "estimatedTokens": 1000000,
  "fee": { "sol": 0.005, "rate": "0.25%" }
}
200collectCreatorFee response
{
  "success": true,
  "action": "collectCreatorFee",
  "transaction": "base64...",
  "pendingBcSol": 0.038491,
  "pendingAmmSol": 0.012300,
  "totalPendingSol": 0.050791,
  "message": "Sign and submit this transaction
to collect 0.050791 SOL in creator fees
(0.038491 SOL from bonding curve,
 0.012300 SOL from PumpSwap)."
}

Buy examples

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

const res = await fetch('https://plugy.fun/api/trade', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    publicKey: "YOUR_WALLET_PUBLIC_KEY",
    action: "buy",
    mint: "TOKEN_MINT_ADDRESS",
    amount: 0.01,
    denominatedInSol: "true",
    slippage: 10,
    priorityFee: 0.005,
    pool: "auto"
  })
});

const { transaction } = await res.json();

const tx = VersionedTransaction.deserialize(Buffer.from(transaction, 'base64'));
const keypair = Keypair.fromSecretKey(bs58.decode('YOUR_PRIVATE_KEY'));
tx.sign([keypair]);

const connection = new Connection('YOUR_RPC_ENDPOINT');
const sig = await connection.sendRawTransaction(tx.serialize());
console.log(`https://solscan.io/tx/${sig}`);

Sell examples

const res = await fetch('https://plugy.fun/api/trade', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    publicKey: "YOUR_WALLET_PUBLIC_KEY",
    action: "sell",
    mint: "TOKEN_MINT_ADDRESS",
    amount: "100%",
    denominatedInSol: "false",
    slippage: 10,
    priorityFee: 0.005,
    pool: "auto"
  })
});
const { transaction } = await res.json();
// Sign & send as usual...

Create token example

curl -X POST https://plugy.fun/api/trade \
  -H "Content-Type: application/json" \
  -d '{
    "publicKey": "YOUR_WALLET_PUBLIC_KEY",
    "action": "create",
    "tokenMetadata": {
      "name": "My Token",
      "symbol": "MTK",
      "description": "A cool PumpFun token",
      "file": "https://example.com/logo.png",
      "twitter": "https://x.com/mytoken",
      "telegram": "https://t.me/mytoken",
      "website": "https://mytoken.fun"
    },
    "devBuyAmount": 1,
    "slippage": 10,
    "priorityFee": 0.005,
    "creatorRewards": false
  }'

# With pre-generated mint address (recommended — mintPublicKey, no secret sent to server):
# Step 1 — generate locally:
#   const kp = Keypair.generate();
#   // save kp.secretKey — you need it for client-side signing
# Step 2 — pass only the public key:
#   add  "mintPublicKey": "<kp.publicKey.toBase58()>"
# Response will have mintSignedByServer: false — sign TX with BOTH wallet + mint keypair.
#
# Alternative — mintSecretKey (server signs for you, mainly for agent API):
#   add  "mintSecretKey": "<base64 secret>"

▸ Collect creator fees

NEW

Every time someone buys or sells your token, pump.fun accumulates a small SOL reward for you as the creator. Fees come from two separate vaults depending on where the token is traded:

Bonding curve vault

Accumulates native SOL during bonding curve trading on pump.fun. Available immediately — no migration required.

PumpSwap AMM vault

Accumulates WSOL after your token graduates and migrates to PumpSwap. Automatically unwrapped to SOL on claim.

The collectCreatorFee action checks both vaults in parallel and builds a single transaction that collects everything available in one shot. Only publicKey and priorityFee are required — no mint needed.

⚠ The returned transaction is a legacy Transaction (not VersionedTransaction). Use Transaction.from() to deserialize, not VersionedTransaction.deserialize().

Collect creator fees examples

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

const res = await fetch('https://plugy.fun/api/trade', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    publicKey: "YOUR_WALLET_PUBLIC_KEY",
    action: "collectCreatorFee",
    priorityFee: 0.0001,
  })
});

const data = await res.json();
// Check what's pending before signing:
console.log(`Bonding curve: ${data.pendingBcSol} SOL`);
console.log(`PumpSwap AMM:  ${data.pendingAmmSol} SOL`);
console.log(`Total:         ${data.totalPendingSol} SOL`);

// Creator fee TX is a legacy Transaction (not VersionedTransaction)
const tx = Transaction.from(Buffer.from(data.transaction, 'base64'));
const keypair = Keypair.fromSecretKey(bs58.decode('YOUR_PRIVATE_KEY'));
tx.sign(keypair);

const connection = new Connection('YOUR_RPC_ENDPOINT');
const sig = await connection.sendRawTransaction(tx.serialize());
console.log(`https://solscan.io/tx/${sig}`);

▸ Fee Sharing (Creator Fee Distribution)

NEW

After launching a token on pump.fun, the creator can configure how trading fees are distributed across multiple wallets. This endpoint returns unsigned transactions — sign locally, submit through your own RPC.

1. Create

Initialize fee sharing. You become admin and sole shareholder (100%).

2. Update

Split fees across wallets. Shares in basis points (10000 bps = 100%).

3. Distribute

Send accumulated fees to all shareholders. Permissionless — anyone can trigger.

Additional actions: revokeFeeSharing (permanent lock),transferFeeSharingAuthority,resetFeeSharing,getFeeSharingConfig (read-only).

⚠ After createFeeSharing, that token's fees are routed to a new vault. Use distributeFees instead of collectCreatorFee for fee-sharing tokens.

POSThttps://plugy.fun/api/fee-sharing

Returns unsigned transactions (base64) for fee sharing management · No authentication required · Program: pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ

ParameterTypeReqDescription
publicKeystringYour wallet public key (token creator or fee sharing admin)
actionstring"createFeeSharing" | "updateFeeShares" | "revokeFeeSharing" | "transferFeeSharingAuthority" | "resetFeeSharing" | "distributeFees" | "getFeeSharingConfig"
mintstringToken mint address
priorityFeenumberPriority fee in SOL (default 0.0001)
shareholdersarrayRequired for updateFeeShares — array of { address, shareBps }. Must sum to 10000 bps (100%)
newAdminstringRequired for transferFeeSharingAuthority and resetFeeSharing — new admin wallet address
200createFeeSharing
{
  "success": true,
  "action": "createFeeSharing",
  "transaction": "base64...",
  "message": "Sign to create
fee sharing config..."
}
200updateFeeShares
{
  "success": true,
  "action": "updateFeeShares",
  "transaction": "base64...",
  "shareholders": [
    { "address": "...", "shareBps": 6000 },
    { "address": "...", "shareBps": 4000 }
  ]
}
200distributeFees
{
  "success": true,
  "action": "distributeFees",
  "transaction": "base64...",
  "pendingBcSol": 0.123456,
  "numShareholders": 3
}
200getFeeSharingConfig
{
  "success": true,
  "action": "getFeeSharingConfig",
  "exists": true,
  "status": "Active",
  "admin": "AdminWallet...",
  "adminRevoked": false,
  "shareholders": [
    { "address": "...", "shareBps": 10000 }
  ]
}
200revokeFeeSharing
{
  "success": true,
  "action": "revokeFeeSharing",
  "transaction": "base64...",
  "message": "⚠️ PERMANENTLY
locks the config"
}
200transferAuthority / reset
{
  "success": true,
  "action": "transferFeeSharingAuthority",
  "transaction": "base64...",
  "newAdmin": "NewWallet..."
}

Create fee sharing

const res = await fetch('https://plugy.fun/api/fee-sharing', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    publicKey: "YOUR_WALLET_PUBLIC_KEY",
    action: "createFeeSharing",
    mint: "TOKEN_MINT_ADDRESS",
    priorityFee: 0.0001
  })
});

const { transaction, message } = await res.json();

// Sign & send like any other unsigned TX
const tx = VersionedTransaction.deserialize(Buffer.from(transaction, 'base64'));
const keypair = Keypair.fromSecretKey(bs58.decode('YOUR_PRIVATE_KEY'));
tx.sign([keypair]);

const connection = new Connection('YOUR_RPC_ENDPOINT');
const sig = await connection.sendRawTransaction(tx.serialize());
console.log(`https://solscan.io/tx/${sig}`);

Update fee shares

const res = await fetch('https://plugy.fun/api/fee-sharing', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    publicKey: "YOUR_WALLET_PUBLIC_KEY",
    action: "updateFeeShares",
    mint: "TOKEN_MINT_ADDRESS",
    shareholders: [
      { address: "Wallet1PublicKey", shareBps: 6000 },
      { address: "Wallet2PublicKey", shareBps: 4000 }
    ]
  })
});
const { transaction } = await res.json();
// Sign & send as usual...

Distribute fees (permissionless)

const res = await fetch('https://plugy.fun/api/fee-sharing', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    publicKey: "ANY_WALLET_PUBLIC_KEY",
    action: "distributeFees",
    mint: "TOKEN_MINT_ADDRESS",
    priorityFee: 0.0001
  })
});

const data = await res.json();
console.log(`Pending: ${data.pendingBcSol} SOL for ${data.numShareholders} shareholders`);
// Sign & send as usual...

Other fee sharing actions

# ⚠️ IRREVERSIBLE — permanently locks the config
curl -X POST https://plugy.fun/api/fee-sharing \
  -H "Content-Type: application/json" \
  -d '{
    "publicKey": "YOUR_WALLET_PUBLIC_KEY",
    "action": "revokeFeeSharing",
    "mint": "TOKEN_MINT_ADDRESS"
  }'