- A WebSocket listener that fires on every trade by the target wallet
- A handler that translates target-wallet trades into orders for your own execution layer
- A scale-and-execute path that mirrors on the same venue
Predexon supplies the detection side: the real-time fill stream and the wallet analytics to vet your target. Execution happens through the venue’s own API (e.g. the Polymarket CLOB client) — shown below as a stub you wire to your client of choice.
Architecture
Step 1 — Verify the target
Before mirroring, check they’re actually profitable. Pull the wallet profile:Step 2 — Subscribe to their trades
The trades channel takes ausers filter. You’ll receive every fill they take in real time, on both V1 and V2 Polymarket contracts.
Step 3 — Scale and mirror
The hardest part of copy-trading is sizing. Mirror their trade as a fraction of their original size, capped by your venue balance. Execution goes through your own venue client:Step 4 — Run it under supervision
Things that will go wrong in production:
For the simplest possible production version, also subscribe to the activity channel to mirror splits, merges, and redemptions.
Variations
- Multi-wallet copy-trading: subscribe with
filters: {"users": [w1, w2, w3, ...]}and route each trade to the right end-user account in your DB. - Filtered copy-trading: only mirror trades above a notional threshold, or in specific market categories.
- Agent-driven copy-trading: replace the WebSocket loop with the Agent Cookbook recipe 4, which polls and reasons about whether to mirror.
Reference
- WebSocket trades channel — filter shape, event payload
- Wallet P&L — track how your mirrored book performs vs. the target
- Wallet Profile — for the daily target check
- Best Practices — WebSocket reconnect pattern
