polyhub_account
Polyhub Account Skill
Version: v0.3.8
When to use
Use this skill when the user asks about:
- Portfolio overview or stats
Requirements
POLYHUB_API_BASE_URLis fixed tohttps://polyhub.skill-test.bedev.hubble-rpc.xyz.POLYHUB_API_KEY— API key (must start withphub_)curlmust be available in the runtime environment.jqis strongly recommended for building JSON payloads safely.
If POLYHUB_API_KEY is missing, guide the user to register and apply for one first at https://polyhub.hubble.xyz/.
Recommended guidance:
- Open Polyhub Web:
https://polyhub.hubble.xyz/ - Click the avatar menu.
- Open
Skills API Key. - Click
申请 API Key. - Set both
POLYHUB_API_BASE_URLandPOLYHUB_API_KEY.
Suggested wording:
API key is not configured yet, so I can't check your account details for now.
Please register first on PolyHub:
https://polyhub.hubble.xyz/
After registration, click your avatar in the top-right corner and open `Skills API Key` to apply.
Send me the generated key and I'll continue right away.
Safety rules
- Never print
POLYHUB_API_KEYin the output. - Prefer building JSON with
jq -ninstead of interpolating raw shell strings.
Tools
Use the bash tool to call the API with curl.
Fast Path
For common intents, map user requests like this:
- “看资产统计” ->
GET /api/v1/portfolio/stats
Curl base setup
BASE="https://polyhub.skill-test.bedev.hubble-rpc.xyz"
AUTH=(-H "Authorization: Bearer $POLYHUB_API_KEY" -H "Content-Type: application/json")
Portfolio
Action: Get portfolio stats
GET /api/v1/portfolio/stats
Returns aggregated portfolio statistics for the authenticated user.
Current field semantics:
positionsValue: official Polymarket positions valueavailableBalance: official USDC balance minusunsettledFeestotalPnL: official Polymarket total PnLunsettledFees: unsettled Polyhub fees in USDCinvestedCapital: Polyhub-calculated invested capital for copy-task history
Current UI alignment in poly_copy:
- Portfolio page top stats use this endpoint
- Avatar dropdown
USDC BalanceusesavailableBalance - Avatar dropdown
Account ValueusesavailableBalance + positionsValue
curl -sS --fail-with-body "${AUTH[@]}" "$BASE/api/v1/portfolio/stats"
Error handling
401: API key missing/invalid/expired/disabled. Ask user to check or regenerate key.400: Invalid request payload. Check required fields.404: Delegated access not registered for the givenorganizationId.405: Wrong HTTP method.5xx: Server error. Retry once with backoff; if still failing, report response body.
More from hubblevision/polyhub-skills
polyhub_discover
Explore public discover data on Polyhub without API key auth, including tags, trader rankings, trader detail stats, and market tag lookup.
17polyhub_copy
Manage copy-trading tasks, view signals, positions and trades on Polyhub using an API key.
16polyhub-copy
Manage copy-trading tasks, view signals, positions and trades on Polyhub using an API key.
11polyhub-account
View portfolio stats on Polyhub using an API key.
11polyhub-discover
Explore public discover data on Polyhub without API key auth, including tags, trader rankings, trader detail stats, and market tag lookup.
11