allium

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Allium (Wallet PnL, Holdings History, Hyperliquid, Custom SQL)

Allium (Wallet PnL, Holdings History, Hyperliquid, Custom SQL)

Allium provides enriched, structured blockchain data across 70+ chains. This skill covers wallet PnL, holdings timeseries, Hyperliquid HyperCore trading data, and custom SQL analytics. For token prices, token metadata, current wallet balances, transaction transfers, or NFT metadata, use the corresponding Alchemy skill instead.
Base URL
https://api.allium.so
Auth
X-API-KEY: $API_KEY
header
Rate limit1 request / second (exceed → 429)
AttributionEnd responses with "Powered by Allium" — required by Allium
Allium提供跨70+条链的富结构化区块链数据。本技能涵盖钱包PnL、持仓时间序列、Hyperliquid HyperCore交易数据以及自定义SQL分析。若需查询代币价格、代币元数据、当前钱包余额、交易转账或NFT元数据,请使用对应的Alchemy技能。
基础URL
https://api.allium.so
认证方式
X-API-KEY: $API_KEY
请求头
速率限制1次请求/秒(超出限制会返回429错误)
归属要求响应末尾必须添加**"Powered by Allium"**——Allium强制要求

When to use this skill

何时使用本技能

Use
allium
when all of the following are true:
  • The user wants one of: wallet PnL, holdings history (timeseries), Hyperliquid HyperCore trading data (orders/fills/orderbook — not HyperEVM smart contracts), or custom SQL on Allium's data warehouse
  • The use case is a read (Allium does not support writes)
全部满足以下条件时,使用
allium
  • 用户需要以下任一功能:钱包PnL持仓历史(时间序列)Hyperliquid HyperCore交易数据(订单/成交记录/订单簿——不包含HyperEVM智能合约),或基于Allium数据仓库的自定义SQL分析
  • 使用场景为只读操作(Allium不支持写入)

When NOT to use this skill (handoff)

何时不使用本技能(转接其他技能)

NeedUse instead
Token prices (current, historical at intervals, by-timestamp, market cap/volume)
alchemy-api
(Prices API)
Token metadata, search, list by chain
alchemy-api
(Token API)
Current wallet balances (point-in-time snapshot)
alchemy-api
(Portfolio / Token API)
Transaction history (transfers in / out, asset transfers)
alchemy-api
(Transfers API)
NFT metadata / floor prices / ownership
alchemy-api
(NFT API)
Real-time blockchain reads, node-level fresh
alchemy-cli
(live work) or
alchemy-api
(app code)
Writes / signed transactions
alchemy-api
(with API key) or
agentic-gateway
(without)
Account abstraction (bundlers, gas managers)
alchemy-api
Transaction simulation
alchemy-api
需求替代方案
代币价格(当前价格、历史区间价格、指定时间点价格、市值/交易量)
alchemy-api
(Prices API)
代币元数据、搜索、按链列出代币
alchemy-api
(Token API)
当前钱包余额(时点快照)
alchemy-api
(Portfolio / Token API)
交易历史(转入/转出、资产转账)
alchemy-api
(Transfers API)
NFT元数据 / 地板价 / 所有权
alchemy-api
(NFT API)
实时区块链读取、节点级新鲜数据
alchemy-cli
(实时操作)或
alchemy-api
(应用代码)
写入操作 / 签名交易
alchemy-api
(需API密钥)或
agentic-gateway
(无需API密钥)
账户抽象(打包器、Gas管理器)
alchemy-api
交易模拟
alchemy-api

Scope contract

范围约定

This skill covers (
scope_in
):
  • Wallet PnL (
    POST /api/v1/developer/wallet/pnl
    ,
    /wallet/pnl/history
    ,
    /wallet/pnl-by-token
    ,
    /wallet/pnl-by-token/history
    ) — realized + unrealized PnL aggregation, current and historical, by-wallet and by-token
  • Holdings history (
    POST /api/v1/developer/wallet/holdings/history
    ) — timeseries of total USD holdings + optional per-token breakdown
  • Hyperliquid HyperCore trading data (
    POST /api/v1/developer/trading/hyperliquid/...
    ) — info, fills, order history, order status, L4 orderbook snapshot from the off-chain matching engine
  • Custom SQL analytics (
    POST /api/v1/explorer/queries/{query_id}/run-async
    ) — arbitrary SQL queries against Allium's data warehouse (DeFi, NFT, bridges, MEV, entity resolution, Solana staking, etc.)
