Communitygithub.com

OpenTrade 钱包投资组合 CLI

该技能用于查询钱包余额、代币持仓及投资组合总价值,支持 20+ 条区块链,包括 XLayer、Solana、Ethereum、Base、BSC、Arbitrum、Polygon 等。

OpenTrade 钱包投资组合 CLI 是什么?

OpenTrade 钱包投资组合 CLI 是一个专注于 DeFi 钱包查询的多链工具。它允许用户通过简单的命令行指令检查钱包总资产、所有代币余额或特定代币的余额。该技能支持超过 20 条区块链,包括 XLayer、Solana、Ethereum、Base、BSC 等,并自动解析链名称。它提供了四个核心命令:`opentrade portfolio chains` 查询支持的链、`opentrade portfolio total-value` 查询总资产价值、`opentrade portfolio all-balances` 查看所有代币持仓、以及 `opentrade portfolio token-balances` 查询特定代币余额。该技能通常作为投资组合入口点使用,并常与其他技能(如代币搜索、交换执行)配合,形成完整的交易工作流。它特别适用于用户发起如“检查我的钱包余额”、“显示我的代币持仓”或“我的投资组合值多少”等请求的场景。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/NeverSight/learn-skills.dev/tree/HEAD/data/skills-md/6551team/opentrade/opentrade-portfolio

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

OpenTrade 钱包投资组合 CLI 是做什么的?

4 个命令,用于支持的链、钱包总价值、所有代币余额以及特定代币余额。

起飞前检查

每次运行任何 opentrade 命令之前,务必按顺序执行以下步骤。不要将常规命令输出回显给用户;仅在安装、更新或处理失败时提供简短的状态更新。

  1. 确认已安装:运行 which opentrade。如果未找到,请安装:

    curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
    

    如果安装脚本失败,请要求用户按照以下说明手动安装:https://github.com/6551Team/openskills

  2. 检查更新:读取 ~/.opentrade/last_check 并与当前时间戳比较:

    cached_ts=$(cat ~/.opentrade/last_check 2>/dev/null || true)
    now=$(date +%s)
    
    • 如果 cached_ts 非空且 (now - cached_ts) < 43200(12 小时),则跳过更新并继续。
    • 否则(文件缺失或早于 12 小时),运行安装程序以检查更新:
      curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
      
      如果安装了新版本,请告知用户并建议他们从 https://github.com/6551Team/openskills 更新 opentrade 技能以获取最新功能。
  3. 如果在此会话期间任何 opentrade 命令因意外错误而失败,请在放弃前尝试重新安装:

    curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
    
  4. 在项目根目录找到或创建 .env 文件以覆盖默认 API 凭据。在执行 opentrade 操作前加载它。

    OPEN_TOKEN=your_token_here
    

    在 https://6551.io/mcp 获取您的 API 令牌。

    安全警告:切勿将 .env 提交到 git(将其添加到 .gitignore),切勿在日志、截图或聊天消息中暴露凭据。

路由器发现

重要:如果用户未指定交易路由器,您必须首先发现可用的路由器:

opentrade trade routers

响应格式:

{
  "ok": true,
  "data": [
    {
      "api": "v2",
      "created_at": "2026-03-10 01:15:42",
      "is_active": true,
      "name": "6551dex test",
      "quota_reward": 0,
      "trader": "6551dex",
      "updated_at": "2026-03-10 01:15:42"
    },
    {
      "api": "v1",
      "created_at": "2026-03-03 21:24:34",
      "is_active": true,
      "name": "okx test",
      "quota_reward": 0,
      "trader": "okx",
      "updated_at": "2026-03-03 21:24:34"
    }
  ]
}

用法:

  • 从响应中提取 trader 和 api
  • 强制性:此会话中的所有后续 opentrade 命令必须包含 --trader <trader> 和 --api <api> 标志
  • 示例:opentrade portfolio balance 0x... --chain ethereum --trader okx --api v1
  • 默认回退:如果 API 返回空数据,请使用 --trader okx --api v1

