Multi Swap API
Execute token swaps on Solana with optimized routing. No API key required. Simple 0.5% fee on all swaps.
π‘ Endpoint
POST /api/swapπ° Fee
0.5% platform fee
π Auth
No API key required
β‘ Quick Start - Try it now!
Get a swap transaction (no API key needed!):
curl -X POST https://muuulti.fun/api/swap \
-H "Content-Type: application/json" \
-d '{
"from": "So11111111111111111111111111111111111111112",
"to": "2CUzSZWnSLwuUQea73M7GFDcsmrzKHZaRfuutk9Cpump",
"amount": 0.01,
"slippage": 100,
"payer": "YOUR_WALLET_ADDRESS"
}'β οΈ This returns an unsigned transaction. You'll need to sign it with your private key and submit it to execute the swap (0.01 SOL β MULTI).
https://muuulti.fun/api/swapRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Token mint address to swap from |
to | string | Yes | Token mint address to swap to |
amount | number | Yes | Amount to swap (in token decimals, or use "auto"/"50%") |
slippage | number | Yes | Slippage tolerance in basis points (e.g., 100 = 1%) |
payer | string | Yes | Wallet address that will sign and pay for the transaction |
priorityFee | number | string | No | Priority fee in lamports, or "auto" (default: auto) |
Response
{
"success": true,
"transaction": "BASE64_ENCODED_VERSIONED_TRANSACTION",
"rate": {
"amountIn": 100000000,
"amountOut": 5423891234,
"minAmountOut": 5369652322,
"price": 54.24,
"priceImpact": 0.001,
"platformFee": 500000
},
"type": "v0"
}Response Fields
transaction- Base64 encoded versioned transaction ready to sign and sendrate.amountIn- Input amount in smallest units (lamports/token decimals)rate.amountOut- Expected output amountrate.minAmountOut- Minimum output after slippagerate.price- Execution pricerate.priceImpact- Price impact percentagerate.platformFee- Platform fee in smallest units
Examples
Buy a Token with SOL
Swap SOL for any SPL token:
// Buy MULTI with 0.1 SOL
const response = await fetch('https://muuulti.fun/api/swap', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
from: 'So11111111111111111111111111111111111111112', // SOL
to: '2CUzSZWnSLwuUQea73M7GFDcsmrzKHZaRfuutk9Cpump', // MULTI
amount: 0.1, // 0.1 SOL
slippage: 100, // 1% slippage
payer: walletAddress
})
});
const { transaction } = await response.json();
// Sign and send the transaction (requires your private key)
const txBuffer = Buffer.from(transaction, 'base64');
const versionedTx = VersionedTransaction.deserialize(txBuffer);
versionedTx.sign([wallet]);
const signature = await connection.sendRawTransaction(
versionedTx.serialize()
);Sell a Token for SOL
Swap any SPL token back to SOL:
// Sell 1,000 MULTI for SOL
const response = await fetch('https://muuulti.fun/api/swap', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
from: '2CUzSZWnSLwuUQea73M7GFDcsmrzKHZaRfuutk9Cpump', // MULTI
to: 'So11111111111111111111111111111111111111112', // SOL
amount: 1000, // 1000 MULTI
slippage: 100, // 1% slippage
payer: walletAddress
})
});
const { transaction, rate } = await response.json();
console.log('Expected output:', rate.amountOut / 1e9, 'SOL');
console.log('Min output:', rate.minAmountOut / 1e9, 'SOL');
// Remember: You need to sign this transaction with your private key!cURL Example
Get a quote from your terminal (returns unsigned transaction):
curl -X POST https://muuulti.fun/api/swap \
-H "Content-Type: application/json" \
-d '{
"from": "So11111111111111111111111111111111111111112",
"to": "2CUzSZWnSLwuUQea73M7GFDcsmrzKHZaRfuutk9Cpump",
"amount": 0.1,
"slippage": 100,
"payer": "YOUR_WALLET_ADDRESS"
}'Python Example
import requests
# Get unsigned transaction to swap 0.05 SOL for MULTI
response = requests.post(
'https://muuulti.fun/api/swap',
json={
'from': 'So11111111111111111111111111111111111111112', # SOL
'to': '2CUzSZWnSLwuUQea73M7GFDcsmrzKHZaRfuutk9Cpump', # MULTI
'amount': 0.05,
'slippage': 100, # 1%
'payer': 'YOUR_WALLET_ADDRESS'
}
)
data = response.json()
print(f"Transaction ready: {data['success']}")
print(f"Expected MULTI output: {data['rate']['amountOut']}")
print(f"Platform fee: {data['rate']['platformFee'] / 1e9} SOL")
# Note: You'll need to sign this transaction with your wallet's private keyCommon Token Addresses
So111111111111111111111111111111111111111122CUzSZWnSLwuUQea73M7GFDcsmrzKHZaRfuutk9CpumpEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYBEKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjmError Handling
The API uses standard HTTP response codes to indicate success or failure.
| Status Code | Description |
|---|---|
200 | Success - Transaction created |
400 | Bad Request - Missing or invalid parameters |
500 | Server Error - Internal error or upstream API failure |
Error Response Format
{
"error": "Missing required parameters",
"required": ["from", "to", "amount", "slippage", "payer"]
}Common Errors
One or more required fields are missing from the request body.
The underlying swap router couldn't find a valid route. This usually happens with very low liquidity tokens or invalid token addresses.
Not enough liquidity in the pools to execute the swap at the requested size.
Creator Buy & Burn Script
Automated script that claims pump.fun creator fees and uses them to buy and burn your token. Creates continuous buy pressure and reduces token supply automatically.
π Auto Claims
Claims pump.fun fees every 2 minutes
π° Auto Buys
Buys your token with claimed fees
π₯ Auto Burns
Burns tokens to reduce supply
Installation
npm install @solana/web3.js @solana/spl-token bs58Configuration
Set up your configuration with your wallet and token details:
const CONFIG = {
// Your wallet's private key (Base58 format)
PRIVATE_KEY: process.env.PRIVATE_KEY || 'YOUR_PRIVATE_KEY_HERE',
// The token you want to buy and burn
TOKEN_ADDRESS: 'YOUR_TOKEN_ADDRESS_HERE',
// What percentage of fees to burn (10, 50, or 100)
BURN_PERCENTAGE: 100,
// Minimum balance to trigger (in SOL)
MIN_BALANCE_TO_TRIGGER: 0.05,
// Reserve amount to keep in wallet (in SOL)
RESERVE_SOL: 0.05,
// How often to check (in minutes)
CHECK_INTERVAL_MINUTES: 2,
// Slippage tolerance (500 = 5%)
SLIPPAGE: 500
};Usage
Use environment variable for security:
export PRIVATE_KEY="your_base58_private_key"Set your token's contract address in the CONFIG
node creator-buy-burn.jsHow It Works
- Monitors your wallet balance every 2 minutes
- When balance β₯ 0.05 SOL, starts the sequence
- Claims all available creator fees from pump.fun
- Calculates buy amount based on burn percentage setting
- Buys your token using Multi's swap API
- Burns all purchased tokens immediately
- Keeps 0.05 SOL reserve for future gas fees
Full Scriptπ₯ Download Full Script
Example Output
[2024-12-31T12:00:00.000Z] β° Checking... Balance: 0.1234 SOL
[2024-12-31T12:00:00.000Z] β
Running sequence...
π Starting Claim-Buy-Burn Sequence
[2024-12-31T12:00:01.000Z] π³ Current balance: 0.1234 SOL
[2024-12-31T12:00:01.000Z] π₯ Claiming creator fees from pump.fun...
[2024-12-31T12:00:02.000Z] β
Claim tx: 2xNw3K9hFg7...
[2024-12-31T12:00:06.000Z] π³ Balance after claim: 0.5234 SOL (+0.4000 SOL)
[2024-12-31T12:00:07.000Z] π° Buying tokens with 0.4734 SOL...
[2024-12-31T12:00:09.000Z] β
Buy tx: 3yPx4L9...
[2024-12-31T12:00:13.000Z] π₯ Burning tokens...
[2024-12-31T12:00:14.000Z] β
Burn tx: 4zQy5M8...
[2024-12-31T12:00:15.000Z] β
Burned 1234567 tokens! π₯
β
Sequence complete!
[2024-12-31T12:00:15.000Z] β° Next check in 2 minutes...The complete production-ready script with all features is available at:
/scripts/claim-buy-burn.jsOr download directly: claim-buy-burn.js (17KB)ScriptsComing Soon
Trading Scripts
Pre-built scripts for common trading operations. No API keys needed!
ToolsComing Soon
Developer Tools
Utilities and SDKs for building on Multi