Skip to main content

SDK to access Xerberus GraphQL metrics API

Project description

Xerberus Metrics Python SDK

A lightweight Python SDK for accessing blockchain token metrics from the Xerberus GraphQL API.


Features

  • Query token metrics with filters like chain, date, and address
  • Sort and paginate metric data
  • Access available chains and whitelisted tokens
  • Auto-generated GraphQL queries
  • Ready for deployment and integration

Installation

pip install xerberus-metrics-sdk

Or clone locally for development:

git clone https://github.com/xerberus-labs/xerberus-metrics-sdk.git
cd xerberus-metrics-sdk
pip install -e .

SETUP

Create a .env file in the root:

API_KEY=your-api-key-here

USAGE

from xerberus.client import XerberusMetricsClient

client = XerberusMetricsClient()

result = client.metrics_get(
    date=["2025-03-18"],
    chain=["ethereum"],
    sort_by="wallet_count",
    sort_order="DESC",
    limit=5
)

for metric in result["metrics"]:
    print(metric["token"]["symbol"], metric["wallet_count"])

Available Metrics Fields

Token Field Reference

These are the fields you can expect in the token_get() response:

Field Type Description Sortable
asset_id Int Internal asset identifier
symbol String Token Symbol
chain String Blockchain name (e.g., ETHEREUM)
address String Token contract address

Metrics Fields Reference

These are the fields you can expect in the metrics_get() response:

Field Type Description Sortable
asset_id Int Internal asset identifier
chain String Blockchain name (e.g., ETHEREUM)
partition_date String Date of the metric snapshot (YYYY-MM-DD)
wallet_count Int Number of wallets holding the token
wallet_count_change_1D Int Wallet count change over 1 day
wallet_count_change_7D Int Wallet count change over 7 days
wallet_count_change_30D Int Wallet count change over 30 days
wallet_count_change_90D Int Wallet count change over 90 days
wallet_count_change_365D Int Wallet count change over 365 days
typical_price Float Average token price
pct_price_change_1D Float 1-day % price change
price_change_7D Float 7-day price change
price_change_30D Float 30-day price change
price_change_90D Float 90-day price change
price_change_180D Float 180-day price change
price_change_365D Float 365-day price change
life_cycle_v1 Float Token life cycle score
diversity Float Diversity metric (wallet spread)
dominance Float Dominance metric
assortativity Float Assortativity metric
risk_rating String Xerberus Risk Rating (AAA, BB, etc.)
risk_score Float Xerberus Risk Score
token.symbol String Token symbol (e.g., USDC, WETH)
token.address String Token contract address

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xerberus_metrics_sdk-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xerberus_metrics_sdk-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file xerberus_metrics_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: xerberus_metrics_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for xerberus_metrics_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff53df8666465f6252948a6f6a96ad8696c695a0470b50d94e96e7b88ce806cc
MD5 f240b0bd68560740dc27156464229bab
BLAKE2b-256 91da06641adb9e4c5b374e2e04fe9c74e025bad6169d73bc67682a687d48fc04

See more details on using hashes here.

File details

Details for the file xerberus_metrics_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xerberus_metrics_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcd5bc9814b6690ffca2ee42563f71467308d567f03c311192cc4b0e036d5514
MD5 b7d1d967f828bc207134b85de99c543b
BLAKE2b-256 1dcecd697add0f0cb35bcd82751bc63ba3bc5b422e9088431d413cc2351d82c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page