How CloddsBot's Multi-Chain Whale Tracking Monitors Solana and EVM Wallets

TLDR: CloddsBot tracks high-value "whale" wallets across Solana and EVM chains through a unified architecture comprising two specialized feed modules—one for Polymarket CLOB data and one for generic on-chain monitoring—that normalize all trade events into a common WhaleTrade schema and emit standardized signals for copy-trading.

CloddsBot (alsk1992/CloddsBot) implements a sophisticated multi-chain whale tracking system that treats Solana and Ethereum-compatible (EVM) addresses as interchangeable entities within a single copy-trading pipeline. The system aggregates real-time trade data from disparate sources—ranging from Polymarket's centralized limit order book (CLOB) to native Solana and EVM RPC endpoints—into unified whale profiles that track performance metrics, win rates, and position changes.

Unified Architecture for Cross-Chain Monitoring

The whale tracking system splits responsibilities across two specialized modules that share a common interface. Both modules maintain an internal whaleProfiles Map and emit identical event types through an EventEmitter, allowing downstream components to consume cross-chain data without chain-specific logic.

Polymarket Whale-Tracker Module

Located in src/feeds/polymarket/whale-tracker.ts, this module connects to Polymarket's CLOB WebSocket at wss://ws-subscriptions-clob.polymarket.com/ws/market and the Gamma REST API. It streams real-time trade events and polls position snapshots every configurable interval. The tracker filters trades by configurable USD thresholds (minTradeSize, minPositionSize) and maintains per-address profiles storing total value, win-rate, and category performance.

Crypto Whale-Tracker Module for Solana and EVM

Located in src/feeds/crypto/whale-tracker.ts, this module provides chain-agnostic on-chain tracking for Solana and EVM wallets. It connects to Solana RPC/WebSocket endpoints and EVM providers (Alchemy/Infura), listening for large token transfers or swaps exceeding the configured threshold. This module normalizes all incoming events into the same WhaleTrade shape used by the Polymarket tracker, enabling the bot to treat Solana and EVM addresses as interchangeable "whales."

Real-Time Data Pipeline and Event Flow

The tracking pipeline follows a six-step process from configuration to signal generation:

  1. Configuration - On startup, each tracker receives a WhaleConfig object with defaults of $10,000 minimum trade size, $50,000 minimum position size, and 60-second poll intervals.

  2. Whale Discovery - The Polymarket tracker pulls top traders from the Gamma leaderboard API (/leaderboard?limit=100&sortBy=volume), while the crypto tracker auto-adds addresses executing trades above minTradeSize * 5 on Solana or EVM chains.

  3. Real-Time Streaming - Polymarket uses the CLOB WebSocket; Solana connects to wss://api.mainnet-beta.solana.com; EVM chains subscribe via provider WebSockets (e.g., Alchemy). All JSON payloads normalize into WhaleTrade objects containing fields like usdValue, maker, taker, side, and marketId.

  4. Position Polling - Every pollIntervalMs, the system queries Gamma API positions for Polymarket and chain-specific RPC methods (getTokenAccountsByOwner for Solana, eth_getLogs for EVM) to detect positionOpened, positionChanged, or positionClosed events.

  5. Performance Tracking - Closed positions trigger recordClosedPosition to update win/loss counts and total PnL per whale in the shared profiles map.

  6. Signal Generation - The calculateSignalStrength function evaluates win-rate, trade-count confidence, and average PnL. When signal strength ≥ 0.5, closed trades ≥ 5, and win-rate ≥ WHALE_MIN_WIN_RATE (default 55%), the tracker emits a copySignal event via the EventEmitter.

Configuration and Performance Thresholds

The system uses strict defaults to filter noise while remaining configurable:

  • Minimum Trade Size: $10,000 USD (minTradeSize)
  • Minimum Position Size: $50,000 USD (minPositionSize)
  • Win Rate Threshold: 55% (WHALE_MIN_WIN_RATE)
  • Recent Trade Buffer: Maximum 1,000 items in the recentTrades array
  • Signal Strength Threshold: 0.5 (scale 0-1) for copy-trading eligibility

Implementation Examples

Initializing Multi-Chain Trackers

import { createWhaleTracker as createPolymarketTracker } from './feeds/polymarket/whale-tracker';
import { createWhaleTracker as createCryptoTracker } from './feeds/crypto/whale-tracker';

