Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.1 instead.

auradefi

Open-source, multi-tenant crypto data aggregator. The tenancy model of Vezgo, the DeFi position depth of DeBank, the transaction decomposition of Zerion, and Plaid's wire format — so crypto merges with bank and exchange data in one schema downstream.

Library first, service second. A Python host imports auradefi directly and pays no serialisation or network cost; the HTTP API is a thin shell over the importable core.

Status: alpha. All ten SPEC phases are implemented — 3,027 tests, green on a fresh clone with no API keys and no network. The capability table below says exactly what that does and does not mean; STATUS.md records the phase gates and known caveats, and docs/SPEC.md is the full design contract.

Install

pip install auradefi                # core — httpx is the only dependency
pip install 'auradefi[sql]'         # + the SQLModel ledger backend
pip install 'auradefi[api]'         # + the FastAPI HTTP surface

From a clone (no pip on your system python? scripts/bootstrap.sh handles it):

git clone https://github.com/auracarehq/auradefi
cd auradefi && bash scripts/bootstrap.sh
.venv/bin/pytest                              # 3,027 tests, offline, no keys
.venv/bin/python docs/examples/quickstart.py  # every phase, end to end

Using it

As a library — the host owns storage, transport, prices and the tick (SPEC §8):

from auradefi import Auradefi

auradefi = Auradefi(
    ledger=SqlModelLedger(session_factory=my_session_factory),  # your database
    source=MySource(),        # your transport: .balances() + .fetch_txlist()
    prices=MyPrices(),        # your price feed: .usd_prices()
)
user = auradefi.user("opaque-host-user-id")   # get-or-create, id is derived
user.connect_address("eip155:1", "0x…")       # validated now, not on a later tick
report = auradefi.sync(budget=5)              # budgeted, resumable, self-throttling
holdings, metrics = auradefi.holdings(), auradefi.scalar_metrics()

As a servicecreate_app takes ports you already built:

from auradefi.api.app import create_app
from auradefi.api.deps import Deps

app = create_app(Deps(tenancy=, keys=, ledger=, webhooks=, clock=))
# POST /auth/token   ·  POST /connections  ·  GET /crypto/sync  (Plaid's envelope)
# GET  /coverage     ·  POST /webhooks/endpoints  ·  POST /webhooks/…/replay

Both surfaces are walked — executably, offline — in docs/books/.

What works today

