GoFundMeme
  • GoFundMeme - Launch the next viral meme
  • FAQs
  • Getting Started
    • Referral Program
    • Reward System
    • Point System
    • Fees
  • GoFundMeme
    • Launch a Memecoin
      • Bonding Curve
        • Intro
      • Fair Launch
        • Tokenomics
        • Target Target
        • Boosters & Vesting
    • Harvest (LP LOCK)
      • How it works
      • Harvesting LP Fees
      • Claim Rewards
    • GFM Protocol
    • Defi x Memecoins
    • Staking
    • KYC Gating
    • SocialFi
      • Community Bubbles
  • Developers
    • GFM for Builders
    • Installation Guide
    • Init gfmSDK
    • GFM Methods
      • Bonding Curve
        • Pool Interaction
        • Pool Staking Network
      • Fair Launch
        • Pool Interaction
    • APIs
      • Create Pools
    • WebSockets
      • Subscriptions
Powered by GitBook
On this page
  • 🏗 Creating a Pool with the GoFundMeme SDK
  • Each method follows a two-step process:
  • 🔥 Key Features
  • 📌 How Bonding Curve Pools Work
  • 📜 Create a Bonding Curve Pool
  • 2️⃣ Sign & Process the Transaction
  • 📌 Bonding Curve Pool API Methods
  • 🚀 Fair Launch Pool Creation
  • 📌 How Fair Launch Pools Work
  • 📜 Create a Fair Launch Pool
  • 📌 Fair Launch Pool API Methods
  • 🔍 Comparison of Bonding Curve vs Fair Launch Pools
  • 🔌 Error Handling & Debugging
  • 🎯 Final Summary
  1. Developers
  2. APIs

Create Pools

🏗 Creating a Pool with the GoFundMeme SDK

The GoFundMeme SDK provides two main methods for creating pools:

• Bonding Curve Pools – Pools that use an automated market maker (AMM) for price discovery.

• Fair Launch Pools – A community-driven fundraising mechanism.

Each method follows a two-step process:

1. Request Pool Creation – Generates a transaction that the creator must sign.

2. Process Pool Creation – After signing, the transaction is submitted and finalized.

🔥 Key Features

✔️ Automated Market Making (for Bonding Curve Pools).

✔️ Community-Driven Fundraising (for Fair Launch Pools).

✔️ Built-in Tokenomics Validation – Prevents incorrect pool setups.

✔️ Decentralized Pool Ownership – Ensures fair and trustless execution.

✔️ Easy Integration – Only two simple API calls are needed.

🚀 Bonding Curve Pool Creation

📌 How Bonding Curve Pools Work

Bonding Curve Pools allow dynamic price discovery and automated liquidity provisioning without traditional order books. The token price increases as more SOL is contributed.

📜 Create a Bonding Curve Pool

To create a Bonding Curve Pool, follow these steps:

1️⃣ Request Pool Creation

import { gfmSDK, NETWORK } from "@gofundmeme/sdk";
import { Keypair } from "@solana/web3.js";

const creator = Keypair.generate(); // Replace with the actual creator Keypair

const payload = {
    token: {
        base64: "BASE64 (Image/Gif)",  // Base64 image of token logo
        name: "MyToken",
        symbol: "MTK",
        description: "A community-driven token",
        website: "https://mytoken.io",
        twitter: "https://twitter.com/mytoken",
        discord: "https://discord.gg/mytoken",
        telegram: "https://t.me/mytoken"
    },
    amountIn: 5, // Initial SOL to seed the pool
    network: NETWORK.MAINNET,
    creatorWalletAddress: creator.publicKey.toString(),
    supply: 1_000_000_000 // Total supply
};

(async () => {
    const createRequest = await gfmSDK.api.bondingCurve.createPool.request(payload);
    console.log("✍️ Sign the transaction:", createRequest.transaction);
})();

2️⃣ Sign & Process the Transaction

Once the transaction is created, it must be signed and submitted.

const response = await createRequest.signAndConfirm({ creator });
console.log("✅ Pool Created!", response);

✅ Successful Response

{
  "mintAddress": "5tsHhs3GpmYjSWXbczVj...",
  "txid": "4hgh8a87sdg76agsd67as8...",
  "pool": {
    ...
  }
}

📌 Bonding Curve Pool API Methods

Method

Description