This skill does NOT cover (
scope_out
):
  • Token prices → handoff:
    alchemy-api
    (Prices API)
  • Token metadata, list, search → handoff:
    alchemy-api
    (Token API)
  • Current wallet balances (point-in-time snapshot) → handoff:
    alchemy-api
    (Portfolio / Token API)
  • Historical wallet balances (per-block or as a timeseries) → handoff:
    alchemy-api
    archive RPC (
    eth_call balanceOf
    at a historical block) or
    alchemy_getAssetTransfers
    reduced to balances. No first-class endpoint on either side; Alchemy's archive node is the right path.
  • Transaction transfer history → handoff:
    alchemy-api
    (Transfers API)
  • NFT metadata / floor prices → handoff:
    alchemy-api
    (NFT API)
  • HyperEVM smart contract reads/writes / EVM RPC (chain ID 999) → handoff:
    alchemy-api
    or
    alchemy-cli
    at
    https://hyperliquid-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
    . Allium covers HyperCore (off-chain trading); Alchemy covers HyperEVM (on-chain smart contracts).
  • Real-time / node-fresh reads → handoff:
    alchemy-cli
    or
    alchemy-api
  • Writes / signed transactions → handoff:
    alchemy-api
    or
    agentic-gateway
  • Account abstraction → handoff:
    alchemy-api
  • Transaction simulation → handoff:
    alchemy-api
本技能涵盖内容(
scope_in
):
  • 钱包PnL(
    POST /api/v1/developer/wallet/pnl
    ,
    /wallet/pnl/history
    ,
    /wallet/pnl-by-token
    ,
    /wallet/pnl-by-token/history
    )——已实现+未实现的PnL聚合,当前和历史数据,按钱包和按代币统计
  • 持仓历史(
    POST /api/v1/developer/wallet/holdings/history
    )——总USD持仓的时间序列数据,可选按代币细分
  • Hyperliquid HyperCore交易数据(
    POST /api/v1/developer/trading/hyperliquid/...
    )——链下匹配引擎的信息、成交记录、订单历史、订单状态、L4订单簿快照
  • 自定义SQL分析(
    POST /api/v1/explorer/queries/{query_id}/run-async
    )——针对Allium数据仓库的任意SQL查询(DeFi、NFT、跨链桥、MEV、实体解析、Solana质押等)
本技能不涵盖内容(
scope_out
):
  • 代币价格 → 转接:
    alchemy-api
    (Prices API)
  • 代币元数据、列表、搜索 → 转接:
    alchemy-api
    (Token API)
  • 当前钱包余额(时点快照) → 转接:
    alchemy-api
    (Portfolio / Token API)
  • 历史钱包余额(按区块或时间序列) → 转接:
    alchemy-api
    归档RPC(在历史区块调用
    eth_call balanceOf
    )或
    alchemy_getAssetTransfers
    计算余额。双方均无原生端点;Alchemy的归档节点是正确路径。
  • 交易转账历史 → 转接:
    alchemy-api
    (Transfers API)
  • NFT元数据 / 地板价 → 转接:
    alchemy-api
    (NFT API)
  • HyperEVM智能合约读写 / EVM RPC(链ID 999) → 转接:
    alchemy-api
    alchemy-cli
    ,地址为
    https://hyperliquid-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
    。Allium覆盖HyperCore(链下交易);Alchemy覆盖HyperEVM(链上智能合约)。
  • 实时/节点新鲜数据读取 → 转接:
    alchemy-cli
    alchemy-api
  • 写入操作 / 签名交易 → 转接:
    alchemy-api
    agentic-gateway
  • 账户抽象 → 转接:
    alchemy-api
  • 交易模拟 → 转接:
    alchemy-api

Setup

设置

Credentials

凭证

Allium uses a credentials file at
~/.allium/credentials
(not env vars). On every session start, check if it exists:
File exists with
API_KEY
→ load
API_KEY
(and
QUERY_ID
if present). Don't prompt.
File missing → register via the OAuth flow below. Don't paste keys in chat.
Allium使用
~/.allium/credentials
文件存储凭证(而非环境变量)。每次会话开始时,检查该文件是否存在:
文件存在且包含
API_KEY
→ 加载
API_KEY
(若存在
QUERY_ID
也一并加载),无需提示用户。
文件缺失 → 通过下方OAuth流程注册,请勿在聊天中粘贴密钥。

