跳到正文
cccskills
免费在 GitHub 公开

pump-claims-readonly

Read-only query methods for PumpFun claims — unclaimed token rewards, creator vault balances, volume accumulators, distributable fees, and current-day token previews across Pump and PumpAMM programs.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md8.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

PumpFun Claims — Read-Only Queries

Query unclaimed rewards, creator vault balances, volume accumulators, and distributable fee status without submitting any transactions. All methods are read-only RPC calls on the OnlinePumpSdk class.

Overview

The Pump protocol has two claim domains:

DomainWhat is claimedWho claims
Token IncentivesPUMP governance tokens earned from trading volumeAny trader
Creator FeesSOL accumulated in creator vaults from coin creation feesCoin creators

Both domains span two on-chain programs — Pump (bonding curve) and PumpAMM (graduated pools). The BothPrograms variants aggregate across both.

Setup

import { Connection, PublicKey } from "@solana/web3.js";
import { OnlinePumpSdk } from "@nirholas/pump-sdk";

const connection = new Connection(process.env.SOLANA_RPC_URL!);
const sdk = new OnlinePumpSdk(connection);
const user = new PublicKey("...");

Token Incentive Queries

Unclaimed Token Rewards

Get the total unclaimed PUMP tokens for a user. This includes all finalized day epochs but excludes the current day's rewards.

// Single program (Pump bonding curve only)
const unclaimed: BN = await sdk.getTotalUnclaimedTokens(user);

// Both programs (Pump + PumpAMM) — recommended
const unclaimedTotal: BN = await sdk.getTotalUnclaimedTokensBothPrograms(user);

How it works: Fetches GlobalVolumeAccumulator and UserVolumeAccumulator accounts, then computes rewards using the pure function totalUnclaimedTokens() from tokenIncentives.ts.

Current Day Token Preview

Preview how many PUMP tokens the user would earn from the current (in-progress) day. This is a projection — the day hasn't finalized yet.

// Single program
const todayTokens: BN = await sdk.getCurrentDayTokens(user);

// Both programs — recommended
const todayTokensTotal: BN = await sdk.getCurrentDayTokensBothPrograms(user);

Important: Returns BN(0) if the user hasn't synced during the current day. Call syncUserVolumeAccumulator first for an accurate preview.

Volume Accumulator Stats

Fetch aggregate stats showing claimed, unclaimed, and current volume across both programs.

const stats: UserVolumeAccumulatorTotalStats =
  await sdk.fetchUserVolumeAccumulatorTotalStats(user);

// stats.totalUnclaimedTokens — BN, finalized unclaimed PUMP tokens
// stats.totalClaimedTokens   — BN, lifetime claimed PUMP tokens
// stats.currentSolVolume     — BN, SOL volume in current epoch

Return type:

interface UserVolumeAccumulatorTotalStats {
  totalUnclaimedTokens: BN;
  totalClaimedTokens: BN;
  currentSolVolume: BN;
}

Raw Volume Accumulators

For lower-level access, fetch the on-chain accounts directly:

// Global config (start/end times, daily supply, daily volumes)
const global: GlobalVolumeAccumulator =
  await sdk.fetchGlobalVolumeAccumulator();

// Per-user accumulator (returns null if account doesn't exist)
const userAcc: UserVolumeAccumulator | null =
  await sdk.fetchUserVolumeAccumulator(user);

Account structures:

interface GlobalVolumeAccumulator {
  startTime: BN;
  endTime: BN;
  secondsInADay: BN;        // typically 86400
  mint: PublicKey;           // PUMP token mint
  totalTokenSupply: BN[];   // tokens available per day
  solVolumes: BN[];         // total SOL volume per day
}

interface UserVolumeAccumulator {
  user: PublicKey;
  needsClaim: boolean;
  totalUnclaimedTokens: BN;
  totalClaimedTokens: BN;
  currentSolVolume: BN;
  lastUpdateTimestamp: BN;
}

Pure Computation Functions

If you already hold the account data, compute rewards offline without RPC:

import { totalUnclaimedTokens, currentDayTokens } from "@nirholas/pump-sdk";

const unclaimed: BN = totalUnclaimedTokens(globalAcc, userAcc);
const today: BN = currentDayTokens(globalAcc, userAcc);

// Optional: pass a custom timestamp for testing
const unclaimed2 = totalUnclaimedTokens(globalAcc, userAcc, 1700000000);

Creator Fee Queries

Creator Vault Balance

Check how much SOL is sitting in a creator's fee vault, ready to be collected.

