Copy-trade mirror
Mirror a Hyperliquid or Polymarket trader with strict size caps.
Build it in MemeLex →What it builds
TypeScript. Poll the leader's positions (Hyperliquid info clearinghouseState, or Polymarket data API positions), diff, scale by COPY_RATIO, clamp to MAX_POSITION_USD, skip if DAILY_LOSS_LIMIT hit, place orders only when LIVE_TRADING=true. Tests for diff + sizing + caps.
- Venue: Hyperliquid or Polymarket CLOB API
- Places orders: paper/dry-run by default, max position, daily loss limit and kill switch. Live mode needs LIVE_TRADING=true.
- Keys only from your local .env. README covers the venue's API terms, rate limits and regional restrictions.
Sample project
files
src/index.ts src/leader.ts src/sizing.ts src/executor.ts test/sizing.test.ts config.json .env.example package.json README.md
sample output
[PAPER] leader +2.0 SOL-PERP → mirror +0.20 (capped at $500) · kill switch: off
MemeLex generates code, not trade calls. Not financial advice.