repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | description: Monitor bonding curves, graduation progress, and trade analytics on Pump.fun |
| #3 | --- |
| #4 | |
| #5 | # PumpFun Analytics |
| #6 | |
| #7 | Monitor bonding curve state, calculate price impact, track graduation progress, and analyze token economics on the Pump.fun protocol. |
| #8 | |
| #9 | ## Prerequisites |
| #10 | |
| #11 | - `HELIUS_RPC_URL` or `SOLANA_RPC_URL` configured |
| #12 | - `@coral-xyz/anchor` and `@solana/web3.js` available |
| #13 | |
| #14 | ## Capabilities |
| #15 | |
| #16 | ### 1. Bonding Curve State |
| #17 | |
| #18 | Fetch the current state of any token's bonding curve: |
| #19 | |
| #20 | ```typescript |
| #21 | import { OnlinePumpSdk } from "@nirholas/pump-sdk"; |
| #22 | |
| #23 | const sdk = new OnlinePumpSdk(connection); |
| #24 | const summary = await sdk.fetchBondingCurveSummary(mint); |
| #25 | |
| #26 | console.log("Market Cap:", summary.marketCap.toString()); |
| #27 | console.log("Graduated:", summary.isGraduated); |
| #28 | console.log("Token Supply Remaining:", summary.tokensRemaining.toString()); |
| #29 | ``` |
| #30 | |
| #31 | ### 2. Graduation Progress |
| #32 | |
| #33 | Track how close a token is to graduating from the bonding curve to the AMM: |
| #34 | |
| #35 | ```typescript |
| #36 | import { getGraduationProgress } from "@nirholas/pump-sdk"; |
| #37 | |
| #38 | const progress = getGraduationProgress(bondingCurve, global); |
| #39 | console.log(`Progress: ${progress.progressBps / 100}%`); |
| #40 | console.log(`SOL accumulated: ${progress.solAccumulated.toString()}`); |
| #41 | console.log(`Tokens remaining: ${progress.tokensRemaining.toString()}`); |
| #42 | ``` |
| #43 | |
| #44 | ### 3. Price Impact Analysis |
| #45 | |
| #46 | Calculate the price impact of a trade before executing: |
| #47 | |
| #48 | ```typescript |
| #49 | import { calculateBuyPriceImpact, calculateSellPriceImpact } from "@nirholas/pump-sdk"; |
| #50 | |
| #51 | const buyImpact = calculateBuyPriceImpact(bondingCurve, global, feeConfig, buyAmountLamports); |
| #52 | console.log(`Price impact: ${buyImpact.priceImpactBps / 100}%`); |
| #53 | console.log(`Effective price: ${buyImpact.effectivePrice.toString()}`); |
| #54 | |
| #55 | const sellImpact = calculateSellPriceImpact(bondingCurve, global, feeConfig, sellTokenAmount); |
| #56 | console.log(`Price impact: ${sellImpact.priceImpactBps / 100}%`); |
| #57 | ``` |
| #58 | |
| #59 | ### 4. Token Price |
| #60 | |
| #61 | Get the current buy and sell price per token: |
| #62 | |
| #63 | ```typescript |
| #64 | import { getTokenPrice } from "@nirholas/pump-sdk"; |
| #65 | |
| #66 | const price = getTokenPrice(bondingCurve, global, feeConfig); |
| #67 | console.log(`Buy price: ${price.buyPricePerToken.toString()} lamports`); |
| #68 | console.log(`Sell price: ${price.sellPricePerToken.toString()} lamports`); |
| #69 | ``` |
| #70 | |
| #71 | ### 5. Fee Tier Calculation |
| #72 | |
| #73 | Calculate the current fee tier based on market cap: |
| #74 | |
| #75 | ```typescript |
| #76 | import { computeFeesBps, calculateFeeTier } from "@nirholas/pump-sdk"; |
| #77 | |
| #78 | const fees = computeFeesBps(global, feeConfig); |
| #79 | console.log(`Protocol fee: ${fees.protocolFeeBps} bps`); |
| #80 | console.log(`Creator fee: ${fees.creatorFeeBps} bps`); |
| #81 | ``` |
| #82 | |
| #83 | ### 6. Buy/Sell Quote |
| #84 | |
| #85 | Calculate expected tokens for a given SOL amount: |
| #86 | |
| #87 | ```typescript |
| #88 | import { getBuyTokenAmountFromSolAmount, getSellSolAmountFromTokenAmount } from "@nirholas/pump-sdk"; |
| #89 | |
| #90 | const tokens = getBuyTokenAmountFromSolAmount({ |
| #91 | global, feeConfig, |
| #92 | mintSupply: bondingCurve.tokenTotalSupply, |
| #93 | bondingCurve, |
| #94 | amount: solAmountLamports, |
| #95 | }); |
| #96 | |
| #97 | const sol = getSellSolAmountFromTokenAmount({ |
| #98 | global, feeConfig, |
| #99 | mintSupply: bondingCurve.tokenTotalSupply, |
| #100 | bondingCurve, |
| #101 | amount: tokenAmount, |
| #102 | }); |
| #103 | ``` |
| #104 | |
| #105 | ## Agent Integration |
| #106 | |
| #107 | The OODA trading loop uses these analytics automatically during the **Observe** phase to pull bonding curve data into ClawVault KNOWN memory. |
| #108 |