Book a free call

How to Build a Crypto Copy Trading Bot

A copy trading bot repeats a leader's trades in your account. Build it with a sizing rule, risk limits and paper testing before it touches real money.

Hertiv engineering teamReviewed by a senior engineer
6 min read
How to Build a Crypto Copy Trading Bot
On this page

Short answer

A copy trading bot is software that repeats a chosen trader's orders in your own account, sized to fit your balance. You build one by connecting to an exchange API, reading the leader's trades, applying a sizing rule, and adding risk limits that stop copying after a set loss. Test it on paper first, then with tiny amounts, before trusting it with real money.

What is a copy trading bot?

A copy trading bot is software that watches a chosen trader, called the leader, and repeats that trader's trades in your own account. When the leader buys, the bot buys; when the leader sells, the bot sells, sized to fit your account.

The bot does not decide what to trade on its own. It reads the leader's orders through an exchange connection and copies them, usually within seconds. The skill is in the copying rules: how much to risk per trade, when to stop, and which leaders to follow.

Copy trading bots differ from ordinary trading bots, which follow a fixed strategy such as a moving average or an arbitrage gap. A copy bot follows a person, so its results depend on that person's decisions as much as on the code.

How does a copy trading bot work?

A copy bot has five parts that run in a loop: a leader source, a signal reader, a sizing rule, an execution step, and a risk check. Each part can fail on its own, so the bot checks every trade before it places an order.

PartWhat it doesWhat can go wrong
Leader sourceTrader orders or wallet activityLeader changes strategy silently
Signal readerReads orders within secondsDelayed or missed signals
Sizing ruleScales each trade to your accountOne trade risks too much
ExecutionPlaces orders on your exchangeSlippage on fast markets
Risk checkStops copying at your limitsLimits set too loose

Speed matters because the leader's price is rarely your price. If the leader buys at $100 and your copy fills at $102, the two percent gap comes out of your return. That is why the bot should measure fill prices and stop copying when the gap grows.

What do you need before you build one?

You need an exchange account with API access, a leader worth copying, and a small test budget you can afford to lose. The API key should allow trading but never withdrawals, and it should be stored as a secret, not written into the code.

Pick the leader by record, not by followers. Look for a trader with at least six months of public history, a drawdown you can live with, and trades in markets you understand. A leader who changes strategy every month is a warning sign, not a feature.

Decide your risk rules before you write code. Set a maximum amount per copied trade, a daily loss limit, and a total loss limit that stops the bot. Writing these down first keeps the build honest about what the bot is allowed to do.

How do you build a copy trading bot in six steps?

Build in small steps and test each one on a testnet or with tiny amounts. A bot that places real orders before its risk checks are tested is a fast way to lose money.

  1. Connect to the exchange API with a trade-only key, and read your balance and open orders.
  2. Add the leader source: an exchange copy feed, a public wallet watcher, or a trading signal channel.
  3. Write the sizing rule: copy each trade as a fixed share of your account, never a fixed dollar amount.
  4. Add the execution step: place a market or limit order, then confirm the fill price and size.
  5. Add risk checks: per-trade cap, daily loss limit, and a stop that halts copying after a drawdown.
  6. Add logging for every signal, order, fill, and error, so you can replay any day.

Keep the leader source separate from the trading logic. If you switch leaders later, only the source changes and the sizing and risk code stays the same.

How should the bot size positions and limit risk?

Size each copied trade as a share of your account, not as a copy of the leader's size. If the leader risks $1,000 per trade on a $100,000 account and your account holds $5,000, your copy should risk $50, which is the same one percent.

Cap the total amount the bot can have open at once. A common rule is no more than five copied trades open at the same time, and no more than a quarter of the account at risk. These caps matter most when the leader trades often.

Set a stop that halts copying after a set loss. A daily loss limit of two percent and a total drawdown limit of ten percent are starting points, not rules. The right numbers depend on how much you can afford to lose without changing your behaviour.

How do you test a copy trading bot safely?

Test on paper first. Run the bot against live leader signals for two weeks without placing orders, and record what it would have done. If the paper results look wrong, the sizing or the signal reading is wrong.

Move to a testnet or a tiny live account next. Use the smallest amounts the exchange allows, and check that fills, fees, and error handling behave as expected. A test that only runs when markets are calm proves nothing.

Watch the first live month closely. Compare your fills with the leader's fills, check that the risk limits trigger when they should, and keep a log of every surprise. Only raise the amounts after a full month with no unexplained behaviour. If a limit fails to trigger, stop the bot and fix it before the next trading day.

Example (hypothetical): one month of copying a trader

Example (hypothetical): a follower account holds $5,000 and copies a leader at $200 per trade, with at most five trades open at once. In one month the leader places 20 trades: 12 win an average of 2 percent, and 8 lose an average of 1.5 percent.

The wins add 12 times $200 times 2 percent, which is $48. The losses take 8 times $200 times 1.5 percent, which is $24. The gross result is $24 ahead. Fees of 0.1 percent on 20 trades of $200 come to $4, leaving a net gain of $20 for the month.

The example also shows the gap that matters most. The leader's own result on the same trades would be higher, because the follower pays fees and sometimes fills at a worse price. A bot that ignores fees and fills will always look better on paper than in a real account.

What are the common mistakes?

The most common copy trading bot mistakes are copying a leader without checking the record, sizing trades in dollars instead of percentages, and running without a loss limit. Each one turns a small error into a large loss.

  • Following a leader with a short public history or no losing months on record.
  • Copying trade sizes in dollars, so a large leader trade risks too much of your account.
  • Skipping the paper-trading test and going live on the first day.
  • Storing API keys in the code instead of as secrets.
  • Leaving the bot running during exchange maintenance or market halts.

The quietest mistake is trusting the bot and stopping to check it. A leader can change strategy, an API can fail, and a market can move faster than the copy loop. A daily check of fills, fees, and limits is part of running the bot, not an extra.

Key takeaways

  • A copy bot repeats a leader's trades, sized to fit your account
  • Size each trade as a share of your account, never in dollars
  • Set a per-trade cap, a daily loss limit, and a drawdown stop before going live
  • Paper-test for two weeks, then run tiny amounts for a month
  • Log every signal, order, fill, and error so any day can be replayed

Frequently asked questions

Is copy trading legal?

Copy trading itself is legal in most places, but the rules differ by country. Some regions treat copied trades as investment advice, which needs a licence. Check the rules where you and your users live before offering copy features, and never promise returns.

How much money do I need to start copy trading?

You need enough to survive a losing run without changing your rules. Many traders start with a few hundred dollars and risk no more than one percent per copied trade. The bot's sizing rule matters more than the starting balance.

Can a copy trading bot lose all my money?

Yes, if it has no loss limit. A leader can hit a losing streak, and a bot without a daily loss limit or a drawdown stop will keep copying. Set a total loss limit that halts the bot, and never let it trade money you cannot afford to lose.

What is the difference between a copy bot and a trading bot?

A trading bot follows a fixed strategy, such as a moving average or an arbitrage gap, and decides trades from market data. A copy bot follows a person: it repeats a leader's trades. Its results depend on the leader's decisions as much as on the code.

Should I copy one leader or several?

Copying several leaders spreads the risk, but it also spreads your attention. Start with one leader whose record you understand, learn how the bot behaves, and only add a second leader after a month of clean operation. More leaders do not fix a bad sizing rule.

How do I pick a leader to copy?

Look for at least six months of public history, a drawdown you can live with, and trades in markets you understand. Avoid leaders with no losing months on record or a strategy that changes every month. Past results never guarantee future results.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a trading bot or a copy feature? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Crypto Exchange service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call