Recipe — Copy flow
The copy flow is two products composed: the Intelligence API decides what is worth copying, the copytrading SDK moves how it gets copied. A flow that skips the first half ships a venue leaderboard with a buy button; the vetting is what makes it a product.
The shape of the flow
- Browse — a Leaderboard screen (
trader-board/copy/strategies). - Vet — a Trader page (
wallet-overviewfor spot,perp-walletfor Hyperliquid). - Decide the size —
copy-plan/perp-copy-decision(below). - Activate — the SDK's five calls (Quickstart).
- Feed —
listExecutions+ webhooks, skips included.
Vet before you copy
Beyond the dossier, two endpoints answer the sizing question directly:
POST /v1/copy-plan
{ "wallet": "0xFOLLOWER…", "leadWallet": "0xLEADER…", "chain": "eth" }
# → { copy, plan: { capitalPct, allocationUsd, perPositionCapPct, exclusions }, warnings[] }
POST /v1/perp-copy-decision
{ … leverage/liq/funding inputs … }
# → { copy, maxLeverage, sizeFactor, liqDistancePct, fundingCostDaily, flags[] }
copy-plan's warnings[] and exclusions are written to be rendered in the confirmation sheet — the user should see why the suggested size is what it is. Adding a second leader? POST /v1/copy-overlap says whether the new one is redundant against the copies they already run.
Execute with the SDK
import { CopyTradingClient, createWalletAuthHeaders } from 'copytrading'
const client = new CopyTradingClient({
baseUrl: API_URL,
apiKey: PARTNER_KEY,
getAuthHeaders: createWalletAuthHeaders({ address: userAddress, signer: personalSigner }),
})
const venues = await client.listVenues()
const leaders = await client.listLeaders({ venue: 'hyperliquid-perps' })
const { agentId } = await client.createAgent({ venue: 'hyperliquid-perps', smartAccountAddress: userAddress, leaderWalletAddress: leaders[0].address, riskConfig: { maxUsd: '500', copyPercent: 10 } })
await client.activate(agentId, signer)
const { executions } = await client.listExecutions(agentId)
The full walkthrough — signer requirements, spot smart sessions, webhooks — is the Copy Trading Quickstart; the SDK also ships INTEGRATE.md, a single self-contained file for AI coding agents.
UX rules
- Render
assessment.reasonson every leader.listLeadersis the board after copyability gates; the plain-language reasons are the product.assessment.evidencetells you whether the verdict rests on real trade history (closed-trades) or only the venue's own figures (venue-only) — surface the difference. - Show skipped executions.
status: 'skipped'+skipReason(slippage_exceeded,edge_exhausted, …) is the system refusing a losing trade. A labelled skip reads as protection; a silent gap reads as a bug. expired≠paused. Expired credentials (spot sessions, Polymarket) need a freshactivate()— a resume button will not work. Route expired agents to re-activation and subscribe to theagent.session_expiringwebhook.- Thin perp profiles carry their own why. When
perp-walletreturnscoverage.reason !== 'ok', showcoverage.notein the vetting sheet — an honest "too new to judge" prevents a bad copy better than a blank card.