Skip to content

internet-court/internet-court-skill / vendored/sendaifun/birdeye

birdeye

Verified

Complete Birdeye API integration for real-time DeFi data across Solana and 15 other chains. Use for token prices, OHLCV charts, market discovery, on-chain trader intelligence, holder analysis, wallet portfolio & P&L, and WebSocket streams for live prices and whale alerts.

examples/market-data/new-listings.ts

View on GitHub
/**
 * New Token Listings — Birdeye /defi/v2/tokens/new_listing
 * Fetches recently listed tokens on Solana for early-entry alpha.
 *
 * Run: BIRDEYE_API_KEY=xxx npx ts-node examples/market-data/new-listings.ts
 */

import { BirdeyeClient } from '../../templates/birdeye-client';

async function run() {
    const apiKey = process.env.BIRDEYE_API_KEY;
    if (!apiKey) { console.error('Set BIRDEYE_API_KEY env var.'); process.exit(1); }

    const client = BirdeyeClient.createWithConfig({ apiKey, chain: 'solana' });

    console.log('Fetching new token listings...');

    try {
        const data = await client.market.getNewListings(20);
        const tokens = data?.items ?? (Array.isArray(data) ? data : []);
        // Response fields (live-verified): address, symbol, name, decimals, liquidity,
        // liquidityAddedAt (ISO string), logoURI, source.
        const oneHourAgo = Date.now() - 3600 * 1000;

        console.log(`\nNew Listings (last 20):`);
        tokens.forEach((token: any) => {
            const listedMs = token.liquidityAddedAt ? new Date(token.liquidityAddedAt).getTime() : 0;
            const isRecent = listedMs > oneHourAgo;
            const time = listedMs ? new Date(listedMs).toISOString() : 'unknown';
            console.log(`${isRecent ? '🆕' : '  '} ${token.symbol || '???'} (${token.address})`);
            console.log(`   Listed:    ${time}`);
            console.log(`   Source:    ${token.source ?? 'N/A'}`);
            console.log(`   Liquidity: $${token.liquidity?.toLocaleString() ?? 'N/A'}`);
        });
    } catch (e: any) {
        console.error('[Error]', e.message);
    }
}

run();
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 323kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 323kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 323kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 323kUpdated Claude CodeCodexVerifiedInstall