Pool Interaction

The Fair Launch mechanism in the GoFundMeme Protocol enables decentralized, transparent, and community-driven token launches. This system ensures equitable access to presale allocations while dynamically adjusting fundraising based on demand.

With the GoFundMeme SDK, you can seamlessly: βœ… Fetch Fair Launch pool details βœ… Fund or defund a pool βœ… Claim presale allocations βœ… Claim preallocations (marketing, team, etc.) βœ… Harvest LP fees and rewards


Fetching a Fair Launch Pool

To interact with a Fair Launch pool, you must first fetch its data using the mint address of the token being launched.

import { Connection, PublicKey } from "@solana/web3.js";
import { initGoFundMemeSDK } from "@gofundmeme/sdk";

const connection = new Connection("https://api.mainnet-beta.solana.com");

(async () => {
  const gfmSDK = await initGoFundMemeSDK({ connection });

  // Replace with your token mint address
  const mintAddress = new PublicKey("THE TOKEN MINT ADDRESS");

  // Fetch the Fair Launch Pool
  const pool = await gfmSDK.pools.fairLaunch.fetchFairLaunchPool({
    mintB: mintAddress,
  });

  console.log("Fair Launch Pool Data:", pool);
})();

πŸ“Š Checking Pool Status

Once you've fetched the Fair Launch pool, you can check its status, expiration, and funding progress.


πŸ’° Funding the Pool

Participants can contribute SOL to the Fair Launch pool before it reaches its target.


πŸ’Έ Defunding (Withdrawing Contributions)

If the pool is still in the raising phase, participants can withdraw their contributions.


🎟️ Claiming Presale Allocations

After the Fair Launch concludes, contributors can claim their presale tokens.


🎯 Claiming Preallocation (Marketing, Team, etc.)

Some tokens are reserved for marketing, partnerships, or team allocations. These can be claimed separately.



🎁 Fetching Presaler Rewards Summary

Presale contributors can check their unclaimed LP rewards before claiming.

πŸ“Œ Example Response:


πŸ’Ž Claiming Presaler LP Rewards

Once rewards are available, contributors can claim them.


🏦 Fetching LP Fees & Harvester Rewards

Once the Fair Launch concludes, LP fees and harvester rewards can be tracked.

πŸ“Œ Example Response:

🌾 Harvesting LP Fees

LP fees collected in the pool can be harvested by authorized crankers.

Last updated