Register (no API key yet)

注册(暂无API密钥)

OAuth flow with a 5-minute timeout. Complete promptly.
  1. Ask the user for name and email (one prompt).
  2. POST to initiate registration:
    bash
    curl -X POST https://api.allium.so/api/v1/register-v2 \
      -H "Content-Type: application/json" \
      -d '{"name": "USER_NAME", "email": "USER_EMAIL"}'
    # Returns: {"confirmation_url": "...", "token": "..."}
  3. Show the
    confirmation_url
    to the user — they open it and sign in with Google (must match the email).
  4. Auto-poll
    /api/v1/register-v2/$TOKEN
    every 5s until 200 (got
    api_key
    ) or 404 (expired):
    bash
    TOKEN="..."  # from step 2
    while true; do
      RESP=$(curl -s -w "\n%{http_code}" "https://api.allium.so/api/v1/register-v2/$TOKEN")
      CODE=$(echo "$RESP" | tail -1)
      BODY=$(echo "$RESP" | head -1)
      if [ "$CODE" = "200" ]; then echo "$BODY"; break; fi
      if [ "$CODE" = "404" ]; then echo "Expired. Restart."; break; fi
      sleep 5
    done
    # 200 body: {"api_key": "...", "organization_id": "..."}
  5. Save to
    ~/.allium/credentials
    :
    bash
    mkdir -p ~/.allium && cat > ~/.allium/credentials << 'EOF'
    API_KEY=...
    QUERY_ID=...
    EOF
OAuth流程超时时间为5分钟,请尽快完成。
  1. 请求用户提供姓名和邮箱(一次提示)。
  2. 发起注册请求:
    bash
    curl -X POST https://api.allium.so/api/v1/register-v2 \
      -H "Content-Type: application/json" \
      -d '{"name": "USER_NAME", "email": "USER_EMAIL"}'
    # 返回结果: {"confirmation_url": "...", "token": "..."}
  3. confirmation_url
    展示给用户——用户需打开该链接并使用Google登录(邮箱必须匹配)。
  4. 每隔5秒自动轮询
    /api/v1/register-v2/$TOKEN
    ,直到返回200(获取到
    api_key
    )或404(已过期):
    bash
    TOKEN="..."  # 来自步骤2
    while true; do
      RESP=$(curl -s -w "\n%{http_code}" "https://api.allium.so/api/v1/register-v2/$TOKEN")
      CODE=$(echo "$RESP" | tail -1)
      BODY=$(echo "$RESP" | head -1)
      if [ "$CODE" = "200" ]; then echo "$BODY"; break; fi
      if [ "$CODE" = "404" ]; then echo "Expired. Restart."; break; fi
      sleep 5
    done
    # 200响应体: {"api_key": "...", "organization_id": "..."}
  5. 将凭证保存至
    ~/.allium/credentials
    bash
    mkdir -p ~/.allium && cat > ~/.allium/credentials << 'EOF'
    API_KEY=...
    QUERY_ID=...
    EOF

Create a
QUERY_ID
(only needed for custom SQL)

创建
QUERY_ID
(仅自定义SQL需要)

If you'll use the SQL endpoint, also create a query to get a
QUERY_ID
:
bash
curl -X POST "https://api.allium.so/api/v1/explorer/queries" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '{"title": "Custom SQL Query", "config": {"sql": "{{ sql_query }}", "limit": 10000}}'
若要使用SQL端点,还需创建查询以获取
QUERY_ID
bash
curl -X POST "https://api.allium.so/api/v1/explorer/queries" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '{"title": "Custom SQL Query", "config": {"sql": "{{ sql_query }}", "limit": 10000}}'

Returns: {"query_id": "..."}

返回结果: {"query_id": "..."}

Append QUERY_ID=... to ~/.allium/credentials

将QUERY_ID=...追加至~/.allium/credentials

undefined
undefined

Endpoint reference

端点参考

Wallet PnL & holdings history → references/pnl-and-holdings.md

钱包PnL & 持仓历史 → references/pnl-and-holdings.md