gfmSDK.api.bondingCurve.createPool.request(payload)

Initiates the pool creation request.

createRequest.signAndConfirm({ creator })

Signs and submits the transaction.

gfmSDK.api.pools.bondingCurve.fetchBondingCurvePool({ mintB })

Fetches the pool details.

🚀 Fair Launch Pool Creation

📌 How Fair Launch Pools Work

Fair Launch Pools enable decentralized fundraising where contributors purchase allocations at a fixed price over a specified duration.

📜 Create a Fair Launch Pool

To create a Fair Launch Pool, follow these steps:

1️⃣ Request Pool Creation

import { gfmSDK, NETWORK } from "@gofundmeme/sdk";
import { Keypair } from "@solana/web3.js";

const creator = Keypair.generate(); // Replace with the actual creator Keypair

const payload = {
    token: {
        base64: "BASE64 (Image/Gif)",  // Base64 image of token logo
        name: "FairToken",
        symbol: "FAIR",
        description: "A fair and transparent launch",
        website: "https://fairtoken.io",
        twitter: "https://twitter.com/fairtoken",
        discord: "https://discord.gg/fairtoken",
        telegram: "https://t.me/fairtoken"
    },
    tokenomics: {
        supply: 1_000_000_000, // Total supply
        lpPercent: 40, // % for LP
        fundersPercent: 40, // % for funders
        allocations: [
            { name: "Marketing", percent: 10, destination: "3KgPZdBvh..." },
            { name: "Team", percent: 10, destination: "6KgQZzCvh..." }
        ]
    },
    campaignDurationHours: 3, // The campaign duration
    targetRaise: 30, // Target amount to raise in SOL
    amountIn: 10, // Initial SOL contribution
    network: NETWORK.MAINNET,
    creatorWalletAddress: creator.publicKey.toString()
};

(async () => {
    const createRequest = await gfmSDK.api.fairLaunch.createPool.request(payload);
    console.log("✍️ Sign the transaction:", createRequest.transaction);
})();

2️⃣ Sign & Process the Transaction

const response = await createRequest.signAndConfirm({ creator });
console.log("✅ Fair Launch Pool Created!", response);

✅ Successful Response

{
  "mintAddress": "9sHjdJkP6Yo...",
  "txid": "9jasdg67dsga7...",
  "pool": {
    ...
  }
}

📌 Fair Launch Pool API Methods

Method

Description

gfmSDK.api.fairLaunch.createPool.request(payload)

Initiates the pool creation request.

createRequest.signAndConfirm({ creator })

Signs and submits the transaction.

gfmSDK.api.pools.fairLaunch.fetchFairLaunchPool({ mintB })

Fetches the pool details.

🔍 Comparison of Bonding Curve vs Fair Launch Pools

Feature

Bonding Curve Pool

Fair Launch Pool

Price Mechanism

Dynamic price discovery

Fixed pricing

Fundraising Model

Continuous token issuance

Fixed sale period

Use Cases

AMM-style trading

Community-driven raises

Target Audience

Traders & Liquidity Providers

Investors & Communities

Timeframe

No expiration

Set campaign duration

🔌 Error Handling & Debugging

Here are some common errors and how to fix them:

Error

Solution

Token name too long (Up to 30 characters)

Shorten the token name.

Token symbol too long (Up to 8 characters)

Use a shorter symbol.

Supply must be between 10,000,000 and 1,000,000,000,000,000

Adjust token supply.

Amount in must be between 0 SOL - 70 SOL

Ensure SOL contribution is valid.

Total token allocation percent must equal 100%

Adjust allocations to sum to 100%.

Duration hours missing

Specify campaignDurationHours.

Incorrect signer

Ensure the correct Keypair is signing.

🎯 Final Summary

Pool Type

Method

Description

Bonding Curve

createPool.request(payload)

Starts pool creation

Bonding Curve

createRequest.signAndConfirm({ creator })

Signs & submits

Fair Launch

createPool.request(payload)

Starts pool creation

Fair Launch

createRequest.signAndConfirm({ creator })

Signs & submits

Fetching a Pool

fetchBondingCurvePool({ mintB })

Retrieves Bonding Curve details

Fetching a Pool

fetchFairLaunchPool({ mintB })

Retrieves Fair Launch details

PreviousAPIsNextWebSockets

Last updated 2 months ago