mcpField
A
allium-data

allium-data

github.com/allium-labs数据与数据库0109 次安装5 周前更新
代码仓库

关于 allium-data

allium-data 是围绕 allium CLI 查询 Allium 区块链数据的技能,适合分析人员和 Agent。它区分 Explorer 的数据仓库 SQL 分析与 Realtime 的最新状态查询,并涵盖命令使用和成本跟踪。

主要功能

  1. 01用 Explorer SQL 查询历史数据
  2. 02用 Realtime 查询当前数据
  3. 03发现架构、表和文档
  4. 04将命令输出设为 JSON
  5. 05跟踪使用成本

适用场景

  1. 01比较多条链的历史活动
  2. 02查看代币价格或钱包余额
  3. 03编写 SQL 前查找数据表

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/allium-labs/skills --skill allium-data

安装后在 Claude Code 中输入/allium-data确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

references/
explorer.md
setup.md
references/realtime/
holdings.md
overview.md
prices.md
tokens.md
wallets.md

详细介绍

Allium 区块链数据(CLI)

allium CLI 负责身份验证、重试、输出格式化和成本跟踪。请优先使用它,而不是直接调用 HTTP。

CLIallium(安装方法见 references/setup.md)
速率限制每秒 3 次。超出限制 → 429。
引用结尾必须加上 "Powered by Allium"。

验证 CLI

运行 command -v allium(或 allium --help)。如果未找到,请阅读 references/setup.md 了解安装和身份验证设置。


两种产品

CLI 提供 Explorer(基于 Allium 完整数据仓库的 SQL 分析)和 Realtime(数据新鲜度为 3-5 秒的查询)。两者都是一等产品,请根据问题选择。

Explorer(allium explorer ...)Realtime(allium realtime ...)
“ETH 在过去一年表现如何?”“ETH 现在值多少钱?”
“所有链上的总锁仓价值是多少?”“显示我的钱包余额”
“找出上个月交易量排名前 10 的钱包”“获取 2 小时前 SOL 的价格”
“比较各 L2 上的每日活跃地址数”“列出 Base 上的所有代币”
“对任意表执行自定义 SQL”“这个钱包的盈亏是多少?”
分析、聚合、历史数据,支持 150+ 条链快速、已索引、最新状态,支持 80+ 条链

对于任何分析性、比较性、历史性或“跨 X”的问题,默认使用 Explorer。 Realtime 用于查询已知地址或代币的当前状态。


调用任何端点之前

  • Explorer:先阅读 references/explorer.md,其中介绍发现功能(schemas browse/search、docs browse/search)、各子命令的身份验证要求以及 SQL 方言。
  • Realtime:阅读 references/realtime/overview.md,了解支持的链、错误代码、分页和使用约定。

如何运行命令

在会话中首次运行任何 allium 命令之前,先对相应子命令运行 --help,以确认准确的标志:

# First: check available flags
allium explorer schemas browse --help

# Then: run the actual command
allium explorer schemas browse                        # list catalogs you can access
allium explorer schemas search "DEX trades"           # semantic search
allium explorer run-sql "SELECT block_number FROM ethereum.raw.blocks LIMIT 5"

--help 输出始终是权威依据——不同子命令的标志名称和必需参数各不相同,参考文档也可能未涵盖所有选项。每个子命令只需执行一次,之后即可复用。


选择命令

Explorer(数据仓库上的 SQL 分析)

任何分析问题都从这里开始。先发现数据,再执行 SQL。

