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/trader-intelligence/gainers-losers.ts

View on GitHub
/**
 * Trader Gainers — Birdeye /trader/gainers-losers
 * Returns top performing traders on-chain by P&L.
 *
 * Required params: type, sort_by, sort_type (all three — omitting any causes 400)
 *   type: 'today' | 'yesterday' | '1W'
 *   sort_by: 'PnL' (only valid value)
 *   sort_type: 'desc' | 'asc'
 *
 * WARNING: type='gainers' or type='losers' causes 400 "type invalid format".
 *
 * Run: BIRDEYE_API_KEY=xxx npx ts-node examples/trader-intelligence/gainers-losers.ts
 */

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

async function run() {
    const client = BirdeyeClient.create('solana');

    console.log('Fetching top gainers (today, by P&L)...');

    try {
        const data = await client.trader.getGainers('today', 'PnL', 'desc', 10);
        const traders = data?.items ?? [];

        console.log(`\nTop ${traders.length} Gainers:\n`);
        traders.forEach((t: any, i: number) => {
            console.log(`${i + 1}. ${t.address}`);
            console.log(`   PnL:    $${t.pnl?.toFixed(2)}`);
            console.log(`   Volume: $${t.volume?.toFixed(2)}`);
            console.log(`   Trades: ${t.trade_count}`);
        });
    } 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