Confirmed.wtf Solana AMM SDK

TL;DR: - Quick Start

A professional Automated Market Maker (AMM) SDK for Solana, leveraging Jito's infrastructure for optimal performance and efficiency. This SDK simplifies complex volume generation and maker creation processes into an easy-to-use interface.

For support, join our Discord.

Why Use This SDK?

Traditional AMM interaction code on Solana can be complex and difficult to understand. Our SDK addresses this by providing:

  • Simplified Integration: Easy-to-use API for complex operations
  • High Performance: Leverages Jito bundles for optimal execution
  • Multiple Protocol Support: Works with major Solana AMM protocols
  • Production Ready: Battle-tested implementation

Supported Protocols

  • Raydium
  • Orca
  • Meteora
  • Pump.fun
  • Moonshot

Key Features

  • Bundle Management: Efficient creation and handling of Jito bundles
  • High-Frequency Trading: Execute thousands of transactions per minute
  • Unique Wallet Generation: Each transaction comes from a distinct wallet
  • Flexible Configuration: Customize trading parameters for your needs

Getting Started

This section will guide you through the process of setting up and using the Confirmed.wtf Solana AMM SDK.

Overview

Before diving into the technical details, make sure you have:

  • A linux server or local machine
  • Basic understanding of Solana
  • Ability to copy & paste

Lets get started:

Quick Start

This guide will help you get started with the Solana AMM SDK.

Prerequisites

  1. Update your package list:

    sudo apt-get update
    
  2. Install Node.js and npm:

    sudo apt-get install -y nodejs npm
    
    • Verify installation by running: node --version and npm --version
  3. Install Git:

    sudo apt-get install -y git
    
    • Verify installation by running: git --version

