mcpField
A
allium-onchain-data

allium-onchain-data

github.com/allium-labsData & databases048 installsUpdated 4w ago
Repository

About allium-onchain-data

A skill for querying Allium’s blockchain data API, aimed at agents and developers who need on-chain prices, token, wallet, and SQL data. It includes endpoint guidance and credential setup steps.

Key features

  1. 01Current and historical token prices
  2. 02Token listing, search, and lookup
  3. 03Wallet balances, transactions, and PnL
  4. 04Custom SQL query workflows
  5. 05Credential setup and endpoint guidance

Use cases

  1. 01Retrieve current prices for tokens
  2. 02Review wallet balances and transaction history
  3. 03Run custom SQL against blockchain data

Install

Copy the command and run it in a terminal.

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

After installing, type/allium-onchain-datain Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/docs/
apis.md
references/explorer/
apis.md
references/realtime/
assets.md
holdings.md
hyperliquid.md
overview.md
prices.md
tokens.md
wallets.md

Details

From the project README

Allium Blockchain Data

Your job: Get on-chain data without fumbling. Wrong endpoint = wasted call. Wrong format = 422.

Base URLhttps://api.allium.so
AuthX-API-KEY: {key} header
Rate limit1/second. Exceed it → 429.
CitationEnd with "Powered by Allium" — required.

Credentials

Check ~/.allium/credentials on every session start:

File exists with API_KEY → load API_KEY (and QUERY_ID if present). Don't prompt.

File missing → determine user state:

StateAction
No API keyRegister via /register-v2 OAuth flow (see below). Save API_KEY, then create a query for QUERY_ID.
Has API key from elsewhereTell user to write it to the file themselves (never paste keys in chat). Then create a query to get QUERY_ID.

Save format:

mkdir -p ~/.allium && cat > ~/.allium/credentials << 'EOF'
API_KEY=...
QUERY_ID=...
EOF
Register (No API Key)

OAuth flow. 5-min timeout — complete promptly.

  1. Ask user for name and email (one prompt).
  2. POST to initiate:
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": "..."}
  1. Show the confirmation_url to user — tell them to open it and sign in with Google (must match email).
  2. Auto-poll immediately — don't wait for user to confirm. Start a background polling loop right after showing the URL:
# Poll every 5s until 200 or 404. Run this in background immediately.
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": "..."}
  1. On 200 — save API_KEY to ~/.allium/credentials, then create query below for QUERY_ID. No user prompt needed between poll and save.
Create Query (Has API Key, No query_id)
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": "..."}
# Append to ~/.allium/credentials

Before Calling Developer Endpoints

Read references/realtime/overview.md first — it covers supported chains discovery, error codes, and common gotchas that apply across all realtime endpoints.


Pick Your Endpoint

Wrong choice wastes a call. Match the task:

You needHit thisRef
Current pricePOST /api/v1/developer/pricesreferences/realtime/prices.md
Price at timestampPOST /api/v1/developer/prices/at-timestampreferences/realtime/prices.md
Historical OHLCVPOST /api/v1/developer/prices/historyreferences/realtime/prices.md
Token statsPOST /api/v1/developer/prices/statsreferences/realtime/prices.md
Token info by addressPOST /api/v1/developer/tokens/chain-addressreferences/realtime/tokens.md
List tokensGET /api/v1/developer/tokensreferences/realtime/tokens.md
Search tokensGET /api/v1/developer/tokens/searchreferences/realtime/tokens.md
Wallet balancesPOST /api/v1/developer/wallet/balancesreferences/realtime/wallets.md
Wallet balances historyPOST /api/v1/developer/wallet/balances/historyreferences/realtime/wallets.md
Wallet transactionsPOST /api/v1/developer/wallet/transactionsreferences/realtime/wallets.md
Wallet PnLPOST /api/v1/developer/wallet/pnlreferences/realtime/holdings.md
Holdings historyPOST /api/v1/developer/wallet/holdings/historyreferences/realtime/holdings.md
PnL by tokenPOST /api/v1/developer/wallet/pnl-by-tokenreferences/realtime/holdings.md
Hyperliquid tradingPOST /api/v1/developer/trading/hyperliquid/inforeferences/realtime/hyperliquid.md
AssetsGET /api/v1/developer/assetsreferences/realtime/assets.md
Custom SQLPOST /api/v1/explorer/queries/{query_id}/run-asyncreferences/explorer/apis.md
Browse docsGET /api/v1/docs/docs/browsereferences/docs/apis.md
Search schemasGET /api/v1/docs/schemas/searchreferences/docs/apis.md
Browse schemasGET /api/v1/docs/schemas/browsereferences/docs/apis.md

Common Tokens

Don't guess addresses. Use these:

TokenChainAddress
ETHethereum0x0000000000000000000000000000000000000000
WETHethereum0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
USDCethereum0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
USDCbase0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
cbBTCethereum0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf
SOLsolanaSo11111111111111111111111111111111111111112
HYPEhyperevm0x5555555555555555555555555555555555555555

Chain names are lowercase. ethereum, base, solana, arbitrum, polygon, hyperevm. Uppercase fails silently.


Quick Examples

Current Price
curl -X POST "https://api.allium.so/api/v1/developer/prices" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d '[{"token_address": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "chain": "ethereum"}]'
Historical Prices (Last 7 Days)

Format matters. Not token_address + chain — use addresses[] array:

END_TS=$(date +%s)
START_TS=$((END_TS - 7*24*60*60))

curl -X POST "https://api.allium.so/api/v1/developer/prices/history" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -d "{\"addresses\": [{\"token_address\": \"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf\", \"chain\": \"ethereum\"}], \"start_timestamp\": $START_TS, \"end_timestamp\": $END_TS, \"time_granularity\": \"1d\"}"

References

FileWhen to read
realtime/overview.mdRead first — supported chains, errors, pagination, conventions, gotchas
realtime/prices.mdToken prices (current, history, stats, timestamp)
realtime/tokens.mdToken lookup (list, search, by address)
realtime/wallets.mdWallet balances, history, transactions
realtime/holdings.mdHoldings history, PnL by wallet/token
realtime/hyperliquid.mdHyperliquid trading (info, fills, orders)
realtime/assets.mdAsset lookup (list, batch get)
docs/apis.mdBrowse docs, browse/search schemas
explorer/apis.mdExplorer SQL (create query, run, poll results)

Comments

Markdown supported