// Single program (Pump bonding curve vault only)
const balance: BN = await sdk.getCreatorVaultBalance(creator);

// Both programs (Pump + PumpAMM vaults) — recommended
const totalBalance: BN = await sdk.getCreatorVaultBalanceBothPrograms(creator);

Note: getCreatorVaultBalance subtracts the rent-exemption minimum — it returns only the withdrawable amount.

Minimum Distributable Fee

Check whether a token's fee-sharing configuration has enough accumulated fees to distribute, and the minimum threshold required.

const result: MinimumDistributableFeeResult =
  await sdk.getMinimumDistributableFee(mint);

// result.minimumRequired    — BN, minimum SOL needed to distribute
// result.distributableFees  — BN, current accumulated fees
// result.canDistribute      — boolean, true if fees >= minimum
// result.isGraduated        — boolean, true if token migrated to AMM

How it works: Simulates a transaction to read the return data from the on-chain program. For graduated tokens, it also simulates consolidating AMM vault fees before checking the threshold.

Return type:

interface MinimumDistributableFeeResult {
  minimumRequired: BN;
  distributableFees: BN;
  canDistribute: boolean;
  isGraduated: boolean;
}

PDA Addresses

The relevant PDAs for claim-related accounts:

import {
  userVolumeAccumulatorPda,
  creatorVaultPda,
  feeSharingConfigPda,
  GLOBAL_VOLUME_ACCUMULATOR_PDA,
} from "@nirholas/pump-sdk";

const userVolumePda = userVolumeAccumulatorPda(user);
const vaultPda = creatorVaultPda(creator);
const sharingPda = feeSharingConfigPda(mint);

Quick Reference

MethodReturnsPrograms
getTotalUnclaimedTokens(user)BNPump only
getTotalUnclaimedTokensBothPrograms(user)BNPump + AMM
getCurrentDayTokens(user)BNPump only
getCurrentDayTokensBothPrograms(user)BNPump + AMM
fetchUserVolumeAccumulatorTotalStats(user)UserVolumeAccumulatorTotalStatsPump + AMM
fetchGlobalVolumeAccumulator()GlobalVolumeAccumulatorPump
fetchUserVolumeAccumulator(user)UserVolumeAccumulator | nullPump
getCreatorVaultBalance(creator)BNPump only
getCreatorVaultBalanceBothPrograms(creator)BNPump + AMM
getMinimumDistributableFee(mint)MinimumDistributableFeeResultPump + AMM

Edge Cases

ScenarioBehavior
User has no volume accumulator accountfetchUserVolumeAccumulator returns null; unclaimed methods return BN(0)
Creator vault doesn't existgetCreatorVaultBalance returns BN(0)
Sharing config not found for mintgetMinimumDistributableFee throws Error
User hasn't synced current daygetCurrentDayTokens returns BN(0)
Global volume is zero for a dayNo tokens distributed (division-by-zero guarded)
Token not yet graduatedisGraduated is false; only bonding curve vault checked

Patterns to Follow

  • Always use BothPrograms variants unless you specifically need single-program data
  • All return values are BN (bn.js) — never convert to JavaScript number for financial math
  • totalUnclaimedTokens excludes current-day rewards — add getCurrentDayTokens for full picture
  • Call syncUserVolumeAccumulator before reading getCurrentDayTokens for accuracy
  • This skill covers read-only queries only — for claiming and collecting, see the pump-token-incentives and pump-fee-sharing skills

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

1password

免费

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.

中文简介正在准备中。当前显示原文说明。

x402agent/SolanaOS92026年7月23日 更新

Manage Apple Notes via the `memo` CLI on macOS (create, view, edit, delete, search, move, and export notes). Use when a user asks SolanaOS to add a note, list notes, search notes, or manage note folders.

中文简介正在准备中。当前显示原文说明。

x402agent/SolanaOS92026年7月23日 更新

Manage Apple Reminders via remindctl CLI (list, add, edit, complete, delete). Supports lists, date filters, and JSON/plain output.

中文简介正在准备中。当前显示原文说明。

x402agent/SolanaOS92026年7月23日 更新

Create, search, and manage Bear notes via grizzly CLI.

中文简介正在准备中。当前显示原文说明。

x402agent/SolanaOS92026年7月23日 更新

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

中文简介正在准备中。当前显示原文说明。

x402agent/SolanaOS92026年7月23日 更新

blucli

免费

BluOS CLI (blu) for discovery, playback, grouping, and volume.

中文简介正在准备中。当前显示原文说明。

x402agent/SolanaOS92026年7月23日 更新

查看 x402agent 的全部技能

报告此技能的问题