技能路由

  • 代币价格/K 线 → 使用 opentrade-market
  • 代币搜索/元数据 → 使用 opentrade-token
  • 执行交换 → 使用 opentrade-dex-swap
  • 交易广播 → 使用 opentrade-gateway

快速开始

# 获取余额查询支持的链
opentrade portfolio chains

# 获取 XLayer 和 Solana 上的总资产价值
opentrade portfolio total-value --address 0xYourWallet --chains "xlayer,solana"

# 获取所有代币余额
opentrade portfolio all-balances --address 0xYourWallet --chains "xlayer,solana,ethereum"

# 检查特定代币(XLayer 上的原生 OKB + USDC)
opentrade portfolio token-balances --address 0xYourWallet --tokens "196:,196:0x74b7f16337b8972027f6196a17a631ac6de26d22"

链名称支持

CLI 接受人类可读的链名称并自动解析。

链名称chainIndex
XLayerxlayer196
Solanasolana501
Ethereumethereum1
Basebase8453
BSCbsc56
Arbitrumarbitrum42161

地址格式说明:EVM 地址(0x...)适用于 Ethereum/BSC/Polygon/Arbitrum/Base 等。Solana 地址(Base58)和 Bitcoin 地址(UTXO)格式不同。不要在链类型之间混用格式。

命令索引

#命令描述
1opentrade portfolio chains获取余额查询支持的链
2opentrade portfolio total-value --address ... --chains ...获取钱包的总资产价值
3opentrade portfolio all-balances --address ... --chains ...获取钱包的所有代币余额
4opentrade portfolio token-balances --address ... --tokens ...获取特定代币余额

跨技能工作流

该技能通常在 交换前(用于验证余额是否充足)使用,或者作为 投资组合入口点 使用。

工作流 A:交换前余额检查

用户:“将 1 SOL 换成 BONK”

1. opentrade-token    opentrade token search BONK --chains solana               → 获取 tokenContractAddress
       ↓ tokenContractAddress
2. opentrade-portfolio  opentrade portfolio all-balances --address <addr> --chains solana
       → 验证 SOL 余额 >= 1
       ↓ 余额字段(UI 单位)→ 转换为最小单位用于交换
3. opentrade-dex-swap     opentrade swap quote --from 11111111111111111111111111111111 --to <BONK_address> --amount 1000000000 --chain solana
4. opentrade-dex-swap     opentrade swap swap --from ... --to <BONK_address> --amount 1000000000 --chain solana --wallet <addr>

数据交接:

  • tokenContractAddress 来自代币搜索 → 输入到交换的 --from / --to
  • balance 来自投资组合是 UI 单位;交换需要 最小单位 → 乘以 10^decimal
  • 如果余额 < 所需金额 → 通知用户,不要进行交换

工作流 B:投资组合概览 + 分析

用户:“显示我的投资组合”

1. opentrade-portfolio  opentrade portfolio total-value --address <addr> --chains "xlayer,solana,ethereum"
       → 总 USD 价值
2. opentrade-portfolio  opentrade portfolio all-balances --address <addr> --chains "xlayer,solana,ethereum"
       → 按代币细分
       ↓ 按 USD 价值排名的前几项持仓
3. opentrade-token    opentrade token price-info <address> --chain <chain>  → 补充 24 小时变化、市值等信息
4. opentrade-market   opentrade market kline <address> --chain <chain>      → 感兴趣代币的价格图表

工作流 C:卖出表现不佳的代币

1. opentrade-portfolio  opentrade portfolio all-balances --address <addr> --chains "xlayer,solana,ethereum"
       → 列出所有持仓
       ↓ 每个持仓的 tokenContractAddress + chainIndex
2. opentrade-token    opentrade token price-info <address> --chain <chain>  → 获取每个代币的 priceChange24H
3. 筛选出负变化 → 用户确认要卖出的代币
4. opentrade-dex-swap     opentrade swap quote → opentrade swap swap → 执行卖出

