@@ -101,6 +101,17 @@ dataStream.subscribe.tx.wallet(walletAddress).on((walletTx) => {
101101 console .log (` ${walletTx .type === ' buy' ? ' Bought' : ' Sold' } token ` );
102102 console .log (` Volume: ${walletTx .volume } USD ` );
103103});
104+
105+ // Example 6: Subscribe to curve percentage updates
106+ dataStream .subscribe .curvePercentage (' pumpfun' , 30 ).on ((data ) => {
107+ console .log (` Token ${data .token .symbol } reached 30% on Pump.fun ` );
108+ console .log (` Market cap: ${data .pools [0 ].marketCap .usd } ` );
109+ });
110+
111+ // Different markets and percentages
112+ dataStream .subscribe .curvePercentage (' meteora-curve' , 75 ).on ((data ) => {
113+ console .log (` Meteora token at 75%: ${data .token .name } ` );
114+ });
104115```
105116
106117Available subscription methods:
@@ -128,6 +139,9 @@ dataStream.subscribe.graduated(); // Graduated tokens
128139// Metadata and holders
129140dataStream .subscribe .metadata (tokenAddress ); // Token metadata
130141dataStream .subscribe .holders (tokenAddress ); // Holder updates
142+
143+ // Curve percentage updates
144+ dataStream .subscribe .curvePercentage (market , percentage ); // Market options: 'launchpad', 'pumpfun', 'boop', 'meteora-curve'
131145```
132146
133147Each subscription method returns a response object with:
@@ -195,7 +209,7 @@ const searchResults = await client.searchTokens({
195209});
196210
197211// Get latest tokens
198- const latestTokens = await client .getLatestTokens (1 );
212+ const latestTokens = await client .getLatestTokens (100 );
199213
200214// Get information about multiple tokens
201215const multipleTokens = await client .getMultipleTokens ([
@@ -259,6 +273,12 @@ const wallet = await client.getWallet('walletAddress');
259273// Get wallet tokens with pagination
260274const walletPage = await client .getWalletPage (' walletAddress' , 2 );
261275
276+ // Get wallet portfolio chart data with historical values and PnL
277+ const walletChart = await client .getWalletChart (' walletAddress' );
278+ console .log (' 24h PnL:' , walletChart .pnl [' 24h' ]);
279+ console .log (' 30d PnL:' , walletChart .pnl [' 30d' ]);
280+ console .log (' Chart data points:' , walletChart .chartData .length );
281+
262282// Get wallet trades
263283const walletTrades = await client .getWalletTrades (' walletAddress' , undefined , true , true , false );
264284```
@@ -315,6 +335,25 @@ const topTraders = await client.getTopTraders(1, true, 'total');
315335const tokenTopTraders = await client .getTokenTopTraders (' tokenAddress' );
316336```
317337
338+ ### Events Endpoints (Live Data)
339+
340+ ``` typescript
341+ // Get raw event data for live processing
342+ // NOTE: For non-live statistics, use getTokenStats() instead which is more efficient
343+ const events = await client .getEvents (' tokenAddress' );
344+ console .log (' Total events:' , events .length );
345+
346+ // Get events for a specific pool
347+ const poolEvents = await client .getPoolEvents (' tokenAddress' , ' poolAddress' );
348+
349+ // Process events into statistics using the processEvents utility
350+ import { processEventsAsync } from ' @solana-tracker/data-api' ;
351+
352+ const stats = await processEvents (events );
353+ console .log (' 1h stats:' , stats [' 1h' ]);
354+ console .log (' 24h volume:' , stats [' 24h' ]?.volume .total );
355+ ```
356+
318357### Additional Endpoints
319358
320359``` typescript
@@ -323,6 +362,10 @@ const tokenStats = await client.getTokenStats('tokenAddress');
323362
324363// Get detailed stats for a specific token and pool
325364const poolStats = await client .getPoolStats (' tokenAddress' , ' poolAddress' );
365+
366+ // Get remaining API credits
367+ const credits = await client .getCredits ();
368+ console .log (' Remaining credits:' , credits .credits );
326369```
327370
328371## Error Handling
0 commit comments