Public API

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!):

bash
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).

POSThttps://muuulti.fun/api/swap

Request Body

ParameterTypeRequiredDescription
fromstringYesToken mint address to swap from
tostringYesToken mint address to swap to
amountnumberYesAmount to swap (in token decimals, or use "auto"/"50%")
slippagenumberYesSlippage tolerance in basis points (e.g., 100 = 1%)
payerstringYesWallet address that will sign and pay for the transaction
priorityFeenumber | stringNoPriority fee in lamports, or "auto" (default: auto)

Response

json
{
  "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 send
  • rate.amountIn - Input amount in smallest units (lamports/token decimals)
  • rate.amountOut - Expected output amount
  • rate.minAmountOut - Minimum output after slippage
  • rate.price - Execution price
  • rate.priceImpact - Price impact percentage
  • rate.platformFee - Platform fee in smallest units
How the fee works: The 0.5% platform fee is automatically included in the transaction. For SOL→Token swaps, the fee is deducted from your SOL input. For Token→SOL swaps, the fee is added to the output calculation.

Examples

Buy a Token with SOL

Swap SOL for any SPL token:

javascript
// 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:

javascript
// 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):

bash
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

python
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 key

Common Token Addresses

SOLSo11111111111111111111111111111111111111112
MULTI2CUzSZWnSLwuUQea73M7GFDcsmrzKHZaRfuutk9Cpump
USDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
WIFEKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm

Error Handling

The API uses standard HTTP response codes to indicate success or failure.

Status CodeDescription
200Success - Transaction created
400Bad Request - Missing or invalid parameters
500Server Error - Internal error or upstream API failure

Error Response Format

json
{
  "error": "Missing required parameters",
  "required": ["from", "to", "amount", "slippage", "payer"]
}

Common Errors

Missing required parameters

One or more required fields are missing from the request body.

Swap failed

The underlying swap router couldn't find a valid route. This usually happens with very low liquidity tokens or invalid token addresses.

Insufficient liquidity

Not enough liquidity in the pools to execute the swap at the requested size.

Tip: Always wrap your API calls in try/catch and handle errors gracefully. Check for both HTTP errors and application-level errors in the response body.

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

bash
npm install @solana/web3.js @solana/spl-token bs58

Configuration

Set up your configuration with your wallet and token details:

javascript
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

1
Set your private key

Use environment variable for security:

bash
export PRIVATE_KEY="your_base58_private_key"
2
Update token address

Set your token's contract address in the CONFIG

3
Run the script
bash
node creator-buy-burn.js

How It Works

  1. Monitors your wallet balance every 2 minutes
  2. When balance β‰₯ 0.05 SOL, starts the sequence
  3. Claims all available creator fees from pump.fun
  4. Calculates buy amount based on burn percentage setting
  5. Buys your token using Multi's swap API
  6. Burns all purchased tokens immediately
  7. Keeps 0.05 SOL reserve for future gas fees

Full ScriptπŸ“₯ Download Full Script

Example Output

bash
[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...
Security Tips: Never commit your private key to git. Use environment variables or a secure key management system. Run this script on a secure server with limited access.
πŸ“¦ Get the Full Script:
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!

Volume Bot - Claim pump.fun fees β†’ Buy β†’ Burn (auto flywheel)
Snipe Bot - Fast token sniping on launch
DCA Script - Dollar cost averaging automation
Arbitrage Scanner - Cross-DEX opportunity detection
Portfolio Rebalancer - Automated portfolio management

ToolsComing Soon

Developer Tools

Utilities and SDKs for building on Multi

JavaScript SDK - Full-featured client library
Python SDK - Python bindings for the API
CLI Tool - Command-line interface for swaps
Webhook Integration - Real-time trade notifications
Analytics Dashboard - Track your API usage