# How CloddsBot Coordinates Copy Trading and Swarm Trading Across Multiple Wallets

> Discover how CloddsBot coordinates copy trading and swarm trading across multiple wallets. Learn about its WebSocket pipeline, SwarmInterface, and advanced execution modes for efficient trade replication.

- Repository: [AL/CloddsBot](https://github.com/alsk1992/CloddsBot)
- Tags: how-to-guide
- Published: 2026-09-11

---

**CloddsBot uses a WebSocket-driven detection pipeline combined with the SwarmInterface pattern to replicate leader trades across up to 20 or more wallets simultaneously, applying per-target filters and executing via parallel, bundled, or sequential modes.**

CloddsBot, developed in the alsk1992/CloddsBot repository, implements a sophisticated dual-mode architecture that enables both copy trading and swarm trading across multiple wallets. While the Solana implementation supports true multi-wallet coordination through program-controlled accounts and coordinated transaction building, the EVM module remains limited to single-wallet execution due to fundamental signature constraint differences between the chains.

## Architectural Overview of Multi-Wallet Coordination

The system separates concerns between **detection**, **filtering**, and **execution**. At the highest level, the `SwarmCopyTrader` class manages target wallet lists and WebSocket subscriptions, while the `SwarmInterface` implementations handle the actual coordination of multiple wallets during trade execution.

### The SwarmCopyTrader Orchestrator

Located in [`src/solana/swarm-copytrade.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/swarm-copytrade.ts), the `SwarmCopyTrader` serves as the primary entry point. It maintains a `Connection` to Solana and opens WebSocket subscriptions for every target address being monitored. When a transaction hits one of the known DEX program IDs—such as `PUMP_FUN`, `RAYDIUM_AMM`, or `JUPITER_V6`—the listener constructs a `DetectedTrade` object containing the full transaction details.

The orchestrator then applies deduplication logic and converts raw on-chain trades into standardized `SwarmTradeParams` objects. These parameters include the DEX identifier, token mints, size calculations, and the specific `executionMode` (parallel, bundled, or sequential) that determines how the swarm will submit transactions.

### SwarmInterface and Coordinated Execution

Concrete implementations of `SwarmInterface`, such as `PumpFunSwarm` defined in [`src/solana/pump-swarm.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/pump-swarm.ts), expose two critical methods: `coordinatedBuy` and `coordinatedSell`. These methods accept a `SwarmTradeParams` object and delegate transaction construction to registered **SwarmTransactionBuilders** before submitting the resulting transactions according to the configured execution strategy.

## The Solana Multi-Wallet Pipeline

Solana’s architecture allows CloddsBot to perform true multi-wallet coordination through a four-stage pipeline that transforms a single leader trade into synchronized executions across many wallets.

### Real-Time Trade Detection

The detection layer creates a dedicated WebSocket subscription for each target wallet via the Solana `Connection` class. When the bot detects a swap instruction interacting with monitored DEX program IDs, it immediately builds a `DetectedTrade` object capturing the token mint, size, direction (buy/sell), and slot confirmation. This object flows into the filtering layer within milliseconds of finalization.

### Filter Configuration via CopyConfig

Before execution, every trade passes through a `CopyConfig` validation step. This configuration object enforces:

- **Multipliers**: Scales the leader’s trade size (e.g., 2.0x)
- **Max SOL per trade**: Hard caps on exposure
- **DelayMs**: Configurable stealth delays between detection and execution
- **Token whitelist/blacklist**: Explicit inclusion or exclusion lists for specific mints
- **Execution mode**: Selection between parallel, bundled, or sequential submission

If the trade fails any filter criteria—such as exceeding the max SOL limit or involving a blacklisted token—the `SwarmCopyTrader` discards it before reaching the coordination layer.

### Coordinated Buy and Sell Operations

The core coordination logic resides in `PumpFunSwarm.coordinatedBuy` and `coordinatedSell`. These methods iterate over every wallet registered in the swarm (typically up to 20 or more funded wallets) and invoke the appropriate builder for each. According to [`src/solana/swarm-strategies.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/swarm-strategies.ts), the `executeTrade` function forwards parameters to these coordinated methods, ensuring that the entire swarm acts as a single logical unit.

The `executionMode` parameter determines submission behavior:

- **Parallel**: Simultaneous `connection.sendRawTransaction` calls for all wallets
- **Bundled**: Jito-style bundle submission for atomic inclusion
- **Sequential**: Ordered submission with error handling between each wallet

### DEX-Specific Transaction Builders

The `SwarmTransactionBuilder` implementations, registered globally in [`src/solana/swarm-builders.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/swarm-builders.ts), handle the low-level transaction construction. Available builders include:

- `PumpFunBuilder` for Pump.fun swaps
- `PumpSwapBuilder` for PumpSwap liquidity pools
- `MeteoraBuilder` for Meteora DLMM pools
- `RaydiumBuilder` for Raydium AMM markets
- `JupiterBuilder` for Jupiter aggregator routes

Each builder provides a `getQuote` method that returns a `SwarmQuote` containing the fully signed transaction for a specific wallet and DEX combination. The swarm aggregates these quotes before submitting them as a batch.

## EVM Single-Wallet Constraints

In contrast to the Solana implementation, the EVM copy-trading module located in [`src/trading/copy-trading.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/trading/copy-trading.ts) supports only **single-wallet execution**. Ethereum and compatible chains lack Solana’s program-controlled account model, making it impossible to batch-sign transactions for multiple wallets in a single coordinated operation. Consequently, EVM deployments must run separate bot instances for each wallet, or accept the limitation of 1:1 trade replication rather than 1:many swarm coordination.

## Implementation Reference: Key Source Files

The following files define the multi-wallet coordination behavior:

- [`src/solana/swarm-copytrade.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/swarm-copytrade.ts): Main orchestrator handling target management, WebSocket monitoring, and `SwarmTradeParams` dispatch
- [`src/solana/pump-swarm.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/pump-swarm.ts): Defines `SwarmInterface`, `PumpFunSwarm` class, and the `coordinatedBuy`/`coordinatedSell` implementations
- [`src/solana/swarm-strategies.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/swarm-strategies.ts): Implements `executeTrade` logic that bridges configuration and swarm execution
- [`src/solana/swarm-builders.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/swarm-builders.ts): Registry and implementation of DEX-specific transaction builders
- [`src/trading/copy-trading.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/trading/copy-trading.ts): EVM single-wallet reference implementation

## Practical Implementation Example

The following TypeScript example demonstrates initializing a swarm copy-trading instance with filtered execution:

```typescript
import { Connection } from '@solana/web3.js';
import { getSwarmCopyTrader } from './src/solana/swarm-copytrade';
import { getPumpFunSwarm } from './src/solana/pump-swarm';

// Initialize Solana connection and swarm infrastructure
const connection = new Connection('https://solana-mainnet.rpc/');
const swarm = getPumpFunSwarm(connection);
const copyTrader = getSwarmCopyTrader(connection, swarm);

// Register a target wallet with multi-wallet copy configuration
copyTrader.addTarget(
  'E6Vh6…7k9y',                    // Target leader address
  {
    multiplier: 2.0,                // Double the leader's size
    maxSolPerTrade: 5,
    delayMs: 2_000,                 // 2-second stealth delay
    tokenWhitelist: ['SOL', 'USDC'],
    executionMode: 'parallel',      // Submit all wallet txs simultaneously
  },
  'Top-Trader-ABC'                 // Friendly identifier
);

// Handle completion events for logging or UI updates
copyTrader.on('copyCompleted', (result) => {
  console.log('Swarm execution result:', result);
});

```

For low-level coordination, the swarm executes trades by iterating through registered builders:

```typescript
async function coordinatedBuy(params: SwarmTradeParams) {
  const builder = builders.get(params.dex);
  const quotes: SwarmQuote[] = [];

  // Generate signed transactions for every wallet in the swarm
  for (const wallet of params.wallets) {
    quotes.push(await builder.getQuote({ ...params, wallet }));
  }

  // Submit according to executionMode configuration
  const txIds = await Promise.all(
    quotes.map((q) => connection.sendRawTransaction(q.transaction))
  );

  return { txIds, success: true };
}

```

## Summary

- **CloddsBot** enables multi-wallet copy trading through the `SwarmCopyTrader` orchestrator and `SwarmInterface` implementations.
- The Solana pipeline supports **20+ wallets** via coordinated buy/sell methods that leverage `SwarmTransactionBuilder` implementations for specific DEXs.
- **CopyConfig** provides granular control over multipliers, delays, token filters, and execution modes (parallel, bundled, or sequential).
- **EVM chains** are limited to single-wallet execution in [`src/trading/copy-trading.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/trading/copy-trading.ts) due to architectural constraints absent in Solana’s program model.
- Result aggregation through `CopyResult` objects tracks success rates, total SOL spent, and per-wallet errors across the entire swarm.

## Frequently Asked Questions

### How many wallets can CloddsBot coordinate simultaneously in a swarm?

CloddsBot’s `PumpFunSwarm` implementation can theoretically coordinate any number of wallets limited only by Solana’s transaction size constraints and RPC rate limits, though practical deployments typically manage **up to 20 wallets** per swarm instance. Each wallet requires independent funding and registration with the swarm builder registry before execution.

### What execution modes are available for swarm trading?

The `executionMode` property in `CopyConfig` supports three distinct strategies: **parallel** submission sends all wallet transactions simultaneously; **bundled** submission uses Jito bundle APIs for atomic inclusion; and **sequential** submission processes wallets one at a time with error handling between each step. This configuration is passed through `SwarmTradeParams` to `coordinatedBuy` or `coordinatedSell`.

### Why does the EVM implementation only support single-wallet copy trading?

According to [`src/trading/copy-trading.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/trading/copy-trading.ts), the EVM module lacks multi-wallet coordination because Ethereum’s cryptographic model requires each wallet to sign its own transactions independently. Unlike Solana’s program-derived address system that allows centralized transaction building, EVM chains cannot batch-sign transactions for multiple private keys in a single coordinated operation, forcing 1:1 trade replication rather than 1:many swarm execution.

### How does CloddsBot filter which trades to copy from target wallets?

The filtering layer uses the `CopyConfig` interface applied in [`src/solana/swarm-copytrade.ts`](https://github.com/alsk1992/CloddsBot/blob/main/src/solana/swarm-copytrade.ts) to validate every `DetectedTrade` against criteria including **multiplier** scaling, **maxSolPerTrade** limits, **delayMs** timing, and **tokenWhitelist** or **blacklist** restrictions. Trades failing any constraint are discarded before reaching the `SwarmInterface` coordination methods, preventing unwanted exposure to specific tokens or oversized positions.