How to Build Prediction Market Copy Trading With an API

The Short Answer
Watch the public tape with the trades channel or GET /api/{exchange}/fetchTrades, then mirror the fills you care about through POST /v1/exec/:venue/orders/build and submit. The honest limitation is that most venues do not tell you which trader a public fill belongs to, so following a named person is only possible where positions are onchain. Everything else is following flow, not a person.
Copy trading in prediction markets is a different problem from copy trading on a broker. There is no follow button and no venue-blessed leader board of people you can mirror. What exists is a public tape, and on some venues an onchain footprint you can attribute to a wallet. Wallet checkers are one way to choose who to follow, compared in Predictefy vs Predicts.guru.
This is what is actually buildable, what is not, and the execution details that decide whether a mirrored trade helps or hurts.
Key Takeaways
- Public trade feeds are anonymous on most venues. You can follow flow; following a person needs onchain data.
- You are always late. By the time a fill is public the price has usually moved against you.
- Mirror proportionally, not identically. Copying absolute size ignores that your bankroll is not theirs.
- Orders are built and submitted separately, and both need an
Idempotency-Key, which is what stops a retry becoming a double position. - One key covers 15+ venues, so the same follower logic works wherever the flow is.
What Is Actually Possible
| What you want | Is it possible |
|---|---|
| See every fill on a market as it happens | Yes, through the public tape |
| Know the size and side of those fills | Yes |
| Attribute a fill to a named trader | Only where positions are onchain and you already know the wallet |
| Subscribe to a leader through the venue | No. No venue offers this |
| Mirror your own positions across venues | Yes, through the account and execution endpoints |
Anyone selling a prediction market copy trading product that promises to follow named traders on centralised venues is either using onchain data for the onchain venues, or inferring identity from patterns. Inference is not attribution, and it is worth knowing which one you are buying.
Watching the Flow
const close = client.watchTrades(
{ venue: 'polymarket', marketId: '<outcome-id>' },
({ venue, marketId, trade }) => {
if (trade.shares < MIN_SIZE) return; // ignore retail noise
onLargeFill({
venue,
marketId,
side: trade.type === 'Buy' ? 'buy' : 'sell',
size: trade.shares,
price: trade.price,
tradeId: trade.id
});
}
);
Subscribes to executions on one market and filters to fills above a size threshold. Size is the only real signal in an anonymous tape: a large fill is more likely to be someone with a view than someone rounding out a position, though it is a weak proxy and it will sometimes be a market maker hedging.
For historical work rather than live following, fetchTrades returns a recent tape snapshot with id, timestamp, price, amount and side, which is useful for checking whether a follow strategy would have worked before you run it live.
You Are Always Late
This is the structural problem and no amount of engineering removes it.
A fill becomes public after it executes. By then the liquidity that trader consumed is gone, and the price you can get is worse than the price they got. On a thin prediction market book that difference can be several cents, which on a contract priced in cents is most of the edge.
The practical consequence is that a copy strategy needs a price guard, and it needs to be willing to skip.
async function mirror(fill) {
const venue = client.exchange(fill.venue);
// On Polymarket the stream's marketId is the outcome id.
const book = await venue.fetchOrderBook({ outcomeId: fill.marketId });
const averagePrice = await venue.getExecutionPrice(
book,
fill.side,
scaleSize(fill.size)
);
if (averagePrice === 0) return; // the book cannot fill that size
// Refuse to chase. A worse price than theirs is a different trade.
const slip = Math.abs(averagePrice - fill.price);
if (slip > MAX_SLIP) return;
await place(fill.venue, fill.marketId, fill.side, averagePrice);
}
Prices your intended size before committing and abandons the copy if the market has already moved too far. Without this guard a follower buys into exactly the move it was trying to ride, which is the most common way these systems lose money quietly.
Sizing Proportionally
Copying size one for one assumes your bankroll matches theirs. Scale to your own capital instead, and cap any single position regardless of what the signal says.
function scaleSize(theirSize) {
const scaled = Math.floor(theirSize * (MY_BANKROLL / ASSUMED_BANKROLL));
return Math.min(scaled, MAX_POSITION);
}
Turns their size into a proportion of your capital and applies a hard ceiling. The ceiling matters more than the ratio: one unusually large fill from a trader with far more capital than you should not become your entire position.
Placing the Order Safely
Execution is deliberately two steps, and both take an idempotency key.
const key = `copy-${fill.venue}-${fill.tradeId}`;
const artifact = await fetch(
`https://exec.predictefy.com/v1/exec/${fill.venue}/orders/build`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Idempotency-Key': key,
'Content-Type': 'application/json'
},
// Polymarket's build fields. The body is venue-specific.
body: JSON.stringify({ asset, isBuy, price, size, owner })
}
).then((r) => r.json());
// Sign client-side, then relay the signed order to /submit with the same key.
Builds an unsigned order artifact, which you sign yourself before submitting. Your keys never leave your control. Deriving the idempotency key from the source trade id means a retry after a timeout cannot open a second position for the same signal.
The Version That Definitely Works
Following strangers is uncertain. Mirroring yourself across venues is not, and it is often the more useful build.
If you trade the same view on several venues, read your positions with GET /v1/accounts/{venue}/{accountId}/positions and your fills with /fills, then keep the venues aligned automatically. That is copy trading with a leader whose reasoning you actually know, and it sidesteps the attribution problem entirely.
One Follower, Every Venue
Flow worth following is not confined to one venue, and building this per venue means a tape client, an order builder and a position reader for each, each with its own field names and its own signing scheme.
Predictefy exposes tape, books, execution and account state in one shape, with books across 15+ venues, so the follower above changes venue by changing a string. The API key is free to start with a monthly credit allowance, which is enough to run the watching side while you decide whether the strategy is worth executing at all.
Frequently Asked Questions
Can you copy trade on prediction markets?
Partly. You can watch every public fill and mirror the flow, but most venues publish trades anonymously, so following a named person only works where positions are onchain. No venue offers a follow button, so anything resembling one is built on public data.
Why does copy trading lose money even when the trader is good?
Because you are always late. A fill is public only after it executes, so the liquidity is gone and your price is worse. On thin books that difference is often several cents, which on a contract priced in cents is most of the edge you were copying.
Should I copy their position size?
No. Scale to your own capital and cap any single position. Copying absolute size assumes your bankroll matches theirs, so one unusually large fill from a better capitalized trader can become your entire book on a single signal. The ceiling matters more than the ratio.
How do I avoid opening the same position twice?
Use an idempotency key derived from the source trade id on both the build and submit calls. A network timeout that makes you retry then cannot create a second position, which is the most expensive bug in any automated follower.
Can I mirror my own positions across venues?
Yes, and it is the more reliable build. Predictefy returns positions and fills in one shape, and GET /v1/accounts/{venue}/capabilities shows what each of its 15+ venues serves, so several accounts stay aligned on the same view automatically. It also sidesteps the attribution problem entirely, since the leader is someone whose reasoning you already know.
Conclusion
Copy trading here is mostly flow following, and it is worth being clear-eyed about that before building. The tape is anonymous on most venues, you see fills only after they happen, and the price you get is by construction worse than the price you are copying.
If you build it anyway, the guards matter more than the signal: price limits that let the system skip a trade, proportional sizing with a hard cap, and idempotency keys so a retry never doubles a position. And if the goal is really consistency rather than following someone else, mirroring your own positions across venues gets you most of the benefit with none of the guesswork.
One housekeeping note: this is information, not financial advice. Venue capabilities and endpoints change, so confirm anything that matters against the current documentation before trading on it.