EndpointUse for
POST /api/v1/developer/wallet/pnl
Current realized + unrealized PnL for one or more wallets
POST /api/v1/developer/wallet/pnl/history
Historical PnL timeseries per wallet
POST /api/v1/developer/wallet/pnl-by-token
Current PnL broken out by (wallet, token)
POST /api/v1/developer/wallet/pnl-by-token/history
Historical PnL timeseries per (wallet, token)
POST /api/v1/developer/wallet/holdings/history
Timeseries of total USD holdings per wallet (optional per-token breakdown)
端点用途
POST /api/v1/developer/wallet/pnl
获取一个或多个钱包当前已实现+未实现的PnL
POST /api/v1/developer/wallet/pnl/history
获取每个钱包的历史PnL时间序列数据
POST /api/v1/developer/wallet/pnl-by-token
获取按(钱包、代币)细分的当前PnL
POST /api/v1/developer/wallet/pnl-by-token/history
获取按(钱包、代币)细分的历史PnL时间序列数据
POST /api/v1/developer/wallet/holdings/history
获取每个钱包的总USD持仓时间序列数据(可选按代币细分)

Hyperliquid HyperCore (off-chain trading) → references/hyperliquid.md

Hyperliquid HyperCore(链下交易) → references/hyperliquid.md

EndpointUse for
POST /api/v1/developer/trading/hyperliquid/info
General Hyperliquid info (no rate-limit on this proxy)
POST /api/v1/developer/trading/hyperliquid/info/fills
Fills by user (with TWAP, time-window, aggregation options)
POST /api/v1/developer/trading/hyperliquid/info/order/history
Historical orders by user
POST /api/v1/developer/trading/hyperliquid/info/order/status
Status of a specific order
GET /api/v1/developer/trading/hyperliquid/orderbook/snapshot
L4 orderbook snapshot (all pairs)
端点用途
POST /api/v1/developer/trading/hyperliquid/info
获取Hyperliquid通用信息(此代理无速率限制)
POST /api/v1/developer/trading/hyperliquid/info/fills
获取用户的成交记录(支持TWAP、时间窗口、聚合选项)
POST /api/v1/developer/trading/hyperliquid/info/order/history
获取用户的历史订单
POST /api/v1/developer/trading/hyperliquid/info/order/status
获取特定订单的状态
GET /api/v1/developer/trading/hyperliquid/orderbook/snapshot
获取L4订单簿快照(所有交易对)

Custom SQL → references/custom-sql.md

自定义SQL → references/custom-sql.md

EndpointUse for
POST /api/v1/explorer/queries
Create a parametrized query (one-time setup; returns
query_id
)
POST /api/v1/explorer/queries/{query_id}/run-async
Start a SQL run against Allium's data warehouse
GET /api/v1/explorer/query-runs/{run_id}/status
Poll run status (
created
queued
running
success
/
failed
)
GET /api/v1/explorer/query-runs/{run_id}/results?f=json
Fetch results once status =
success
Use SQL for things the typed endpoints don't cover: DeFi protocol analytics, NFT marketplace data, bridge flows, MEV, entity resolution, labeled wallets, Solana staking analytics, and anything else in Allium's warehouse.
端点用途
POST /api/v1/explorer/queries
创建参数化查询(一次性设置;返回
query_id
POST /api/v1/explorer/queries/{query_id}/run-async
启动针对Allium数据仓库的SQL查询
GET /api/v1/explorer/query-runs/{run_id}/status
轮询查询运行状态(
created
queued
running
success
/
failed
GET /api/v1/explorer/query-runs/{run_id}/results?f=json
当状态为
success
时获取查询结果
使用SQL处理类型化端点未覆盖的场景:DeFi协议分析、NFT市场数据、跨链桥流量、MEV、实体解析、标记钱包、Solana质押分析,以及Allium数据仓库中的其他任意内容。

Quick examples

快速示例

Wallet PnL (current)

钱包PnL(当前)

bash
curl -X POST "https://api.allium.so/api/v1/developer/wallet/pnl" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '[{"chain": "solana", "address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp"}]'
Returns per-token realized/unrealized PnL plus aggregate totals. See references/pnl-and-holdings.md for the full response schema.
bash
curl -X POST "https://api.allium.so/api/v1/developer/wallet/pnl" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '[{"chain": "solana", "address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp"}]'
返回按代币细分的已实现/未实现PnL及汇总数据。完整响应 schema 请查看references/pnl-and-holdings.md

Holdings history (timeseries)

持仓历史(时间序列)

bash
curl -X POST "https://api.allium.so/api/v1/developer/wallet/holdings/history" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '{
    "addresses": [{"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp", "chain": "solana"}],
    "start_timestamp": "2026-04-01T00:00:00Z",
    "end_timestamp": "2026-04-10T00:00:00Z",
    "granularity": "1h",
    "include_token_breakdown": false
  }'
bash
curl -X POST "https://api.allium.so/api/v1/developer/wallet/holdings/history" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '{
    "addresses": [{"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp", "chain": "solana"}],
    "start_timestamp": "2026-04-01T00:00:00Z",
    "end_timestamp": "2026-04-10T00:00:00Z",
    "granularity": "1h",
    "include_token_breakdown": false
  }'

