Appearance
Copy trading
Mirror a proven trader's positions automatically. Not built as a Blazpay product yet — but a working, backtested engine already exists, and the decision is to productise that rather than build a new pipeline.
Status: not started, direction decided
A user decision on 2026-07-24 redirected this workstream. The original plan was an EVM copy pipeline built from scratch inside bz-backend. That was dropped in favour of wrapping the existing copytrade-agent repo. The Autopilot copy strategy type was also dropped from v1.
The existing engine
Location: ~/Documents/code/personal-agents/copytrade-agent (outside defi-set).
It is a Hyperliquid perpetuals position-mirror, not a spot copier. That is a meaningful product difference — it copies leveraged perp positions on one venue, rather than spot trades across many chains.
| Capability | Detail |
|---|---|
| Mirroring | posmirror.js is the active implementation. mirror.js is legacy |
| Trader discovery | Hyperliquid leaderboard plus kolscan |
| Signals | WebSocket userFills plus a 60-second poll |
| Confidence scoring | Wilson interval, profit factor, payoff ratio, recency weighting |
| Rollout ladder | Friction-adjusted shadow → live progression |
| Risk control | Kill switch |
| Storage | MongoDB database agents, collections copytrade_* |
| Control surface | Telegram bot |
| Analysis | Standalone backtester |
| Tenancy | Single account, no HTTP API, monorepo-shared libs |
CT-0 is a secret rotation, and it blocks everything
copytrade-agent's config.json has committed live secrets: a Telegram bot token, a Helius API key, and a Hyperliquid API-wallet private key. Rotate all three and blank the file before any other work on this product. Nothing else on the roadmap should start first.
The plan
Two phases, per defi-set/AUTOPILOT_AND_COPYTRADE_PLAN.md §2.
CT-1 — Hyperliquid native vault
Ship a single-vault product where users deposit into a Hyperliquid native vault that the existing engine trades.
| Piece | Work |
|---|---|
| Engine change | One change only — vault-flag signing in lib/hl-trade.js, currently hardcoded to 0x00 |
| Backend | A read-only Mongo bridge in bz-backend exposing the copytrade_* collections |
| Frontend | A /copy page in defi-dex |
| BlazAI | A read-only COPY_TRADE intent — status and performance, no execution |
The appeal of CT-1 is that Hyperliquid's native vaults handle deposits, accounting and withdrawals. Blazpay does not need a custody contract, and the engine does not need multi-tenancy — it trades one vault.
CT-2 — per-user Hyperliquid agent wallets
Each user gets their own Hyperliquid agent wallet, and the engine mirrors into all of them. This requires a genuine multi-tenant refactor of a codebase written for one account, and is deliberately scoped later.
Why not the original EVM design
The dropped plan was to detect a tracked wallet's on-chain swaps, quote the equivalent through swap-sdk, and execute it from an Autopilot-style vault. It was abandoned because:
- Latency. By the time an EVM swap is indexed, quoted and re-executed, the price has moved. Perp mirroring on a single venue with a WebSocket fill feed is an order of magnitude tighter.
- Signal quality. A wallet's swaps do not reveal position sizing, leverage or intent. Hyperliquid fills do, and the leaderboard provides a ranked, verifiable universe of traders.
- It already works. The existing engine is backtested and has run live. Rebuilding it inside
bz-backendwould have thrown that away.
What Blazpay would need to add
Regardless of phase:
| Concern | Why it is new work |
|---|---|
| Non-custodial framing | Hyperliquid vaults are custodial to Hyperliquid. That has to be stated plainly, because every other Blazpay product is not |
| Fee model | Undecided. Hyperliquid vaults have their own profit-share mechanics |
| Trader disclosure | Which traders, by what criteria, with what historical record shown — a compliance-adjacent surface |
| Drawdown communication | Copying a leveraged trader can lose most of a deposit. The UI has to say so before the deposit, not after |
| Kill switch in the product UI | The engine has one; users need to reach it |
| Multi-tenancy (CT-2 only) | The engine assumes one account throughout |
Under the hood (today, in the standalone repo)
| Concern | Where |
|---|---|
| Position mirror | posmirror.js |
| Trade signing | lib/hl-trade.js — the vault flag is the CT-1 change |
| Discovery | Hyperliquid leaderboard + kolscan integrations |
| Scoring | Wilson / profit factor / payoff / recency |
| Data | Mongo agents DB, copytrade_* collections |
| Control | Telegram bot |
| Backtesting | Standalone |
Known limits
- Nothing is exposed to Blazpay users today. There is no route, no API and no intent.
- The secrets in
config.jsonare live. See the CT-0 warning above. - It is a Hyperliquid product, not a multi-chain one. Framing it as "copy trading on Blazpay" without naming the venue would be misleading.
- Single-account architecture means CT-1's ceiling is one shared vault, not per-user strategies.