关键转换:balance(UI 单位)× 10^decimal = amount(最小单位)用于交换。

操作流程

步骤 1:识别意图

  • 检查总资产 → opentrade portfolio total-value
  • 查看所有代币持仓 → opentrade portfolio all-balances
  • 检查特定代币余额 → opentrade portfolio token-balances
  • 不确定哪些链受支持 → 首先运行 opentrade portfolio chains

步骤 2:收集参数

  • 缺少钱包地址 → 询问用户
  • 缺少目标链 → 推荐 XLayer(--chains xlayer,低 gas,快速确认)作为默认选项,然后询问用户偏好哪条链。常见集合:"xlayer,solana,ethereum,base,bsc"
  • 需要过滤风险代币 → 设置 --exclude-risk 0(仅适用于 ETH/BSC/SOL/BASE)

步骤 3:调用并显示

  • 总价值:显示 USD 金额
  • 代币余额:显示代币名称、数量(UI 单位)、USD 价值
  • 按 USD 价值降序排列

步骤 4:建议后续操作

显示结果后,建议 2-3 个相关后续操作:

刚完成的操作建议
portfolio total-value1. 查看代币级别的细分 → opentrade portfolio all-balances(此技能)2. 查看持仓前几项的价格趋势 → opentrade-market
portfolio all-balances1. 查看某个代币的详细分析(市值、24 小时变化)→ opentrade-token 2. 交换代币 → opentrade-dex-swap 3. 查看代币价格图表 → opentrade-market
portfolio token-balances1. 查看跨所有代币的完整投资组合 → opentrade portfolio all-balances(此技能)2. 交换此代币 → opentrade-dex-swap

以对话方式呈现,例如:“您想查看您主要持仓的价格图表,还是交换其中一些代币?”——切勿向用户暴露技能名称或端点路径。

CLI 命令参考

1. opentrade portfolio chains

获取余额查询支持的链。无需参数。

opentrade portfolio chains

返回字段:

字段类型描述
nameString链名称(例如 "XLayer")
logoUrlString链徽标 URL
shortNameString链短名称(例如 "OKB")
chainIndexString链唯一标识符(例如 "196")

2. opentrade portfolio total-value

获取钱包地址的总资产价值。

opentrade portfolio total-value --address <address> --chains <chains> [--asset-type <type>] [--exclude-risk <bool>]
参数必需默认值描述
--address是-钱包地址
--chains是-链名称或 ID,逗号分隔(例如 "xlayer,solana" 或 "196,501")
--asset-type否"0"0=全部,1=仅代币,2=仅 DeFi
--exclude-risk否truetrue=过滤风险代币,false=包含。仅适用于 ETH/BSC/SOL/BASE

返回字段:

字段类型描述
totalValueString以 USD 计的总资产价值

3. opentrade portfolio all-balances

获取钱包地址的所有代币余额。

opentrade portfolio all-balances --address <address> --chains <chains> [--exclude-risk <value>]
参数必需默认值描述
--address是-钱包地址
--chains是-链名称或 ID,逗号分隔,最多 50 条
--exclude-risk否"0"0=过滤掉风险代币(默认),1=包含。仅适用于 ETH/BSC/SOL/BASE

返回字段(tokenAssets[] 中每个代币):

字段类型描述
chainIndexString链标识符
tokenContractAddressString代币合约地址
symbolString代币符号(例如 "OKB")
balanceString代币余额,以 UI 单位表示(例如 "10.5")
rawBalanceString代币余额,以基础单位表示(例如 "10500000000000000000")
tokenPriceString代币价格,以 USD 计
isRiskTokenBooleantrue 表示标记为风险代币

4. opentrade portfolio token-balances

获取钱包地址的特定代币余额。