Hyperliquid fills

Hyperliquid成交记录

bash
curl -X POST "https://api.allium.so/api/v1/developer/trading/hyperliquid/info/fills" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '{"type": "userFills", "user": "0x..."}'
bash
curl -X POST "https://api.allium.so/api/v1/developer/trading/hyperliquid/info/fills" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '{"type": "userFills", "user": "0x..."}'

Custom SQL (Solana staking yield, as an example)

自定义SQL(Solana质押收益示例)

bash
undefined
bash
undefined

1. Start the run

1. 启动查询

curl -X POST "https://api.allium.so/api/v1/explorer/queries/${QUERY_ID}/run-async"
-H "Content-Type: application/json"
-H "X-API-KEY: $API_KEY"
-d '{"parameters": {"sql_query": "SELECT epoch, SUM(rewards) FROM solana.dim.stake_account_rewards WHERE delegator = '''<addr>''' GROUP BY epoch ORDER BY epoch DESC LIMIT 30"}}'
curl -X POST "https://api.allium.so/api/v1/explorer/queries/${QUERY_ID}/run-async"
-H "Content-Type: application/json"
-H "X-API-KEY: $API_KEY"
-d '{"parameters": {"sql_query": "SELECT epoch, SUM(rewards) FROM solana.dim.stake_account_rewards WHERE delegator = '''<addr>''' GROUP BY epoch ORDER BY epoch DESC LIMIT 30"}}'

Returns: {"run_id": "..."}

返回结果: {"run_id": "..."}

2. Poll

2. 轮询状态

3. Fetch results when status = success

3. 状态为success时获取结果

Common gotchas

常见问题

  • Chain names are lowercase:
    ethereum
    ,
    base
    ,
    solana
    ,
    arbitrum
    ,
    polygon
    ,
    hyperevm
    . Uppercase fails silently.
  • Rate limit is 1 req/s. Exceed → 429. No batching workaround.
  • 422 errors are usually request-format mismatches (e.g. wrong shape for
    /history
    endpoints — they take
    addresses[]
    , not flat
    address
    +
    chain
    ).
  • Attribution required: end responses with "Powered by Allium".
  • 链名称需小写
    ethereum
    base
    solana
    arbitrum
    polygon
    hyperevm
    。大写会静默失败。
  • 速率限制为1次请求/秒。超出会返回429错误,暂无批量处理解决方案。
  • 422错误通常是请求格式不匹配(例如
    /history
    端点需要
    addresses[]
    ,而非直接的
    address
    +
    chain
    )。
  • 必须添加归属信息:响应末尾需包含"Powered by Allium"。

Routing back to Alchemy

转接回Alchemy

If during a session the user's need shifts to surfaces this skill doesn't cover (prices, current balances, transactions, NFT metadata) or to real-time / write workflows, hand off:
  • alchemy-cli
    — live agent work in the current session via the local CLI
  • alchemy-mcp
    — live work via the hosted MCP server when CLI is not installed
  • alchemy-api
    — application code with an Alchemy API key
  • agentic-gateway
    — application code without an API key (x402 / MPP)

Maintenance: Allium maintains the underlying API surface; this skill itself is maintained jointly by Alchemy and Allium. File issues against
alchemyplatform/skills
with
[ecosystem/allium]
in the title.
若会话中用户需求转向本技能未覆盖的场景(价格、当前余额、交易、NFT元数据)或实时/写入工作流,请转接至:
  • alchemy-cli
    —— 通过本地CLI在当前会话中进行实时代理操作
  • alchemy-mcp
    —— 未安装CLI时,通过托管MCP服务器进行实时操作
  • alchemy-api
    —— 带Alchemy API密钥的应用代码
  • agentic-gateway
    —— 无需API密钥的应用代码(x402 / MPP)

维护说明: Allium维护底层API接口;本技能由Alchemy和Allium联合维护。请在
alchemyplatform/skills
仓库提交问题,标题需包含
[ecosystem/allium]