Skip to content

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.

CapabilityDetail
Mirroringposmirror.js is the active implementation. mirror.js is legacy
Trader discoveryHyperliquid leaderboard plus kolscan
SignalsWebSocket userFills plus a 60-second poll
Confidence scoringWilson interval, profit factor, payoff ratio, recency weighting
Rollout ladderFriction-adjusted shadow → live progression
Risk controlKill switch
StorageMongoDB database agents, collections copytrade_*
Control surfaceTelegram bot
AnalysisStandalone backtester
TenancySingle 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.

PieceWork
Engine changeOne change only — vault-flag signing in lib/hl-trade.js, currently hardcoded to 0x00
BackendA read-only Mongo bridge in bz-backend exposing the copytrade_* collections
FrontendA /copy page in defi-dex
BlazAIA 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-backend would have thrown that away.

What Blazpay would need to add

Regardless of phase:

ConcernWhy it is new work
Non-custodial framingHyperliquid vaults are custodial to Hyperliquid. That has to be stated plainly, because every other Blazpay product is not
Fee modelUndecided. Hyperliquid vaults have their own profit-share mechanics
Trader disclosureWhich traders, by what criteria, with what historical record shown — a compliance-adjacent surface
Drawdown communicationCopying 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 UIThe 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)

ConcernWhere
Position mirrorposmirror.js
Trade signinglib/hl-trade.js — the vault flag is the CT-1 change
DiscoveryHyperliquid leaderboard + kolscan integrations
ScoringWilson / profit factor / payoff / recency
DataMongo agents DB, copytrade_* collections
ControlTelegram bot
BacktestingStandalone

Known limits

  • Nothing is exposed to Blazpay users today. There is no route, no API and no intent.
  • The secrets in config.json are 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.

Internal + developer documentation. Usage figures are point-in-time snapshots — re-verify before publishing them.