opentrade portfolio token-balances --address <address> --tokens <tokens> [--exclude-risk <value>]
参数必需默认值描述
--address是-钱包地址
--tokens是-代币列表:"chainIndex:tokenAddress" 对,逗号分隔。使用空地址表示原生代币(例如 "196:" 表示原生 OKB)。最多 20 个项目。
--exclude-risk否"0"0=过滤掉(默认),1=包含

返回字段:与 all-balances 相同的模式(tokenAssets[])。

输入/输出示例

用户说:“检查我在 XLayer 和 Solana 上的钱包总资产”

opentrade portfolio total-value --address 0xYourWallet --chains "xlayer,solana"
# → 显示:总资产 $12,345.67

用户说:“显示我钱包里的所有代币”

opentrade portfolio all-balances --address 0xYourWallet --chains "xlayer,solana,ethereum"
# → 显示:
#   OKB:  10.5 ($509.25)
#   USDC: 2,000 ($2,000.00)
#   USDT: 1,500 ($1,500.00)
#   ...

用户说:“只检查 XLayer 上的 USDC 和原生 OKB 余额”

opentrade portfolio token-balances --address 0xYourWallet --tokens "196:,196:0x74b7f16337b8972027f6196a17a631ac6de26d22"
# → 显示:OKB: 10.5 ($509.25), USDC: 2,000 ($2,000.00)

边界情况

  • 零余额:有效状态——显示 $0.00,不是错误
  • 不支持的链:先调用 opentrade portfolio chains 确认
  • 链数超过 50:分批处理,每次请求最多 50 条
  • --exclude-risk 不生效:仅在 ETH/BSC/SOL/BASE 上受支持
  • DeFi 持仓:使用 --asset-type 2 单独查询 DeFi 持仓
  • 地址格式不匹配:在 Solana 链上使用 EVM 地址将返回空数据——不要混用
  • 网络错误:重试一次,然后提示用户稍后重试
  • 区域限制(错误码 50125 或 80001):不要向用户显示原始错误码。而是显示一条友好的消息:⚠️ 您所在的区域无法使用此服务。请切换到受支持的区域后重试。

金额显示规则

  • 代币金额使用 UI 单位(1.5 ETH),绝不使用基础单位(1500000000000000000)
  • USD 值保留 2 位小数
  • 大金额使用简写($1.2M)
  • 按 USD 值降序排列

全局说明

  • --chains 支持最多 50 个链 ID(逗号分隔,名称或数字均可)
  • --asset-type:0=全部 1=仅代币 2=仅 DeFi(仅适用于 total-value)
  • --exclude-risk 仅适用于 ETH(1)/BSC(56)/SOL(501)/BASE(8453)
  • token-balances 支持最多 20 个代币条目
  • CLI 自动解析链名称(例如 ethereum → 1,solana → 501)
  • CLI 通过环境变量内部处理身份验证——有关默认值,请参见前提条件步骤 4

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

NeverSight/learn-skills.dev

Use when generating or modifying Remotion video code, creating demo videos, or working with the demo-video/ directory

NeverSight/learn-skills.dev

Create AI avatar and talking head videos via inference.sh CLI. Recommended: P-Video-Avatar (fastest, cheapest, built-in TTS). Also: OmniHuman, Fabric, PixVerse. Audio: Inworld TTS-2 (100+ languages, emotion steering for characters), ElevenLabs, Kokoro. Capabilities: audio-driven avatars, text-to-avatar, lipsync videos, talking head generation, virtual presenters, UGC content. Use for: AI presenters, explainer videos, virtual influencers, dubbing, marketing videos, UGC ads, gaming avatars, NPC dialogue. Triggers: ai avatar, talking head, lipsync, avatar video, virtual presenter, ai spokesperson, audio driven video, heygen alternative, synthesia alternative, talking avatar, lip sync, video avatar, ai presenter, digital human, ugc, ugc video, ugc ad, avatar ugc

NeverSight/learn-skills.dev