Setup

  1. Choose your installation method:

    Option A - Install via npm (Recommended):

    # Create a new directory and initialize
    mkdir my-amm-project
    cd my-amm-project
    npm init -y
    
    # Install the SDK
    npm install @confirmedwtf/solana-amm-sdk
    

    Option B - Clone the repository:

    git clone https://github.com/confirmedwtf/solana-amm-sdk
    cd solana-amm-sdk
    npm install
    
  2. Create test file:

    • If you installed via npm, create a new test.mjs file
    • If you cloned the repository, the test file is already included

    You can copy our example test file from: https://github.com/confirmedwtf/solana-amm-sdk/blob/main/test.mjs

  3. Get a Solana RPC URL:

    • Sign up at one of these providers:
    • Create a new Solana endpoint
    • Copy your RPC URL (it will look like: https://your-endpoint.network.quiknode.pro/abc123...)
  4. Edit test.mjs using nano

    nano test.mjs
    

    Before editing, ensure you have the following ready:

    • RPC URL: Your Solana RPC endpoint URL
    • Token Mint Address: The address of your token's mint on Solana
    • Private Key: Your wallet's private key (keep it secure)

    Update the necessary settings in the test.mjs file with your RPC URL, Token Mint address, and private key.

    To save and exit nano, follow these steps:

    • Press Ctrl + X to begin the exit process.
    • Press Y to confirm that you want to save the changes.
    • Press Enter to write the changes to the file and exit nano.
  5. Run the app:

    node test.mjs
    
    • This command will start the application using the settings you configured in test.mjs.
  6. Stop the app:

    • To stop the application, press Ctrl + C in the terminal where the app is running.

Configuration Tips

  • RPC URL: Use a reliable provider to avoid connection issues
  • Token Mint: This is your token's address on Solana (can be found on Solscan/Explorer)
  • Makers Count:
    • Start with a smaller number (e.g., 1000) to test
    • Increase up to 5000+ for more market activity
  • Volume Settings:
    • mCapFactor: 0 = neutral, 1 = moderate increase, 2+ = stronger increase
      • mCapFactor of 0 is neutral, meaning the price will not change
      • mCapFactor of 1 is price positive, meaning you will not sell all of the tokens you are buying while generating volume
    • speedFactor: This controls the delay between swaps. The average delay in seconds is calculated as (5000 + 10000/2) / 1000 / speedFactor. For example:
      • speedFactor of 1 results in an average delay of 10 seconds between swaps
      • speedFactor of 10 results in an average delay of 1 second between swaps
      • For a swap every minute, set speedFactor to approximately 0.167
      • For a swap every 5 minutes, set speedFactor to approximately 0.033
      • For a swap every 10 minutes, set speedFactor to approximately 0.017
    • minSolPerSwap and maxSolPerSwap: Start small (0.005-0.006) and adjust based on your needs
  • Jito Tip: Set to 10001 to prioritize your transaction
  • Private Key: Support for both base 58 string format and byte array format

Important Notes

  • Ensure you have enough SOL in your wallet (at least 0.03 SOL recommended)
  • If transactions are not landing, try increasing the jito tip (defaults to 10000 lamports if not specified)
  • Never share or commit your private keys
  • Monitor your RPC usage to stay within provider limits

Examples

Here are some examples of how to use the Solana AMM SDK. Ready to copy and paste!

Example 1: Generate only makers

import { Connection, Keypair, PublicKey } from "@solana/web3.js"
import { Amm } from "@confirmedwtf/solana-amm-sdk"

// Replace with your RPC URL from QuickNode/Shyft/etc
const connection = new Connection("https://your-endpoint.network.quiknode.pro/abc123...")
// If you need a RPC URL, you can contact us on https://discord.gg/confirmedwtf for a free one

// Replace with your token's mint address
const mint = new PublicKey("YOUR_TOKEN_MINT")

// Add your wallet's private key (choose one method):
// Method 1: Using Phantom/wallet private key
const payerWallet = Keypair.fromSecretKey(bs58.decode("4wBqpZM9...your-private-key..."))

// Method 2: Using array format
// const payerWallet = Keypair.fromSecretKey(Uint8Array.from([123,456...]))

// Optional: Disable console logs
const amm = new Amm(connection, payerWallet, { disableLogs: true })

// Create makers only - using Raydium DEX specifically
await amm.makers(mint, 5000, {
    includeDexes: ["Raydium"], 
    jitoTipLamports: 100000
}) 

Example 2: Generate volume only

import { Connection, Keypair, PublicKey } from "@solana/web3.js"
import { Amm } from "@confirmedwtf/solana-amm-sdk"

const connection = new Connection("https://your-endpoint.network.quiknode.pro/abc123...")
const mint = new PublicKey("YOUR_TOKEN_MINT")
const payerWallet = Keypair.fromSecretKey(bs58.decode("4wBqpZM9...your-private-key..."))

// Initialize AMM with logs disabled (optional)
const amm = new Amm(connection, payerWallet, { disableLogs: true })

// Generate volume only
const minSolPerSwap = 0.001 // sol per swap
const maxSolPerSwap = 0.002 // sol per swap
const mCapFactor = 1    // higher = price increases
const speedFactor = 1   // controls trading frequency

// Generate volume using only Raydium DEX
await amm.volume(
    mint, 
    minSolPerSwap, 
    maxSolPerSwap, 
    mCapFactor, 
    speedFactor, 
    {
        includeDexes: ["Raydium"],
        jitoTipLamports: 100000
    }
)

Example 3: Single Swap

import { Connection, Keypair, PublicKey } from "@solana/web3.js"
import { Amm } from "@confirmedwtf/solana-amm-sdk"

const connection = new Connection("https://your-endpoint.network.quiknode.pro/abc123...")
const mint = new PublicKey("YOUR_TOKEN_MINT")
const payerWallet = Keypair.fromSecretKey(bs58.decode("4wBqpZM9...your-private-key..."))

const amm = new Amm(connection, payerWallet)

// Perform a single buy swap for 0.001 SOL
const swap = await amm.swap(
    mint, 
    "buy", 
    0.001, 
    {
        jitoTipLamports: 100000
    }
)

Example 4: Combined Makers and Volume

import { Connection, Keypair, PublicKey } from "@solana/web3.js"
import { Amm } from "@confirmedwtf/solana-amm-sdk"

const connection = new Connection("https://your-endpoint.network.quiknode.pro/abc123...")
const mint = new PublicKey("YOUR_TOKEN_MINT")
const payerWallet = Keypair.fromSecretKey(bs58.decode("4wBqpZM9...your-private-key..."))

const amm = new Amm(connection, payerWallet, { disableLogs: true })

// Configuration for volume
const minSolPerSwap = 0.001
const maxSolPerSwap = 0.002
const mCapFactor = 1
const speedFactor = 1

// Create makers and generate volume in parallel using Raydium
await Promise.all([
    amm.makers(mint, 5000, { 
        includeDexes: ["Raydium"], 
        jitoTipLamports: 100000 
    }),
    amm.volume(
        mint, 
        minSolPerSwap, 
        maxSolPerSwap, 
        mCapFactor, 
        speedFactor, 
        { 
            includeDexes: ["Raydium"], 
            jitoTipLamports: 100000 
        }
    )
])

Configuration Options

  • disableLogs: Set to true to disable console logs
  • includeDexes: Array of DEX names to use (e.g., ["Raydium"])
  • jitoTipLamports: Transaction priority fee (recommended: 100000)
  • mCapFactor: Controls price direction (0 = neutral, 1+ = increase)
  • speedFactor: Controls trading frequency
  • Supported DEXes: "Raydium", "Orca", "Meteora", "Pump.fun", "Moonshot"

Fees

The Solana AMM SDK has a simple fee structure, but there are additional fees to consider when generating volume.

Solana AMM SDK Fees

Maker Fees

  • Bundle Fee: 40,000 lamports per bundle (4 makers)
  • Transaction Cost: 20,000 lamports per maker bundle

Example costs for different maker quantities:

  • 1,000 makers: ~0.015 SOL
  • 10,000 makers: ~0.15 SOL
  • 100,000 makers: ~1.5 SOL
  • 1,000,000 makers: ~15 SOL

Volume Fees

  • Volume Fee: 0.05% of total volume generated + 12,500 lamports per tx.

Example costs for different volume amounts:

  • 10,000 SOL volume: 5 USD fee
  • 100,000 SOL volume: 50 USD fee
  • 1,000,000 SOL volume: 500 USD fee

Additional Fees to Consider

When generating volume, you will also need to account for:

  • Liquidity Pool Fees: These vary by provider
    • Raydium pools: 0.25% per swap
    • Meteora dynamic pools: Variable fees (can be higher than 0.25%)

Always check the specific fees for the liquidity pool you are using before generating volume, as these fees will impact your total costs.

Configuration Options

This document details all available configuration options for the Confirmed.wtf Solana AMM SDK.

Core Options

AMM Initialization

const amm = new Amm(connection, payerWallet, {
    disableLogs: true  // Optional: disable console logging
})

Transaction Options

  • jitoTipLamports: Transaction priority fee (default: 10000)
    • Recommended: 100000 for higher priority
    • Increase if transactions are not landing

DEX Selection

Supported DEXes

You can specify which DEXes to use via the includeDexes option. Supported values:

const supportedDexes = [
    "Cropper",
    "Raydium",
    "Openbook",
    "StabbleWeightedSwap",
    "Guacswap",
    "OpenBookV2",
    "Aldrin",
    "MeteoraDLMM",
    "Saber(Decimals)",
    "SanctumInfinity",
    "Whirlpool",
    "StepN",
    "Dexlab",
    "RaydiumCP",
    "Mercurial",
    "LifinityV2",
    "ObricV2",
    "Meteora",
    "Phoenix",
    "TokenSwap",
    "HeliumNetwork",
    "Sanctum",
    "Moonshot",
    "StabbleStableSwap",
    "GooseFX",
    "Penguin",
    "AldrinV2",
    "OrcaV2",
    "LifinityV1",
    "1DEX",
    "CropperLegacy",
    "SolFi",
    "Oasis",
    "Saber",
    "Crema",
    "Pump.fun",
    "RaydiumCLMM",
    "Bonkswap",
    "Perps",
    "Fox",
    "Saros",
    "OrcaV1",
    "FluxBeam",
    "Invariant"
]

Usage example:

await amm.volume(mint, minSolPerSwap, maxSolPerSwap, mCapFactor, speedFactor, {
    includeDexes: ["Raydium", "Orca", "Meteora"],
    jitoTipLamports: 100000
})

Volume Generation Options

mCapFactor

Controls price direction:

  • 0: Neutral (no price change)
  • 1: Moderate increase
  • 2+: Stronger increase

speedFactor

Controls trading frequency. The average delay between swaps is calculated as:

(5000 + 10000/2) / 1000 / speedFactor seconds

Common settings:

  • 1: ~10 seconds between swaps
  • 10: ~1 second between swaps
  • 0.167: ~1 minute between swaps
  • 0.033: ~5 minutes between swaps
  • 0.017: ~10 minutes between swaps

Swap Amounts

  • minSolPerSwap: Minimum SOL per swap
  • maxSolPerSwap: Maximum SOL per swap

Maker Generation Options

Number of Makers

await amm.makers(mint, 5000, {  // 5000 makers
    includeDexes: ["Raydium"],
    jitoTipLamports: 100000
})

Recommended ranges:

  • Testing: 1,000 makers
  • Production: 5,000+ makers

Private Key Formats

The SDK supports two private key formats:

  1. Base58 String (e.g., from Phantom):
const payerWallet = Keypair.fromSecretKey(bs58.decode("your-base58-private-key"))
  1. Byte Array:
const payerWallet = Keypair.fromSecretKey(Uint8Array.from([1,2,3...]))