const polyConfig = { minTradeSize: 15000 };
const cryptoConfig = { minTradeSize: 20000, enableRealtime: true };

const polyTracker = createPolymarketTracker(polyConfig);
const cryptoTracker = createCryptoTracker(cryptoConfig);

await Promise.all([polyTracker.start(), cryptoTracker.start()]);

Subscribing to Cross-Chain Whale Events

cryptoTracker.on('trade', (trade: WhaleTrade) => {
  console.log(
    `[Whale] ${trade.maker.slice(0, 8)} → ${trade.taker.slice(0, 8)} ` +
    `${trade.side} $${trade.usdValue.toLocaleString()} on ${trade.marketId}`
  );
});

Aggregating Profitable Whales Across Chains

const allProfiles = [
  ...polyTracker.getProfitableWhales(),
  ...cryptoTracker.getProfitableWhales(),
];

allProfiles.sort((a, b) => b.winRate - a.winRate || b.totalValue - a.totalValue);

allProfiles.slice(0, 10).forEach((p, i) => {
  console.log(`${i + 1}. ${p.address.slice(0, 10)} – WR: ${p.winRate.toFixed(1)}% – $${p.totalValue.toLocaleString()}`);
});

Handling Copy-Trading Signals

The src/trading/copy-trading.ts module consumes normalized signals regardless of source chain:

cryptoTracker.on('copySignal', (signal) => {
  copyTradeExecutor.handleSignal(signal);
});

Unified API Interface

Both trackers expose identical public methods, enabling chain-agnostic interactions:

  • start() and stop() for lifecycle management
  • trackAddress(address) and untrackAddress(address) for manual whale curation
  • getKnownWhales() and getWhaleProfile(address) for profile retrieval
  • getRecentTrades() for accessing the bounded trade history
  • getProfitableWhales() for filtering by performance metrics

Summary

  • CloddsBot implements multi-chain whale tracking through two specialized modules in src/feeds/polymarket/whale-tracker.ts and src/feeds/crypto/whale-tracker.ts.
  • The architecture normalizes disparate data sources—Polymarket CLOB, Solana RPC, and EVM providers—into a unified WhaleTrade schema.
  • Real-time WebSocket streams and periodic RPC polling maintain updated position data for both prediction markets and on-chain token transfers.
  • A signal generation algorithm (calculateSignalStrength) filters whales by win-rate (≥55%), trade count (≥5), and signal strength (≥0.5) before emitting copy-trading events.
  • The system treats Solana and EVM wallets as interchangeable entities, allowing src/trading/copy-trading.ts to execute mirrored trades without chain-specific logic.

Frequently Asked Questions

How does CloddsBot normalize data between Polymarket and on-chain Solana/EVM sources?

The Crypto Whale-Tracker module in src/feeds/crypto/whale-tracker.ts transforms incoming Solana and EVM transaction payloads into the same WhaleTrade interface used by the Polymarket tracker. This normalization includes mapping fields like usdValue, maker, taker, and marketId to a consistent schema, enabling the EventEmitter to broadcast identical event types (trade, positionOpened, copySignal) regardless of the underlying blockchain.

What are the default thresholds for automatic whale detection?

CloddsBot uses conservative defaults defined in the WhaleConfig interface: a $10,000 USD minimum trade size (minTradeSize), $50,000 minimum position size (minPositionSize), and a 55% minimum win rate (WHALE_MIN_WIN_RATE). For automatic discovery, the crypto tracker adds addresses that execute trades exceeding minTradeSize * 5 (effectively $50,000) to the trackedAddresses Set.

How is copy-trading signal strength calculated?

The calculateSignalStrength function in the whale tracker modules computes a 0-to-1 score based on three weighted factors: historical win-rate, statistical confidence derived from total trade count (requiring minimum 5 closed trades), and average realized profit/loss (PnL). A whale only emits a copySignal event when its signal strength reaches 0.5 or higher, combined with meeting the minimum win-rate threshold.

Can developers manually track specific wallet addresses outside the auto-discovery?

Yes. Both tracker instances expose the trackAddress(address: string) method, which adds the specified Solana or EVM address to the internal trackedAddresses Set and initializes a new entry in the whaleProfiles Map. Conversely, untrackAddress(address) removes monitoring for specific wallets. These methods are exposed through the user-facing slash commands defined in src/skills/bundled/whale-tracking/index.ts.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →