SkillAgentSearch skills...

Invo Copy Trader

Autonomous AI copy trading agent — Invo social layer + Hyperliquid DEX execution

Install / Use

npx skills add AKCodez/invo-copy-trader

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

 ___  ________   ___      ___ ________          ________  ________  ________  ___    ___ 
|\  \|\   ___  \|\  \    /  /|\   __  \        |\   ____\|\   __  \|\   __  \|\  \  /  /|
\ \  \ \  \\ \  \ \  \  /  / | \  \|\  \       \ \  \___|\ \  \|\  \ \  \|\  \ \  \/  / /
 \ \  \ \  \\ \  \ \  \/  / / \ \  \\\  \       \ \  \    \ \  \\\  \ \   ____\ \    / / 
  \ \  \ \  \\ \  \ \    / /   \ \  \\\  \       \ \  \____\ \  \\\  \ \  \___|\/  /  /  
   \ \__\ \__\\ \__\ \__/ /     \ \_______\       \ \_______\ \_______\ \__\ __/  / /    
    \|__|\|__| \|__|\|__|/       \|_______|        \|_______|\|_______|\|__||\___/ /     
                                                                          \|___|/       
<div align="center">

Autonomous AI Copy Trading Agent

Reverse-engineered Invo social layer + Hyperliquid DEX execution Powered by Claude Code


preflight | discover | follow | monitor | trade | close

</div>

What is this?

A fully autonomous copy trading system that connects Invo (social trading platform) with Hyperliquid (decentralized perpetual exchange). An AI agent discovers top-performing traders, follows them, monitors their trades in real-time, and mirrors their positions — all through reverse-engineered APIs. No browser automation. Pure Node.js.

How it works: The agent scans Invo's social feed for verified trade signals from followed traders. When a trader opens or closes a position, the feed emits a post containing the full trade details (coin, direction, leverage, entry price) plus Invo metadata needed to record the copy trade. The agent evaluates the signal against your configured risk criteria and executes on Hyperliquid, recording the position on both platforms.

┌─────────────────────────────────────────────────────────────────┐
│                                                                 │
│   Claude Code (AI Agent)                                        │
│   ├── Reasoning & risk analysis                                 │
│   ├── Signal evaluation against user criteria                   │
│   └── Autonomous trade execution                                │
│         │                                                       │
│         ▼                                                       │
│   Node.js CLI                                                   │
│   ├── preflight.ts  ── 10-point readiness check                 │
│   ├── discover.ts   ── scan & rank 100+ traders                 │
│   ├── follow.ts     ── social graph management                  │
│   ├── monitor.ts    ── event-driven signal detection            │
│   ├── trade.ts      ── open position (HL + Invo)                │
│   └── close.ts      ── close position (HL + Invo)               │
│         │                                                       │
│    ┌────┴────────────────────┐                                  │
│    ▼                         ▼                                  │
│   Invo REST API         Hyperliquid SDK                         │
│   (auto-refresh JWT)    (phantom agent signing)                 │
│   ├── Discovery         ├── Meta & prices                       │
│   ├── Social feed        ├── Set leverage                       │
│   ├── Follow/unfollow   ├── Place orders (IOC)                  │
│   ├── Position create   ├── Close positions                     │
│   └── Position close    └── Account state                       │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Quick Start

# Clone
git clone https://github.com/AKCodez/invo-copy-trader.git
cd invo-copy-trader

# Install
npm install

# Configure (see Credentials section below)
cp .env.example .env
# Edit .env with your credentials

# Pre-flight check
npx tsx src/commands/preflight.ts

# Run via Claude Code skill
/invo-copy-trade
<!-- SKILL_INSTALL_PLACEHOLDER --> <!-- Installation instructions for the Claude Code skill will be added here once published to the skills marketplace. -->

Commands

All commands run via npx tsx src/commands/<cmd>.ts.

| Command | Purpose | Example | |---|---|---| | preflight.ts | Full readiness check (10 checks) | npx tsx src/commands/preflight.ts | | verify.ts | Endpoint health check (8 endpoints) | npx tsx src/commands/verify.ts | | discover.ts | Scan & rank top traders | npx tsx src/commands/discover.ts | | follow.ts | Follow/unfollow traders | npx tsx src/commands/follow.ts follow <userId> | | monitor.ts | Real-time signal monitor | npx tsx src/commands/monitor.ts '["portfolioId"]' | | monitor.ts | Feed + trade polling | npx tsx src/commands/monitor.ts '["pId"]' '[{"baseShortId":"x","mimicStartedAt":"..."}]' | | monitor.ts | Wait-for-signal mode | npx tsx src/commands/monitor.ts --wait-for-signal '["id"]' | | trade.ts | Open a position | npx tsx src/commands/trade.ts SOL long 0.14 5 | | close.ts | Close a position | npx tsx src/commands/close.ts SOL [baseShortId] |

Signal Detection

The monitor watches the Invo social feed for verified trade signals from followed traders. Each signal contains:

