xerberus.scanner
Documentation for eth_defi.xerberus.scanner Python module.
Xerberus risk scanner with DuckDB storage.
Orchestrates fetching registry scores and optional vault lists from the
Xerberus public REST API and storing them in
XerberusDatabase.
HTTP is serial and paced (see session rate limits). Do not fan out parallel authenticated calls under the public 10 requests / 60 s quota.
Example:
import os
from eth_defi.xerberus.session import create_xerberus_session
from eth_defi.xerberus.scanner import scan_xerberus
# Pass api_email explicitly when known; never invent the registered email.
session = create_xerberus_session(
api_key=os.environ["XERBERUS_API_KEY"],
api_email=os.environ["XERBERUS_API_EMAIL"],
)
db = scan_xerberus(session=session)
try:
print(db.get_entity_counts())
finally:
db.close()
Functions
|
Scan Xerberus registry (and optional vault lists) into DuckDB. |
- scan_xerberus(session, db_path=PosixPath('/home/runner/.tradingstrategy/vaults/xerberus/xerberus.duckdb'), fetch_vault_lists=True, fetch_reports=True, report_limit=50, registry_types=('pool', 'protocol'), timeout=60.0, dry_run=False)
Scan Xerberus registry (and optional vault lists) into DuckDB.
Soft pre-flight registry healthcheck
Fetch registry scores for pool + protocol
Insert snapshots and upsert
score_dailyOptionally fetch per-platform vault lists
Optionally backfill a capped number of report URLs
Caller must
close()the returned database (unlessdry_run).- Parameters
session (eth_defi.xerberus.session.XerberusSession) – Authenticated Xerberus session.
db_path (pathlib.Path) – DuckDB path.
fetch_vault_lists (bool) – When
True, poll/vault/listfor each known platform.fetch_reports (bool) – When
True, fetch dendrogram URLs for a capped set of pools.report_limit (int) – Max report download calls this run.
registry_types (tuple[str, ...]) – Entity types passed to
/registry/scores.timeout (float) – HTTP timeout seconds.
dry_run (bool) – When
True, log the plan and returnNonewithout writing.
- Returns
Open
XerberusDatabase, orNoneon dry run.- Return type