Create AI marketing videos for ads, promos, product launches, and brand content. Models: Veo, Seedance, Wan, FLUX for visuals, Kokoro for voiceover. Types: product demos, testimonials, explainers, social ads, brand videos. Use for: Facebook ads, YouTube ads, product launches, brand awareness. Triggers: marketing video, ad video, promo video, commercial, brand video, product video, explainer video, ad creative, video ad, facebook ad video, youtube ad, instagram ad, tiktok ad, promotional video, launch video

NeverSight/learn-skills.dev

Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse

NeverSight/learn-skills.dev

ElevenLabs automatic dubbing - translate and dub audio/video into 29 languages while preserving speaker voice via inference.sh CLI. Capabilities: auto speaker detection, voice-preserving translation, video dubbing, audio localization. Use for: content localization, video translation, multilingual content, international distribution. Triggers: dubbing, dub video, translate audio, video translation, audio translation, localize content, elevenlabs dubbing, eleven labs dub, multilingual dub, voice translation, auto dub, language dub, content localization

NeverSight/learn-skills.dev

Explainer video production guide: scripting, voiceover, visuals, and assembly. Covers script formulas, pacing rules, scene planning, and multi-tool pipelines. Use for: product demos, how-it-works videos, onboarding videos, social explainers. Triggers: explainer video, how to make explainer, product video, demo video, video production, video script, animated explainer, product demo video, tutorial video, onboarding video, walkthrough video, video pipeline

NeverSight/learn-skills.dev

Still-to-video conversion guide: model selection, motion prompting, and camera movement. Covers Wan 2.5 i2v, Seedance, Fabric, Grok Video with when to use each. Use for: animating images, creating video from stills, adding motion, product animations. Triggers: image to video, i2v, animate image, still to video, add motion to image, image animation, photo to video, animate still, wan i2v, image2video, bring image to life, animate photo, motion from image

NeverSight/learn-skills.dev

Generate talking head avatar videos with Pruna P-Video-Avatar via inference.sh CLI. Turn a portrait image into a realistic speaking video with built-in TTS. 18x faster and 6x cheaper than competitors. Models: P-Video-Avatar, P-Image (for portrait generation). Capabilities: text-to-avatar, audio-driven avatars, 30 voices, 10 languages, 720p/1080p, built-in TTS, dynamic backgrounds, full-body control. Use for: AI presenters, product demos, explainer videos, virtual influencers, marketing, education, multilingual content, UGC, gaming avatars. Triggers: avatar video, talking head, ai avatar, p-video-avatar, pruna avatar, video avatar, ai presenter, digital human, virtual presenter, lipsync, talking avatar, ai spokesperson, heygen alternative, synthesia alternative, veed alternative, fabric alternative, omnihuman alternative

NeverSight/learn-skills.dev

Generate videos with Pruna P-Video and WAN models via inference.sh CLI. Models: P-Video, WAN-T2V, WAN-I2V. Capabilities: text-to-video, image-to-video, audio support, 720p/1080p, fast inference. Pruna optimizes models for speed without quality loss. Triggers: pruna video, p-video, pruna ai video, fast video generation, optimized video, wan t2v, wan i2v, economic video generation, cheap video generation, pruna text to video, pruna image to video

NeverSight/learn-skills.dev

Render videos from React/Remotion component code via inference.sh. Pass TSX code, get MP4. Supports all Remotion APIs: useCurrentFrame, useVideoConfig, spring, interpolate, AbsoluteFill, Sequence. Configurable resolution, FPS, duration, codec. Use for: programmatic video generation, animated graphics, motion design, data-driven videos, React animations to video. Triggers: remotion, render video from code, tsx to video, react video, programmatic video, remotion render, code to video, animated video, motion graphics code, react animation video

NeverSight/learn-skills.dev

