polyhacks-whale-alerts
v1.0.0
Published
Real-time Polymarket whale alert tracking. Get notified when smart money moves.
Maintainers
Readme
polyhacks-whale-alerts
Real-time Polymarket whale alert tracking. Get notified when smart money moves.
Install
npm install polyhacks-whale-alertsQuick Start
import { PolyHacksClient } from 'polyhacks-whale-alerts';
const client = new PolyHacksClient();
// Get recent whale trades
const whales = await client.getRecentWhales({ minUsd: 10000, limit: 5 });
console.log(whales.trades);
// Get the biggest trade today
const biggest = await client.getBiggestToday();
console.log('Biggest whale:', biggest);
// Stream new trades in real-time
const stop = await client.stream(
(trade) => console.log('New whale:', trade),
30000, // Poll every 30 seconds
{ minUsd: 5000 }
);
// Stop streaming
stop();API Reference
new PolyHacksClient(options?)
Create a new client instance.
const client = new PolyHacksClient({
apiKey: 'your-api-key', // Optional: for paid tier
baseUrl: '...', // Optional: custom API endpoint
});client.getRecentWhales(options?)
Fetch recent whale trades.
const response = await client.getRecentWhales({
minUsd: 5000, // Minimum trade value (default: 5000)
limit: 10, // Number of trades (default: 10)
});
// Returns: { trades: WhaleTrade[], count: number, cached: boolean }client.getBiggestToday()
Get the single biggest whale trade of the day.
const biggest = await client.getBiggestToday();
// Returns: WhaleTrade | nullclient.stream(callback, intervalMs?, options?)
Stream new trades via polling. Returns an unsubscribe function.
const stop = await client.stream(
(trade) => console.log(trade),
60000, // Poll interval in ms (default: 60000)
{ minUsd: 5000 } // Options
);
stop(); // Stop streamingTypes
interface WhaleTrade {
title: string; // Market title
outcome: string; // Outcome name (Yes/No or custom)
side: 'BUY' | 'SELL'; // Trade direction
usd_value: number; // Trade value in USD
avg_price: number; // Average fill price
trader: string; // Trader address (shortened)
timestamp: string; // ISO timestamp
market_slug?: string; // Market identifier
}Pricing Tiers
| Feature | Free Tier | Paid Tier ($9.99/mo) | |---------|-----------|----------------------| | Requests | 5/hour | Unlimited | | Latency | 15 min delayed | Real-time | | API Key | Not required | Required |
Get your API key at polyhacks.app
Links
License
MIT
