gmgn-portfolio
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUse the tool to query wallet portfolio data based on the user's request.
gmgn-cli使用工具根据用户请求查询钱包投资组合数据。
gmgn-cliSub-commands
子命令
| Sub-command | Description |
|---|---|
| Wallets and main currency balances bound to the API Key |
| Wallet token holdings with P&L |
| Transaction history |
| Trading statistics (supports batch) |
| Token balance for a specific token |
| 子命令 | 描述 |
|---|---|
| API Key绑定的钱包及主币余额 |
| 包含盈亏的钱包代币持仓 |
| 交易历史记录 |
| 交易统计(支持批量查询) |
| 特定代币的余额 |
Supported Chains
支持的链
solbscbasesolbscbasePrerequisites
前置条件
- file with
.envsetGMGN_API_KEY - Run from the directory where your file is located, or set
.envin your environmentGMGN_HOST
- 已配置的
GMGN_API_KEY文件.env - 从文件所在目录运行,或在环境变量中配置
.envGMGN_HOST
Usage Examples
使用示例
bash
undefinedbash
undefinedAPI Key wallet info (no --chain or --wallet needed)
API Key对应的钱包信息(无需指定--chain或--wallet参数)
npx gmgn-cli portfolio info
npx gmgn-cli portfolio info
Wallet holdings (default sort)
钱包持仓(默认排序)
npx gmgn-cli portfolio holdings --chain sol --wallet <wallet_address>
npx gmgn-cli portfolio holdings --chain sol --wallet <wallet_address>
Holdings sorted by USD value, descending
按美元价值降序排列的持仓
npx gmgn-cli portfolio holdings
--chain sol --wallet <wallet_address>
--order-by usd_value --direction desc --limit 20
--chain sol --wallet <wallet_address>
--order-by usd_value --direction desc --limit 20
npx gmgn-cli portfolio holdings
--chain sol --wallet <wallet_address>
--order-by usd_value --direction desc --limit 20
--chain sol --wallet <wallet_address>
--order-by usd_value --direction desc --limit 20
Include sold-out positions
包含已清仓的持仓
npx gmgn-cli portfolio holdings --chain sol --wallet <wallet_address> --sell-out
npx gmgn-cli portfolio holdings --chain sol --wallet <wallet_address> --sell-out
Transaction activity
交易活动记录
npx gmgn-cli portfolio activity --chain sol --wallet <wallet_address>
npx gmgn-cli portfolio activity --chain sol --wallet <wallet_address>
Activity filtered by type
按类型筛选的交易活动
npx gmgn-cli portfolio activity --chain sol --wallet <wallet_address>
--type buy --type sell
--type buy --type sell
npx gmgn-cli portfolio activity --chain sol --wallet <wallet_address>
--type buy --type sell
--type buy --type sell
Activity for a specific token
特定代币的交易活动
npx gmgn-cli portfolio activity --chain sol --wallet <wallet_address>
--token <token_address>
--token <token_address>
npx gmgn-cli portfolio activity --chain sol --wallet <wallet_address>
--token <token_address>
--token <token_address>
Trading stats (default 7d)
交易统计(默认7天周期)
npx gmgn-cli portfolio stats --chain sol --wallet <wallet_address>
npx gmgn-cli portfolio stats --chain sol --wallet <wallet_address>
Trading stats for 30 days
30天周期的交易统计
npx gmgn-cli portfolio stats --chain sol --wallet <wallet_address> --period 30d
npx gmgn-cli portfolio stats --chain sol --wallet <wallet_address> --period 30d
Batch stats for multiple wallets
多个钱包的批量统计
npx gmgn-cli portfolio stats --chain sol
--wallet <wallet_1> --wallet <wallet_2>
--wallet <wallet_1> --wallet <wallet_2>
npx gmgn-cli portfolio stats --chain sol
--wallet <wallet_1> --wallet <wallet_2>
--wallet <wallet_1> --wallet <wallet_2>
Token balance
代币余额
npx gmgn-cli portfolio token-balance
--chain sol --wallet <wallet_address> --token <token_address>
--chain sol --wallet <wallet_address> --token <token_address>
undefinednpx gmgn-cli portfolio token-balance
--chain sol --wallet <wallet_address> --token <token_address>
--chain sol --wallet <wallet_address> --token <token_address>
undefinedHoldings Options
持仓查询选项
| Option | Description |
|---|---|
| Page size (default |
| Pagination cursor |
| Sort field: |
| Sort direction (default |
| Include sold-out positions |
| Include small-value positions |
| Hide abnormal positions |
| Hide airdrop positions |
| Hide closed positions |
| Hide open positions |
| 选项 | 描述 |
|---|---|
| 每页数量(默认 |
| 分页游标 |
| 排序字段: |
| 排序方向(默认 |
| 包含已清仓的持仓 |
| 包含小额持仓 |
| 隐藏异常持仓 |
| 隐藏空投持仓 |
| 隐藏已平仓持仓 |
| 隐藏未平仓持仓 |
Activity Options
交易活动查询选项
| Option | Description |
|---|---|
| Filter by token |
| Page size |
| Pagination cursor |
| Repeatable: |
| 选项 | 描述 |
|---|---|
| 按代币筛选 |
| 每页数量 |
| 分页游标 |
| 可重复指定: |
Stats Options
交易统计选项
| Option | Description |
|---|---|
| Stats period: |
| 选项 | 描述 |
|---|---|
| 统计周期: |
Notes
注意事项
- All portfolio commands use normal auth (API Key only, no signature required)
- supports multiple
portfolio statsflags for batch queries--wallet - Use to get single-line JSON for further processing
--raw
- 所有投资组合命令使用普通认证(仅需API Key,无需签名)
- 支持多个
portfolio stats参数以进行批量查询--wallet - 使用参数可获取单行JSON格式结果,以便后续处理
--raw