Video ad creation with exact platform-specific specs for TikTok, Instagram, YouTube, Facebook, LinkedIn. Covers dimensions, duration limits, AIDA framework, and caption requirements. Use for: video ads, social media ads, paid media creative, video marketing, ad production. Triggers: video ad, social media ad, tiktok ad, instagram ad, youtube ad, facebook ad, linkedin ad, video creative, ad specs, paid media, video marketing, ad production, reels ad, stories ad, pre roll, bumper ad

NeverSight/learn-skills.dev

Best practices and techniques for writing effective AI video generation prompts. Covers: Veo, Seedance, Wan, Grok, Kling, Runway, Pika, Sora prompting strategies. Learn: shot types, camera movements, lighting, pacing, style keywords, negative prompts. Use for: improving video quality, getting consistent results, professional video prompts. Triggers: video prompt, how to prompt video, veo prompts, video generation tips, better ai video, video prompt engineering, video prompt guide, video prompt template, ai video tips, video prompt best practices, video prompt examples, cinematography prompts

NeverSight/learn-skills.dev

YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A/B testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image

NeverSight/learn-skills.dev

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

NeverSight/learn-skills.dev

Configure and use the hosted YouTube Data MCP end-to-end with minimal user input. Use when users want the agent to verify Node.js and `npx`, configure MCP server config (Windows/macOS, Cursor/Codex/OpenClaw/OpenCode), request API key at setup time, run post-install capability discovery (`tools/list` and `get_patch_notes`), and then strongly recommend helper skill and Python setup for full local document and spreadsheet workflows.

NeverSight/learn-skills.dev

Creates 120fps GPU-accelerated animations with Motion.dev (Framer Motion successor) for React, Next.js, Svelte, and Astro projects. Use when user requests animation, motion, scroll effects, parallax, hero animations, gestures, drag interactions, spring physics, whileHover effects, whileInView animations, animated UI, micro-interactions, page transitions, or layout animations. Generates production TypeScript/JSX code with accessibility (prefers-reduced-motion) and performance validation (≥60fps). Supports entrance animations, gesture interactions (hover/tap/drag), scroll-based reveals, and layout transitions using spring physics and natural timing. Do NOT use for CSS-only transitions (use native CSS), static sites without JavaScript, Vue animations (use motion-v variant instead), or SVG/Canvas complex animations (GSAP better suited).

NeverSight/learn-skills.dev

Static artifact craft skill for self-contained HTML/CSS/JS documents: docs, sheets, dashboards, explainers, slides, tools, and landing pages. Use when the user asks for a durable, openable, shareable web deliverable they'll keep or hand off — a report, a dashboard, a slide deck, a data table, a page. Local folder first, temporary public link via tunnel (localhost.run), optional durable publish to Surge, GitHub Pages, or Cloudflare. Not for quick look renders, inline snippets, or throwaway scratch. Not for SPA frameworks, backend APIs, database apps, or production product UI.

NeverSight/learn-skills.dev

FFmpeg commands for video/audio conversion, trimming, compression, and processing. Use when user mentions "ffmpeg", "convert video", "compress video", "extract audio", "trim video", "gif from video", "video codec", "transcode", "screen recording", "merge videos", "video to mp4", "reduce file size", or any media processing task.

NeverSight/learn-skills.dev

Vim keybindings, motions, text objects, and operators for efficient text editing. Use when user asks about "vim commands", "vim motions", "text objects", "vim keybindings", "vim cheat sheet", "learn vim", "vim in VS Code", or any Vim editing tasks.

NeverSight/learn-skills.dev

Grok Build ONLY. Turn a 2D character still into smooth animation sprites via image_gen/image_edit base → image_to_video (6s/10s run-in-place) → ffmpeg frames → magenta chroma-key → dense sampled sprites (strip/grid/GIF). Use when the user wants video-to-sprite, motion capture from generated video, smoother run/walk cycles from dense frames, or runs /video2dsprite. Do NOT use on Codex/Claude — only Grok Build has image_to_video. Prefer generate2dsprite for crisp pixel sheets without video.

相关技能