Use the TradingClient to access Webacy’s trading analysis APIs. You can analyze token holder distribution, detect snipers and bundlers, and get quick trading insights.
Initialization
Prerequisites:
SDK installed (npm install @webacy-xyz/sdk)
API key available (from your Webacy dashboard)
import { TradingClient , Chain } from '@webacy-xyz/sdk' ;
const client = new TradingClient ({
apiKey: process . env . WEBACY_API_KEY ,
defaultChain: Chain . SOL , // Optional: set default chain
});
Resources
The TradingClient provides access to these resources:
Resource Description holderAnalysisToken holder distribution, sniper/bundler detection tradingLiteQuick trading analysis (Solana only) tokensToken pools and trending data
Holder Analysis
Get Holder Analysis
Get comprehensive analysis of token holder distribution.
const result = await client . holderAnalysis . get (
'TokenMintAddress...' ,
{ chain: Chain . SOL }
);
console . log ( `Total holders: ${ result . totalHolders } ` );
console . log ( `Top 10 hold: ${ result . top10Percentage } %` );
console . log ( `Snipers detected: ${ result . sniperCount } ` );
Response includes:
Top holders with wallet addresses and percentages
First buyers analysis
Sniper detection with confidence scores
Bundler detection
Developer wallet tracking
Concentration metrics
Response Example
{
"totalHolders" : 1523 ,
"top10Percentage" : 45.2 ,
"top10Holders" : [
{
"address" : "ABC123..." ,
"percentage" : 12.5 ,
"isSuspicious" : false
}
],
"sniperCount" : 8 ,
"snipers" : [
{
"address" : "DEF456..." ,
"confidence" : 0.95 ,
"buyBlock" : 123456 ,
"percentage" : 2.1
}
],
"bundlerCount" : 3 ,
"devWallets" : [ "GHI789..." ]
}
Options:
Option Type Description chainChainBlockchain to analyze (optional if defaultChain set)
Trading Lite
Quick, simplified token analysis optimized for trading decisions.
Trading Lite is currently available for Solana only .
Analyze Token
const result = await client . tradingLite . analyze ( 'PumpTokenAddress...' );
console . log ( `Risk score: ${ result . riskScore } ` );
console . log ( `Liquidity: $ ${ result . liquidity } ` );
console . log ( `Is honeypot: ${ result . isHoneypot } ` );
Response includes:
Quick risk assessment
Liquidity metrics
Honeypot detection
Basic holder stats
Tokens
Fetch Token Pools
Retrieve liquidity pool information for a token.
const result = await client . tokens . getPools (
'0xTokenAddress...' ,
{ chain: Chain . ETH }
);
for ( const pool of result . pools ) {
console . log ( `DEX: ${ pool . dex } ` );
console . log ( `Liquidity: $ ${ pool . liquidity } ` );
console . log ( `Pair: ${ pool . pairToken } ` );
}
List Trending Tokens
Retrieve currently trending tokens on a chain.
const result = await client . tokens . getTrending ({ chain: Chain . SOL });
for ( const token of result . tokens ) {
console . log ( ` ${ token . symbol } : ${ token . priceChange24h } %` );
}
Full Example
import { TradingClient , Chain , ValidationError } from '@webacy-xyz/sdk' ;
const client = new TradingClient ({
apiKey: process . env . WEBACY_API_KEY ,
defaultChain: Chain . SOL ,
});
async function analyzeToken ( tokenAddress : string ) {
try {
// Get holder analysis
const holders = await client . holderAnalysis . get ( tokenAddress );
// Check for red flags
const redFlags : string [] = [];
// High concentration
if ( holders . top10Percentage > 80 ) {
redFlags . push ( `High concentration: Top 10 hold ${ holders . top10Percentage } %` );
}
// Snipers
if ( holders . sniperCount > 5 ) {
redFlags . push ( ` ${ holders . sniperCount } snipers detected` );
}
// Bundlers
if ( holders . bundlerCount > 0 ) {
redFlags . push ( ` ${ holders . bundlerCount } bundlers detected` );
}
// Quick analysis (Solana)
const quickAnalysis = await client . tradingLite . analyze ( tokenAddress );
if ( quickAnalysis . isHoneypot ) {
redFlags . push ( 'Honeypot detected!' );
}
return {
safe: redFlags . length === 0 ,
redFlags ,
holders ,
quickAnalysis ,
};
} catch ( error ) {
if ( error instanceof ValidationError ) {
console . error ( 'Invalid token address:' , error . message );
}
throw error ;
}
}
// Usage
const analysis = await analyzeToken ( 'PumpTokenMint...' );
if ( ! analysis . safe ) {
console . warn ( 'Red flags detected:' );
analysis . redFlags . forEach ( flag => console . warn ( ` - ${ flag } ` ));
}
Use Cases
Token Launch Analysis Detect snipers and bundlers on new token launches
Rug Pull Detection Identify concentrated holdings and dev wallets
Trading Signals Quick risk assessment for trading decisions
Due Diligence Comprehensive holder analysis before investing
Next Steps