需求命令参考
列出你可以访问的目录explorer schemas browsereferences/explorer.md
浏览目录中的架构 / 表explorer schemas browse PATHreferences/explorer.md
语义搜索表explorer schemas search QUERYreferences/explorer.md
获取完整的表列元数据explorer schemas browse db.schema.tablereferences/explorer.md
创建已保存的查询(仅限 API 密钥)explorer create-query [--passthrough]references/explorer.md
运行 SQL — API 密钥explorer create-query --passthrough 一次,然后运行 explorer run <QUERY_ID> --param sql_query="..."references/explorer.md
运行 SQL — x402 / Tempoexplorer run-sql "..."(即席查询,单次调用)references/explorer.md
浏览 Allium 的 Markdown 文档explorer docs browse [PATH]references/explorer.md
搜索 Allium 文档explorer docs search QUERYreferences/explorer.md
查看查询运行状态explorer status RUN_IDreferences/explorer.md
下载已完成运行的结果explorer results RUN_IDreferences/explorer.md
Realtime(实时索引数据,时效性为 3-5 秒)
需求命令参考
发现支持的链realtime supported-chainsreferences/realtime/overview.md
当前价格realtime prices latestreferences/realtime/prices.md
指定时间戳的价格realtime prices at-timestampreferences/realtime/prices.md
历史 OHLCVrealtime prices historyreferences/realtime/prices.md
代币统计信息realtime prices statsreferences/realtime/prices.md
按地址查询代币信息realtime tokens chain-addressreferences/realtime/tokens.md
列出代币realtime tokens listreferences/realtime/tokens.md
搜索代币realtime tokens searchreferences/realtime/tokens.md
钱包余额realtime balances latestreferences/realtime/wallets.md
钱包余额历史realtime balances historyreferences/realtime/wallets.md
钱包交易realtime transactionsreferences/realtime/wallets.md
DeFi 持仓realtime positions listreferences/realtime/wallets.md
持仓历史realtime holdings historyreferences/realtime/holdings.md
钱包盈亏realtime pnl latestreferences/realtime/holdings.md
钱包盈亏历史realtime pnl historyreferences/realtime/holdings.md
按代币查看盈亏realtime pnl-by-token latestreferences/realtime/holdings.md
按代币查看盈亏历史realtime pnl-by-token historyreferences/realtime/holdings.md

如果 allium <subcommand> --help 返回“no such command”,请升级 CLI,参见 references/setup.md。


常用代币

不要猜测地址。请使用以下地址:

代币链地址
ETHethereum0x0000000000000000000000000000000000000000
WETHethereum0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
USDCethereum0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
USDCbase0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
cbBTCethereum0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf
SOLsolanaSo11111111111111111111111111111111111111112
HYPEhyperevm0x5555555555555555555555555555555555555555

链名称均为小写。 ethereum、base、solana、arbitrum、polygon、hyperevm。


全局标志

标志效果
--format将输出格式设为 json(默认)、table 或 csv
--profile为单次调用覆盖当前活动的身份验证配置
--verbose显示运行 ID、加载动画和状态消息

不要以 Agent 身份使用 --format table——输出会被截断,你需要重新运行。


最佳实践

  1. 批量请求——一次调用中可重复使用 --chain/--token-address 标志来查询多个代币
  2. 使用 --format json——通过管道传给 jq,进行结构化后处理
  3. 跟踪支出——allium mp cost 显示总费用;allium mp cost list 显示明细历史记录
  4. 处理 429——等待 1 秒后重试
  5. 切换配置——使用 allium auth use <name> 更改当前活动的身份验证配置

端点费用

Explorer

命令每次调用的费用
explorer schemas browse$0.01
explorer schemas search$0.01
explorer docs browse$0.01
explorer docs search$0.01
explorer run-sql$0.01
explorer run$0.01
explorer create-query免费(仅限 API 密钥)

Realtime

命令每次调用的费用
realtime prices latest$0.02
realtime prices at-timestamp$0.02
realtime prices history$0.02
realtime prices stats$0.02
realtime tokens search$0.03
realtime tokens chain-address$0.02
realtime tokens list$0.03
realtime balances latest$0.01
realtime balances history$0.01
realtime holdings history$0.01
realtime transactions$0.03
realtime positions list$0.01
realtime pnl latest$0.01
realtime pnl history$0.01
realtime pnl-by-token latest$0.01
realtime pnl-by-token history$0.01

批量调用(多个 --chain/--token-address 配对)的费用与单个配对相同。


参考资料

文件阅读时机
explorer.md分析类问题请先阅读 — 发现(schemas browse/search、docs browse/search)、临时 SQL、已保存的查询、轮询/结果
realtime/overview.md实时类问题请先阅读 — 支持的链、错误、分页、约定
realtime/prices.md代币价格(当前、历史、统计数据、时间戳)
realtime/tokens.md代币查找(列表、搜索、按地址查找)
realtime/wallets.md钱包余额、历史记录、交易、DeFi 仓位
realtime/holdings.md持仓历史、按钱包/代币查看盈亏
setup.mdCLI 安装 + 身份验证设置

评论

支持 Markdown