Subscriptions

πŸ“‘ Subscriptions API

The GoFundMeme SDK provides a WebSocket-based subscription system that allows real-time updates for Fair Launches, Bonding Curve swaps, Market Capitalization changes, Pool State updates, and more.

With gfmSDK.api.subscription, developers can efficiently listen to live events without polling.

πŸ”₯ Key Features

βœ”οΈ Real-Time Pool State Updates – Get notified when a pool’s status changes.

βœ”οΈ Live Market Cap Updates – Track the market cap of a token dynamically.

βœ”οΈ Bonding Curve Swaps – Receive buy/sell events in real-time.

βœ”οΈ Fair Launch Funding Events – Monitor funding and defunding actions.

βœ”οΈ New & Migrated Pools – Be alerted when a pool is created or migrated.

βœ”οΈ Seamless Disconnection – Easily unsubscribe when needed.

πŸ“œ How to Use Subscriptions

To start listening to real-time events, you can use the gfmSDK.api.subscription object and call one of the available listeners.

πŸš€ Quick Example

πŸ› οΈ Explanation:

1️⃣ Initialize the SDK with a Solana RPC connection.

2️⃣ Subscribe to a WebSocket event (gfmSDK.api.subscription.fairLaunch.funding.all).

3️⃣ Log incoming events in real time.

πŸ“‘ Available Subscription Methods


1️⃣ Pool State Updates

Listens for pool state changes, such as raising, launching, or launched.

Subscribe by Network

Subscribe by Mint Address

πŸ“Œ Event Type:


2️⃣ Market Cap Updates

Tracks market capitalization changes in real-time.

Subscribe by Network

Subscribe by Mint Address

πŸ“Œ Event Type:


3️⃣ Bonding Curve Swaps

Listens for buy and sell transactions on Bonding Curve pools.

Subscribe by Network

Subscribe by Mint Address

πŸ“Œ Event Type:


4️⃣ Fair Launch Funding Events

Tracks contributions (funding) and withdrawals (defunding) from Fair Launch pools.

Subscribe by Network

Subscribe by Mint Address

πŸ“Œ Event Type:


5️⃣ New & Migrated Pools

These subscriptions notify you when a pool is created or migrated.

New Pools (All Networks)

Migrated Pools (All Networks)

πŸ“Œ Event Type:


πŸ”Œ Unsubscribing & Disconnecting

You can unsubscribe from a specific subscription or disconnect from all WebSocket events.

Unsubscribe from a Specific Event

Disconnect from All Subscriptions


🎯 Final Summary

Subscription Type

Method

Pool State Updates

poolState.all(network), poolState.byMintAddress(mintAddress)

Market Cap Updates

marketcap.all(network), marketcap.byMintAddress(mintAddress)

Bonding Curve Swaps

bondingCurve.swaps.all(network), bondingCurve.swaps.byMintAddress(mintAddress)

Fair Launch Funding

fairLaunch.funding.all(network), fairLaunch.funding.byMintAddress(mintAddress)

New Pools

pool.newPools(network)

Migrated Pools

pool.migratedPools(network)

Unsubscribe

listener.disconnect()

Disconnect All

gfmSDK.api.subscription.disconnectAll()

πŸš€ Instant Updates – No need for manual polling!

⚑ Efficient WebSockets – Optimized real-time data streams.

πŸ”— Simple API – Easy to integrate, minimal effort required.

Last updated