Feed post (postTypeId: "investment" | "update")
  └── update
      ├── ticker          → coin (SOL, BTC, ETH)
      ├── directionLong   → true = long, false = short
      ├── leverage         → leverage used
      ├── entryPrice       → entry price
      ├── closingPrice     → exit price (on close)
      ├── isOpen           → position state
      ├── verifiedTrade    → confirmed real Invo trade
      ├── portfolio.id     → portfolioId (for mimicMeta)
      ├── owner.id         → creatorInvoUserId (for mimicMeta)
      ├── baseId           → trade base ID (for mimicMeta)
      └── baseShortId      → needed to close on Invo

Two monitor modes:

| Mode | Behavior | Use case | |---|---|---| | Default | Runs forever, prints JSON lines | Manual monitoring, log tailing | | --wait-for-signal | Exits after first new signal | Agent auto-notify (zero token burn while waiting) |

In --wait-for-signal mode, the Node.js process polls server-side (free) and the AI agent is idle until a signal arrives. Event-driven, not polling-driven.

Copy Trading Flow

Signal detected: @trader opened SOL long 8x
  │
  ├── 1. Evaluate against locked-in criteria
  │      ├── Leverage ≤ max? (e.g., 8x ≤ 20x ✓)
  │      ├── Asset allowed? (SOL not blocked ✓)
  │      ├── Trader WR ≥ auto-copy threshold? (86% ≥ 80% ✓)
  │      └── Position size within limit? (30% of balance ✓)
  │
  ├── 2. Execute on Hyperliquid
  │      ├── Set leverage (8x isolated)
  │      ├── Place IOC limit order (+2% slippage, builder fee)
  │      └── Verify fill
  │
  ├── 3. Record on Invo
  │      ├── POST /dex/position/create
  │      ├── mimicMeta from signal (portfolioId, ownerId, baseId)
  │      └── Save baseShortId for exit
  │
  └── 4. Monitor for exit
         └── When trader closes → mirror the exit via close.ts

Exit strategy: mirror the trader. We close when they close. No independent TP/SL — the whole point of copy trading is trusting the trader's entries AND exits.

Credentials Setup

Create a .env file in the project root:

INVO_REFRESH_TOKEN=eyJ...   # 350-day JWT (see below)
HL_AGENT_KEY=0x...           # Hyperliquid phantom agent key
WALLET_ADDRESS=0x...         # Master wallet address

How to obtain each credential

INVO_REFRESH_TOKEN (valid ~350 days)

  1. Open app.invoapp.com in Chrome, log in
  2. F12 -> Application -> Local Storage -> app.invoapp.com
  3. The value of FlutterSecureStorage.REFRESH_TOKEN is AES-GCM encrypted
  4. Decrypt using the key in the FlutterSecureStorage entry (base64 AES-GCM key)
  5. The decrypted value is a JWT — that's your refresh token

HL_AGENT_KEY (valid ~90 days)

  1. F12 -> Application -> IndexedDB -> invo_hl_agents -> agents -> current
  2. Copy the privateKey field (starts with 0x)
  3. This is a secp256k1 key authorized as a phantom agent sub-key

WALLET_ADDRESS

  1. Visible in your Invo profile page
  2. Or in the JWT payload under trading_account.wallet_address

Credential lifespan

| Credential | TTL | Renewal | |---|---|---| | INVO_REFRESH_TOKEN | ~350 days | Re-extract from browser | | HL_AGENT_KEY | ~90 days | Re-authorize in Invo app | | WALLET_ADDRESS | Permanent | Never changes |

The system auto-refreshes short-lived access tokens (10-min TTL) using the refresh token. No manual token management after initial setup.

Reverse-Engineered API Surface

Invo REST API (api.invoapp.com)

All requests use Authorization: Bearer <jwt>, Content-Type: application/json, x-app-version: 0.0.75, x-platform: web.

GET  /v1_0/auth/refresh_token           → Refresh access token (10-min → 350-day cycle)
POST /v1_0/trending/get_portfolios_pl   → Discover traders (filters: trending, all, user)
POST /v1_0/trending/get_users           → Trending users
POST /v1_0/posts/get_feed               → Social feed (filters: trending, following, all)
POST /v1_0/users/follow                 → Follow user
POST /v1_0/users/unfollow               → Unfollow user
POST /dex/account/ready                 → Account readiness check
POST /dex/trade                         → Trade status polling
POST /dex/position/create               → Record open in Invo wallet
POST /dex/position/close                → Record close in Invo wallet
GET  /investment/status/:id             → Investment status

Hyperliquid Exchange

Accessed via the hyperliquid npm SDK with phantom agent signing:

POST api.hyperliquid.xyz/info  → Meta, prices, positions
SDK  exchange.placeOrder()     → IOC limit orders with builder fee
SDK  exchange.updateLeverage() → Set leverage (isolated)

Builder fee: 0x557edb253b1d7ed5f15b248a5a3fd919fa5d3c81 at 0.35% — required on all orders for Invo compatibility.

Related Skills

View on GitHub
GitHub Stars9
CategoryDevelopment
Updated1d ago
Forks2

Languages

TypeScript

Security Score

70/100

Audited on Aug 7, 2026

No findings