---
title: "Solana Copy Trading Bot Infrastructure | BlockRazor"
description: "Build a Solana copy trading bot with Geyser wallet updates. Identify executed swaps, cap follower orders and compare your fill price with the source trade."
canonical: https://blockrazor.io/trading-bots/copy-trading/
language: en
last-updated: 2026-12-03
---

# Solana copy trading bot infrastructure

A Solana copy trading bot watches a wallet for executed swaps and places a separately signed order from the follower’s wallet. Filter Geyser updates by the source address, confirm what it bought or sold, and set your own trade size and slippage limit. Record both signatures so you can compare the actual fills.

[HTML product page](https://blockrazor.io/trading-bots/copy-trading/)

## From wallet activity to a follower fill

1. **Receive wallet activity** — Filter transactions by the watched public key. Timestamp first receipt and retain the source slot and signature.
2. **Decode the swap** — Match DEX instructions and inner calls to the owner’s balance changes. Group routed legs and assign each independent swap an index.
3. **Build the follower order** — Size the buy from the source input or the sell from the follower’s available position. Check signal age and balance, then build a fresh swap with a minimum output.
4. **Sign as the follower** — Claim one intent per strategy, source signature and swap index. Sign with the follower wallet and store the bytes and signature.
5. **Submit and reconcile** — Send the follower transaction and track its signature independently. Reconcile the actual input and output after confirmation.

## Which wallet activity should trigger a copy?

### Transfer or swap?

A transfer can mention the watched wallet and change its balance. Require a successful supported swap and verify the owner’s input and output amounts against its instructions.

### Buy or sell?

Choose a base token for the pair. A buy increases the wallet’s base balance in exchange for quote tokens. A sell reverses those flows. Account for fees and token decimals before sizing the follower order.

### One route or several trades?

Trace each route through its inner calls and reconcile the owner’s net input and output once. Give separate swaps in the same source transaction distinct indices so replay can deduplicate each one.

## Choose services by chain

### Solana

Use Geyser Stream’s wallet filter, decode the source swap and quote a fresh follower order. Send the follower’s signed transaction through Send Transaction and reconcile both signatures.

[Geyser Stream](https://docs.blockrazor.io/streams/block-stream/solana/geyser-stream) · [Send Transaction](https://docs.blockrazor.io/transaction-submission/transaction-sending/solana/send-transaction)

### BSC

Use Public Mempool to spot pending router calls from a watched wallet. Add Private Mempool when its disclosed fields let you identify a relevant trade. Verify the source swap in the receipt and logs before sizing the follower order. Sign with the follower’s own nonce and submit via Broadcast Tx.

[Public Mempool](https://blockrazor.io/products/public-mempool/) · [Private Mempool](https://blockrazor.io/products/private-mempool/) · [Broadcast Tx](https://docs.blockrazor.io/transaction-submission/transaction-sending/bsc/broadcast-tx)

[Explore all supported chains](https://blockrazor.io/trading-bots/#chain-services)

## Subscribe to a wallet and size its next buy

Connect a Yellowstone client to your provisioned Geyser endpoint using the credentials and transport settings in the integration guide. Replace the placeholder below with the target public key and include this filter in the subscription request.

```jsonc
// Yellowstone SubscribeRequest · transactions filter
{
  "transactions": {
    "wallet": {
      "vote": false,
      "failed": false,
      "accountInclude": ["<WATCHED_WALLET_PUBKEY>"]
    }
  }
}
```

Suppose the wallet spends 2 SOL in a supported swap. With a 10% copy rule and a 0.15 SOL cap, quote 0.15 SOL. Skip execution if the signal has expired or the quote breaches the price limit. Persist an intent keyed by strategy, source signature and decoded swap index before signing. Submit the signed transaction and associate the follower signature with that intent.

## How to test your implementation

### Signal arrival

Match the same source swap on two wallet feeds at the same commitment. On one host, compare the first receipt timestamps and report p50, p95 and the number seen on only one feed. Tag backfilled events separately.

### Submission latency

Record receipt, decode, build, sign, first send and acknowledgement on one monotonic clock. For buys and sells separately, report p50 and p95 for receipt-to-send and send-to-ack. Count signals skipped for age before submission.

### Follower fills

Within a fixed confirmation window, tally successful, failed, expired and unresolved follower orders against all unique submissions. For confirmed pairs compare quote tokens per base token on the same side and fee basis. Record the slot gap and price deviation from the source.

### Replay and duplicates

Replay an eligible buy, a sell, a transfer and the same buy again after a disconnect. Expect one buy and one sell. Count any extra executions linked to the same strategy and source swap.

## FAQ

### How do I stop a transfer from triggering an order?

An account match alone proves only that the wallet was referenced. Require a supported swap instruction and reconcile its direction against the owner’s input and output token deltas.

### How do I avoid copying a trade twice after reconnecting?

Resume with overlap from a persisted slot checkpoint, deduplicate source swaps and reconcile pending follower signatures before resending. If the gap exceeds the feed’s replay window, backfill from an archival source and apply signal expiry before execution.

### Why can a copy trading bot get a different price from the source wallet?

The source swap changes the pool before the follower can act. Other swaps, a different order size and time spent signing or submitting can move the quote further. Compare the effective price from both confirmed fills using the same fee treatment. For a sell, quote only the follower’s available position after reserved orders.

## Related workflows

[Sniping bot infrastructure](https://blockrazor.io/trading-bots/sniping.md)

## Resources

- [Trading bot infrastructure](https://blockrazor.io/trading-bots.md)
- [BlockRazor (English)](https://blockrazor.io/llms.txt)
- [BlockRazor（繁體中文）](https://blockrazor.io/zh/llms.txt)
- [Developer documentation index](https://docs.blockrazor.io/llms.txt)
