Agent skill · starchild-ai-agent

pear-protocol

Pear Protocol pair/basket trading on Hyperliquid — headless agent-wallet auth (SIWE), V3 gateway REST + Orchard MCP server: markets, pair ratios, positions, orders, and trade execution. Use when the user wants to pair trade (long one asset / short another), check pair ratios, correlation or funding, or manage Pear positions (e.g. long BTC short ETH, check my Pear positions, find trending pairs).

What it needs

About 5k tokens when loaded.

What this skill does

🍐 Pear Protocol — Headless (agent wallet) Pair/basket trading on top of Hyperliquid: open a long and a short leg as one synthetic position. This skill uses HEADLESS auth only — the agent's own Privy wallet signs a SIWE login against the V3 gateway; no browser, no OAuth, no user interaction. Works out of the box for any Starchild agent. Endpoints V3 gateway (REST): https://pro-gateway.pearprotocol.io Orchard MCP: https://mcp.pearprotocol.io/mcp (streamable HTTP, stateless — accepts x-api-key directly; docs: https://docs.pear.garden) Auth — scripts/gateway.py (use this, don't hand-roll curl) Flow: POST /auth/nonce {address} → wallet.walletsign(message) (EIP-191; gateway accepts the smart-wallet address even though personalsign recovers to the underlying EOA — no EIP-1271 issue) → POST /auth/login {method:"wallet",address,signature} → accessToken (JWT ~15 min, auto-refresh/re-login). Tokens cached in workspace/.pear/gatewaytokens.json (0600). Single-flight nonce→login: concurrent nonce requests rotate the nonce and 401 the earlier signature. Which credential for which call Call type Auth Notes --- --- --- Gateway reads (markets, funding) x-api-key: $PEARAPIKEY persistent, read scope Gateway writes (orders, trade-accounts) Authorization: Bearer … apikey → 403; gateway.py auto-refreshes Account-scoped calls + x-trade-account-id: <id> mandatory once >1 account MCP server x-api-key directly gateway wallet Bearer is REJECTED on MCP (different token type) GET /markets REQUIRES ?connector=hyperliquid (291 markets: price, funding, OI, 24h vol/change). API-key scopes gate the MCP tool surface POST /api-keys (Bearer) body {"label": "...", "scope": "read" "readwrite"} (field is label NOT name; raw key returned ONCE). Read key → 16 analytics/account tools. readwrite → 32 tools, adding trading: plan/execute pairs for openbasket, closebasket, setpositiontpsl, rebalanceposition, adjustposition, enableautorebalance, plus syncaccount, cancelpendingorder, managesavedbasket. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills starchild-ai-agent/pear-protocol

View the source on GitHub

Browse the @skills marketplace