skills/opentrade/opentrade-portfolio/SKILL.md
This skill should be used when the user asks to 'check my wallet balance', 'show my token holdings', 'how much OKB do I have', 'what tokens do I have', 'check my portfolio value', 'view my assets', 'how much is my portfolio worth', 'what\'s in my wallet', or mentions checking wallet balance, total assets, token holdings, portfolio value, remaining funds, DeFi positions, or multi-chain balance lookup. Supports XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, and 20+ other chains. Do NOT use for general programming questions about balance variables or API documentation. Do NOT use when the user is asking how to build or integrate a balance feature into code.
npx skillsauth add 6551team/openskills opentrade-portfolioInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
4 commands for supported chains, wallet total value, all token balances, and specific token balances.
Every time before running any opentrade command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure.
Confirm installed: Run which opentrade. If not found, install it:
curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
If the install script fails, ask the user to install manually following the instructions at: https://github.com/6551Team/openskills
Check for updates: Read ~/.opentrade/last_check and compare it with the current timestamp:
cached_ts=$(cat ~/.opentrade/last_check 2>/dev/null || true)
now=$(date +%s)
cached_ts is non-empty and (now - cached_ts) < 43200 (12 hours), skip the update and proceed.curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
If a newer version is installed, tell the user and suggest updating their opentrade skills from https://github.com/6551Team/openskills to get the latest features.If any opentrade command fails with an unexpected error during this
session, try reinstalling before giving up:
curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
Find or create a .env file in the project root to override the default API credentials, Load it before performing opentrade operations.
OPEN_TOKEN=your_token_here
Get your API token at: https://6551.io/mcp
Security warning: Never commit .env to git (add it to .gitignore) and never expose credentials in logs, screenshots, or chat messages.
IMPORTANT: If the user has not specified a trading router, you MUST first discover available routers:
opentrade trade routers
Response format:
{
"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"
}
]
}
Usage:
trader and api from the responseopentrade commands in this session MUST include --trader <trader> and --api <api> flagsopentrade portfolio balance 0x... --chain ethereum --trader okx --api v1--trader okx --api v1opentrade-marketopentrade-tokenopentrade-dex-swapopentrade-gateway# Get supported chains for balance queries
opentrade portfolio chains
# Get total asset value on XLayer and Solana
opentrade portfolio total-value --address 0xYourWallet --chains "xlayer,solana"
# Get all token balances
opentrade portfolio all-balances --address 0xYourWallet --chains "xlayer,solana,ethereum"
# Check specific tokens (native OKB + USDC on XLayer)
opentrade portfolio token-balances --address 0xYourWallet --tokens "196:,196:0x74b7f16337b8972027f6196a17a631ac6de26d22"
The CLI accepts human-readable chain names and resolves them automatically.
| Chain | Name | chainIndex |
|---|---|---|
| XLayer | xlayer | 196 |
| Solana | solana | 501 |
| Ethereum | ethereum | 1 |
| Base | base | 8453 |
| BSC | bsc | 56 |
| Arbitrum | arbitrum | 42161 |
Address format note: EVM addresses (0x...) work across Ethereum/BSC/Polygon/Arbitrum/Base etc. Solana addresses (Base58) and Bitcoin addresses (UTXO) have different formats. Do NOT mix formats across chain types.
| # | Command | Description |
|---|---|---|
| 1 | opentrade portfolio chains | Get supported chains for balance queries |
| 2 | opentrade portfolio total-value --address ... --chains ... | Get total asset value for a wallet |
| 3 | opentrade portfolio all-balances --address ... --chains ... | Get all token balances for a wallet |
| 4 | opentrade portfolio token-balances --address ... --tokens ... | Get specific token balances |
This skill is often used before swap (to verify sufficient balance) or as portfolio entry point.
User: "Swap 1 SOL for BONK"
1. opentrade-token opentrade token search BONK --chains solana → get tokenContractAddress
↓ tokenContractAddress
2. opentrade-portfolio opentrade portfolio all-balances --address <addr> --chains solana
→ verify SOL balance >= 1
↓ balance field (UI units) → convert to minimal units for swap
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>
Data handoff:
tokenContractAddress from token search → feeds into swap --from / --tobalance from portfolio is UI units; swap needs minimal units → multiply by 10^decimalUser: "Show my portfolio"
1. opentrade-portfolio opentrade portfolio total-value --address <addr> --chains "xlayer,solana,ethereum"
→ total USD value
2. opentrade-portfolio opentrade portfolio all-balances --address <addr> --chains "xlayer,solana,ethereum"
→ per-token breakdown
↓ top holdings by USD value
3. opentrade-token opentrade token price-info <address> --chain <chain> → enrich with 24h change, market cap
4. opentrade-market opentrade market kline <address> --chain <chain> → price charts for tokens of interest
1. opentrade-portfolio opentrade portfolio all-balances --address <addr> --chains "xlayer,solana,ethereum"
→ list all holdings
↓ tokenContractAddress + chainIndex for each
2. opentrade-token opentrade token price-info <address> --chain <chain> → get priceChange24H per token
3. Filter by negative change → user confirms which to sell
4. opentrade-dex-swap opentrade swap quote → opentrade swap swap → execute sell
Key conversion: balance (UI units) × 10^decimal = amount (minimal units) for swap.
opentrade portfolio total-valueopentrade portfolio all-balancesopentrade portfolio token-balancesopentrade portfolio chains first--chains xlayer, low gas, fast confirmation) as the default, then ask which chain the user prefers. Common set: "xlayer,solana,ethereum,base,bsc"--exclude-risk 0 (only works on ETH/BSC/SOL/BASE)After displaying results, suggest 2-3 relevant follow-up actions:
| Just completed | Suggest |
|---|---|
| portfolio total-value | 1. View token-level breakdown → opentrade portfolio all-balances (this skill) 2. Check price trend for top holdings → opentrade-market |
| portfolio all-balances | 1. View detailed analytics (market cap, 24h change) for a token → opentrade-token 2. Swap a token → opentrade-dex-swap 3. View price chart for a token → opentrade-market |
| portfolio token-balances | 1. View full portfolio across all tokens → opentrade portfolio all-balances (this skill) 2. Swap this token → opentrade-dex-swap |
Present conversationally, e.g.: "Would you like to see the price chart for your top holding, or swap any of these tokens?" — never expose skill names or endpoint paths to the user.
Get supported chains for balance queries. No parameters required.
opentrade portfolio chains
Return fields:
| Field | Type | Description |
|---|---|---|
| name | String | Chain name (e.g., "XLayer") |
| logoUrl | String | Chain logo URL |
| shortName | String | Chain short name (e.g., "OKB") |
| chainIndex | String | Chain unique identifier (e.g., "196") |
Get total asset value for a wallet address.
opentrade portfolio total-value --address <address> --chains <chains> [--asset-type <type>] [--exclude-risk <bool>]
| Param | Required | Default | Description |
|---|---|---|---|
| --address | Yes | - | Wallet address |
| --chains | Yes | - | Chain names or IDs, comma-separated (e.g., "xlayer,solana" or "196,501") |
| --asset-type | No | "0" | 0=all, 1=tokens only, 2=DeFi only |
| --exclude-risk | No | true | true=filter risky tokens, false=include. Only ETH/BSC/SOL/BASE |
Return fields:
| Field | Type | Description |
|---|---|---|
| totalValue | String | Total asset value in USD |
Get all token balances for a wallet address.
opentrade portfolio all-balances --address <address> --chains <chains> [--exclude-risk <value>]
| Param | Required | Default | Description |
|---|---|---|---|
| --address | Yes | - | Wallet address |
| --chains | Yes | - | Chain names or IDs, comma-separated, max 50 |
| --exclude-risk | No | "0" | 0=filter out risky tokens (default), 1=include. Only ETH/BSC/SOL/BASE |
Return fields (per token in tokenAssets[]):
| Field | Type | Description |
|---|---|---|
| chainIndex | String | Chain identifier |
| tokenContractAddress | String | Token contract address |
| symbol | String | Token symbol (e.g., "OKB") |
| balance | String | Token balance in UI units (e.g., "10.5") |
| rawBalance | String | Token balance in base units (e.g., "10500000000000000000") |
| tokenPrice | String | Token price in USD |
| isRiskToken | Boolean | true if flagged as risky |
Get specific token balances for a wallet address.
opentrade portfolio token-balances --address <address> --tokens <tokens> [--exclude-risk <value>]
| Param | Required | Default | Description |
|---|---|---|---|
| --address | Yes | - | Wallet address |
| --tokens | Yes | - | Token list: "chainIndex:tokenAddress" pairs, comma-separated. Use empty address for native token (e.g., "196:" for native OKB). Max 20 items. |
| --exclude-risk | No | "0" | 0=filter out (default), 1=include |
Return fields: Same schema as all-balances (tokenAssets[]).
User says: "Check my wallet total assets on XLayer and Solana"
opentrade portfolio total-value --address 0xYourWallet --chains "xlayer,solana"
# → Display: Total assets $12,345.67
User says: "Show all tokens in my wallet"
opentrade portfolio all-balances --address 0xYourWallet --chains "xlayer,solana,ethereum"
# → Display:
# OKB: 10.5 ($509.25)
# USDC: 2,000 ($2,000.00)
# USDT: 1,500 ($1,500.00)
# ...
User says: "Only check USDC and native OKB balances on XLayer"
opentrade portfolio token-balances --address 0xYourWallet --tokens "196:,196:0x74b7f16337b8972027f6196a17a631ac6de26d22"
# → Display: OKB: 10.5 ($509.25), USDC: 2,000 ($2,000.00)
$0.00, not an erroropentrade portfolio chains first to confirm--exclude-risk not working: only supported on ETH/BSC/SOL/BASE--asset-type 2 to query DeFi holdings separately⚠️ Service is not available in your region. Please switch to a supported region and try again.1.5 ETH), never base units (1500000000000000000)$1.2M)--chains supports up to 50 chain IDs (comma-separated, names or numeric)--asset-type: 0=all 1=tokens only 2=DeFi only (only for total-value)--exclude-risk only works on ETH(1)/BSC(56)/SOL(501)/BASE(8453)token-balances supports max 20 token entriesethereum → 1, solana → 501)development
Twitter/X data via the 6551 API. Supports user profiles, tweet search, user tweets, follower events, deleted tweets, and KOL followers.
tools
This skill should be used when the user asks to 'create a custodial wallet', 'create a managed wallet', 'get my wallet address', 'show my custodial account', 'custodial swap', 'swap with managed wallet', 'withdraw from custodial wallet', 'withdraw BNB', 'withdraw SOL', 'send native tokens from custodial wallet', or mentions creating, managing, swapping, or withdrawing with a custodial (managed/hosted) wallet. Only supports BSC and Solana networks. Do NOT use for non-custodial wallet operations, general balance queries (use opentrade-portfolio), or swap quotes without custodial execution (use opentrade-dex-swap).
development
This skill should be used when the user asks to 'find a token', 'search for a token', 'look up PEPE', 'what's trending', 'top tokens', 'trending tokens on Solana', 'token rankings', 'who holds this token', 'holder distribution', 'token market cap', 'token liquidity', 'research a token', 'tell me about this token', 'token info', or mentions searching for tokens by name or address, discovering trending tokens, viewing token rankings, checking holder distribution, or analyzing token market cap and liquidity. Covers token search, metadata, market cap, liquidity, volume, trending token rankings, and holder analysis across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, and 20+ other chains. Do NOT use when the user says only a single generic word like 'tokens' or 'crypto' without specifying a token name, action, or question. For simple current price checks, price charts, candlestick data, or trade history, use opentrade-market instead. For meme token safety analysis, developer reputation, rug pull checks, bundle/sniper detection, or finding tokens by same creator, use opentrade-market instead.
testing
This skill should be used when the user asks to 'place a CEX order', 'trade on centralized exchange', 'buy BTC on CEX', 'sell ETH futures', 'open a long position', 'open a short position', 'close my position', 'set leverage', 'check my CEX balance', 'show my open orders', 'cancel my order', 'check CEX ticker', 'get K-line data', 'set margin mode', 'check my CEX positions', 'view trade history', 'manage wallet agent', or mentions CEX trading, futures, contracts, leverage, margin, limit orders, market orders, stop-loss, take-profit, or newsliquid. This is for centralized exchange operations only. Do NOT use for DEX swaps (use opentrade-dex-swap), on-chain balances (use opentrade-portfolio), on-chain market data (use opentrade-market), token search (use opentrade-token), custodial wallet (use opentrade-wallet), or transaction broadcasting (use opentrade-gateway).