trendsurfer-skill
v0.4.1
Published
The intelligence skill for trends.fun — graduation prediction, bonding curve analysis, security checks, and trade execution for Solana's tokenized tweet platform
Maintainers
Readme
trendsurfer-skill
The first intelligence skill for trends.fun — graduation prediction, bonding curve analysis, and trade execution for Solana AI agents.
TrendSurfer gives any AI agent the ability to monitor trends.fun token launches, predict which tokens will graduate from their bonding curve to a full DEX pool, and execute trades via Meteora DBC's bonding curve.
Install
npm install trendsurfer-skillQuick Start
import { TrendSurferSkill } from 'trendsurfer-skill'
const skill = new TrendSurferSkill({
heliusApiKey: process.env.HELIUS_API_KEY,
})
// One-shot analysis — just pass a mint address
const { graduation, security, token } = await skill.analyzeByMint(
'EK7NyRkRmstUZ49g9Z5a6Y3vFDywJu1cCph3SsRcvb8N'
)
console.log(`${token.symbol}: ${graduation.score}/100 — ${graduation.velocity}`)
console.log(`Safe: ${security.safe}`)
console.log(graduation.reasoning)
// Or scan for new launches and analyze each
const { launches } = await skill.scanLaunches()
for (const launch of launches) {
const analysis = await skill.analyzeGraduation(launch)
console.log(`${launch.symbol}: ${analysis.score}/100 — ${analysis.velocity}`)
}API Reference
new TrendSurferSkill(config?)
Create a new skill instance.
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| heliusApiKey | string | process.env.HELIUS_API_KEY | Helius RPC API key |
| heliusRpcUrl | string | derived from key | Full Helius RPC URL |
| pollingIntervalMs | number | 10000 | Polling interval for continuous scanning |
| maxTokenAge | number | 86400000 | Max token age in ms to consider "new" |
Scanning
skill.scanLaunches(limit?): Promise<ScanResult>
Scan for new trends.fun token launches by monitoring Meteora Dynamic Bonding Curve program activity.
skill.getLaunches(): TokenLaunch[]
Get all currently tracked/cached token launches.
skill.refreshLaunches(): Promise<TokenLaunch[]>
Refresh bonding curve progress for all tracked (non-graduated) launches.
skill.startPolling(callback): void
Start continuous polling for new launches. The callback fires whenever new tokens are discovered.
skill.stopPolling(): void
Stop continuous polling.
Analysis
skill.analyzeByMint(mint): Promise<{ graduation, security, token }>
The easiest way to analyze a token. Pass a Solana mint address, get back everything: graduation score, security check, and token metadata. Automatically finds the Meteora DBC pool, fetches metadata, and runs the full analysis pipeline.
const result = await skill.analyzeByMint('EK7NyRkRmstUZ49g9Z5a6Y3vFDywJu1cCph3SsRcvb8N')
// result.graduation.score → 87
// result.graduation.curveProgress → 72.3
// result.graduation.velocity → 'accelerating'
// result.graduation.reasoning → 'Bonding curve is 72.3% filled...'
// result.security.safe → true
// result.token.name → '$Chhealth'Throws if the mint is invalid or no Meteora DBC pool is found.
skill.analyzeGraduation(launch): Promise<GraduationAnalysis>
Full graduation probability analysis for a token. Returns:
score(0-100) — composite graduation probabilitycurveProgress(0-100) — current bonding curve fill percentagevelocity—'accelerating'|'steady'|'declining'|'stagnant'velocityScore(0-100) — curve fill rate scoresecurityScore(0-100) — token safety scorereasoning— human-readable explanation
skill.recordSnapshot(mint, curveProgress): void
Record a velocity snapshot. Call periodically for accurate velocity tracking.
skill.getVelocity(mint)
Get current velocity classification and score for a token.
skill.getVelocityHistory(mint): VelocitySnapshot[]
Get all recorded velocity snapshots for a token.
Security
skill.checkSecurity(mint): Promise<SecurityCheck>
Check token security via on-chain analysis. Returns honeypot detection, mint/freeze authority status, and warning list.
Trading
skill.getQuote(params): Promise<SwapQuote>
Get a swap quote for buying or selling a token on Meteora DBC.
const quote = await skill.getQuote({
tokenMint: 'So11...addr',
side: 'buy',
amount: '0.1', // SOL
walletAddress: 'your-wallet-address',
slippage: '0.5',
})skill.executeTrade(params): Promise<TradeExecution>
Execute a full trade on Meteora DBC (gasless — gas is deducted from the input token).
skill.getTradeStatus(orderId): Promise<OrderDetails>
Check the status of a submitted trade.
Utility
skill.addPool(launch): void
Manually add a token launch to track.
skill.clearCache(): void
Clear all cached token data.
skill.destroy(): void
Stop polling and clean up resources.
Types
All types are exported from the package:
import type {
TokenLaunch,
GraduationAnalysis,
SecurityCheck,
SwapQuote,
TradeExecution,
BondingCurveState,
SkillConfig,
ScanResult,
VelocitySnapshot,
} from 'trendsurfer-skill'MCP Server
For agent-framework-agnostic access, use the companion MCP server:
npm install -g trendsurfer-mcp
trendsurfer-mcpOr add to your MCP config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"trendsurfer": {
"command": "npx",
"args": ["trendsurfer-mcp"],
"env": {
"HELIUS_API_KEY": "your-key"
}
}
}
}Available MCP tools: analyze_by_mint, scan_launches, analyze_graduation, check_security, get_quote, get_launches, refresh_launches.
How It Works
trends.fun tokens are tokenized tweets built on Meteora's Dynamic Bonding Curve (DBC). When enough buy pressure fills the bonding curve, the token "graduates" — liquidity auto-migrates to a full Meteora DAMM pool, typically causing a price jump.
TrendSurfer reads on-chain DBC pool state via Helius RPC, tracks curve fill velocity over time, runs security audits via on-chain analysis, and produces a composite graduation probability score. This intelligence can power autonomous trading agents, alert bots, or analytics dashboards.
Links
License
MIT