Coverage published as data, not prose optimism (rule #10). Every row marked works has an executable notebook under docs/books/ that runs offline and asserts its own outputs, plus a gate test under tests/.

Capability Phase Status
Quantity/Money: exact at 10^77, four-field wire form, raw always a JSON string, strict wire grammar 0 works02_money
CAIP-2/CAIP-19 parse + canonicalize, deterministic ast_… ids, both-ways asset registry 0 works — 5 seed chains (Ethereum, Polygon, Base, Bitcoin, Solana); 03_assets_chains
Asset groups (decimals-equality law, single fallback) + additive spam scoring (score + numbers, caller threshold) 0 works03_assets_chains
Ledger port: idempotent upsert, cursor sync with has_more paging, reorg = removed + re-added, resurrection, tenant isolation 0 works — memory and SQLModel backends; 04_ledger
Cassette replay harness (CassetteMissError offline guarantee) 0 works01_foundation
Style gates: size, structure, placement, layering (tests/style) 0 works — no allowlist
EVM balances → holdings, exact-Decimal USD totals, unpriced assets named not guessed 1 works — Etherscan V2 source + DefiLlama prices; 05_holdings
Tenancy: org/project/end-user, scoped adk_ keys, authEndpoint JWT mint, three-window quota, audit log 2 works — isolation gate actively tries to leak; 06_tenancy
Rich transactions: parts[]/acts[], fees as siblings carrying borne_by, derived type, ledger bridge, reorg + resurrection 3 works — EVM only, one act per transaction; 07_transactions
DeFi positions: adapter protocol, drill-down, group totals + health factor, signed synthetic-Holdings projection 4 works — Uniswap v2/v3, Aave v3, Lido/Rocket Pool; fixture-driven, see below; 08_positions
Embedding: from auradefi import Auradefi, host-owned session, budgeted two-phase sync, 26-metric scalar projection 5 works — second sync is a no-op proven by counting requests; 09_embedding
Bitcoin: pure-Python BIP32 xpub derivation, gap-20 scan, confirmed-only UTXO balances 6 works — p2wpkh + Esplora only; the extended key never reaches HTTP; 10_bitcoin_solana
Solana: SPL + Token-2022 balances, ScaledUiAmount carried both ways, signature history 7 works — balances only, no decode; 10_bitcoin_solana
HTTP API: Plaid /crypto/sync envelope, connections, /coverage generated as data, nine quota headers, batch holdings 8 works12_http_api
Webhooks: HMAC-SHA256 signed, durable over a pinned retry schedule, dead letter + replay 8 works12_http_api
Accounting: lot ledger, FIFO/LIFO/HIFO/ACB, realised + unrealised PnL, arbitrary-date PnL, Plaid tax_lots 9 works — 50,000-event gate; 11_accounting

What is not there

Stated plainly, because rule #10 cuts both ways.

  • No live network adapters beyond what the cassettes cover. Every I/O path is exercised against committed recordings. Pointing a source at the real Etherscan / Esplora / Solana RPC needs your own keys and endpoints, and has not been reconciled against an incumbent in CI.
  • Positions are fixture-driven. The ContractReader seam ships and every adapter is pinned to block-20,450,000 golden vectors, but no concrete on-chain reader ships — there is no eth_call transport and no multicall batcher in the package. A host must supply its own reader to run the adapters against a live chain.
  • No multicall anywhere. Token balances cost one request each.
  • One price oracle (DefiLlama), current prices only. No fallback feed and no historical price service, so accounting marks are the caller's.
  • Two ledger backends: in-memory and SQLModel/sqlite. Postgres should work through the same port; only sqlite is exercised. Tenancy, keys, quota, audit and webhook stores are in-memory only.
  • Cosmos is absent, as is every EVM chain the registry does not seed, along with exchange connections, NFTs and protocol-specific decoders (acts[] is always one act and protocol is always None).
  • Solana transaction decode is not implemented — balances and signature history only.
  • No async surface, no background worker, no scheduler: the host owns the tick.

The rules the code lives by

  • Money is a tagged decimal string; a raw amount is never a JSON integer.
  • Asset ids are deterministic CAIP-19 and permanently stable.
  • Every movement is a part[]; fees are siblings, never movements.
  • Multi-tenancy is designed in; two tenants can never see each other's data.
  • pytest passes on a fresh clone with no API keys — cassettes committed.
  • Files cap at 400 lines with no allowlist; the layer contract is enforced by tests (tests/style/), not by convention.

Docker

docker compose run --rm test    # full offline suite in a network-less container
docker compose run --rm demo    # quickstart against the installed wheel

Docs

Licence

Apache-2.0 — see LICENSE.

Download files

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

Source Distribution

auradefi-0.1.0.tar.gz (538.2 kB view details)

Uploaded Source

Built Distribution

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

auradefi-0.1.0-py3-none-any.whl (240.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: auradefi-0.1.0.tar.gz
  • Upload date:
  • Size: 538.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for auradefi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 93eaf47f94330c713a62138a53b7fe1367c133ede973d851389a564b4551f30c
MD5 a8fc7cf9a8850315610f085dcdf9c6b3
BLAKE2b-256 bfbb9c379c13696e84b7ac19cc838002414454551bc93682840b2b430d5134ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: auradefi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 240.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for auradefi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f93cca4f4ec61544654204cc741c1b04b1482c8a33088876404c52b305fb4027
MD5 93f86b8cfa088f1cab365ad3d1a761f5
BLAKE2b-256 e3fccb8bba09c13a16ee7ac3eef6f7bf78dcbec33917cc5d6e9fcf61386a43da

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