Methods
Examples assume:
from tribulnation.sdk import ReportSDK
report = ReportSDK.load('sdk.toml')snapshot
snapshot(assets=None) -> SnapshotRecordFetch the current balances and positions of the account.
The record carries a Provenance tracing where it came from.
Args
assets: Assets to look for, on venues that can't enumerate holdings themselves (EVM chains). Ignored where enumeration is native (CEXs).
Spot, Funding and Simple Earn only; no futures compartment.
sdk = report.venue('binance')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('binance', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')binance 1 subaccounts 2 balance assetssdk = report.venue('bit2me')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('bit2me', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')bit2me 1 subaccounts 2 balance assetssdk = report.venue('bybit')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('bybit', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')bybit 1 subaccounts 2 balance assetssdk = report.venue('coinbase')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('coinbase', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')coinbase 1 subaccounts 2 balance assetsAccessible subaccounts; cash balances and signed base-unit positions, not equity-as-cash.
sdk = report.venue('deribit')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('deribit', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')deribit 1 subaccounts 2 balance assetssdk = report.venue('dydx')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('dydx', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')dydx 1 subaccounts 2 balance assetsRequires an address and configured data providers; provider settings can be supplied in Python.
sdk = report.venue('ethereum')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('ethereum', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')ethereum 1 subaccounts 2 balance assetssdk = report.venue('hyperliquid')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('hyperliquid', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')hyperliquid 1 subaccounts 2 balance assetssdk = report.venue('kraken')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('kraken', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')kraken 1 subaccounts 2 balance assetsClassic main/trade and Earn only; futures and legacy margin compartments excluded.
sdk = report.venue('kucoin')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('kucoin', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')kucoin 1 subaccounts 2 balance assetssdk = report.venue('mexc')
async with sdk:
record = await sdk.snapshot()
snapshot = record.snapshot
print('mexc', len(snapshot.subaccounts), 'subaccounts',
len(snapshot.balances), 'balance assets')mexc 1 subaccounts 2 balance assetshistory
history(start=None, end=None) -> AsyncIterable[HistoryRecord]Stream your transaction history as HistoryRecords, each with its Provenance.
API history is best-effort, not a completeness guarantee. Implementations accept either omitted bound and document their endpoint-specific default lookbacks. Retention, discovery and endpoint limits may leave gaps for file ingestion.
Args
start: Inclusive lower bound.Noneuses the venue's documented default lookback.end: Inclusive upper bound.Noneuses now or the venue's latest available data.
Best-effort spot-side API history; retention, delisted markets and excluded sources may require file ingestion.
sdk = report.venue('binance')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('binance', count, 'records')binance 2 recordssdk = report.venue('bit2me')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('bit2me', count, 'records')bit2me 2 recordssdk = report.venue('bybit')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('bybit', count, 'records')bybit 2 recordssdk = report.venue('coinbase')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('coinbase', count, 'records')coinbase 2 recordsTransaction-log rows include unknown observations for unsupported trade/settlement interpretations.
sdk = report.venue('deribit')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('deribit', count, 'records')deribit 2 recordsFull older chain history requires an archive provider, not a shorter fallback window.
sdk = report.venue('dydx')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('dydx', count, 'records')dydx 2 recordsRequires configured data providers; chain history and interpretation depend on provider/configuration.
sdk = report.venue('ethereum')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('ethereum', count, 'records')ethereum 2 recordssdk = report.venue('hyperliquid')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('hyperliquid', count, 'records')hyperliquid 2 recordssdk = report.venue('kraken')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('kraken', count, 'records')kraken 2 recordsClassic spot fills and successful capital events; native retention limits apply.
sdk = report.venue('kucoin')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('kucoin', count, 'records')kucoin 2 recordssdk = report.venue('mexc')
count = 0
async with sdk:
async for record in sdk.history(start, end):
count += 1
print('mexc', count, 'records')mexc 2 records