# Methods

Examples assume:

```python
from tribulnation.sdk import ReportSDK

report = ReportSDK.load('sdk.toml')
```
### `snapshot`

```python
snapshot(assets=None) -> SnapshotRecord
```

Fetch 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).

<div data-venue="binance" data-venue-name="Binance">

**Binance**

Spot, Funding and Simple Earn only; no futures compartment.

```python
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 assets
```

</div><!-- /venue -->

<div data-venue="bit2me" data-venue-name="Bit2Me">

**Bit2Me**

```python
sdk = 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 assets
```

</div><!-- /venue -->

<div data-venue="bybit" data-venue-name="Bybit">

**Bybit**

```python
sdk = 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 assets
```

</div><!-- /venue -->

<div data-venue="coinbase" data-venue-name="Coinbase">

**Coinbase**

```python
sdk = 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 assets
```

</div><!-- /venue -->

<div data-venue="deribit" data-venue-name="Deribit">

**Deribit**

Accessible subaccounts; cash balances and signed base-unit positions, not equity-as-cash.

```python
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 assets
```

</div><!-- /venue -->

<div data-venue="dydx" data-venue-name="dYdX">

**dYdX**

```python
sdk = 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 assets
```

</div><!-- /venue -->

<div data-venue="ethereum" data-venue-name="Ethereum (EVM)">

**Ethereum (EVM)**

Requires an address and configured data providers; provider settings can be supplied in Python.

```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 assets
```

</div><!-- /venue -->

<div data-venue="hyperliquid" data-venue-name="Hyperliquid">

**Hyperliquid**

```python
sdk = 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 assets
```

</div><!-- /venue -->

<div data-venue="kraken" data-venue-name="Kraken">

**Kraken**

```python
sdk = 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 assets
```

</div><!-- /venue -->

<div data-venue="kucoin" data-venue-name="KuCoin">

**KuCoin**

Classic main/trade and Earn only; futures and legacy margin compartments excluded.

```python
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 assets
```

</div><!-- /venue -->

<div data-venue="mexc" data-venue-name="MEXC">

**MEXC**

```python
sdk = 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 assets
```

</div><!-- /venue -->

### `history`

```python
history(start=None, end=None) -> AsyncIterable[HistoryRecord]
```

Stream your transaction history as `HistoryRecord`s, 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. `None` uses the venue's documented default lookback.
- `end`: Inclusive upper bound. `None` uses now or the venue's latest available data.

<div data-venue="binance" data-venue-name="Binance">

**Binance**

Best-effort spot-side API history; retention, delisted markets and excluded sources may require file ingestion.

```python
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 records
```

</div><!-- /venue -->

<div data-venue="bit2me" data-venue-name="Bit2Me">

**Bit2Me**

```python
sdk = report.venue('bit2me')
count = 0
async with sdk:
  async for record in sdk.history(start, end):
    count += 1
print('bit2me', count, 'records')
```

```
bit2me 2 records
```

</div><!-- /venue -->

<div data-venue="bybit" data-venue-name="Bybit">

**Bybit**

```python
sdk = report.venue('bybit')
count = 0
async with sdk:
  async for record in sdk.history(start, end):
    count += 1
print('bybit', count, 'records')
```

```
bybit 2 records
```

</div><!-- /venue -->

<div data-venue="coinbase" data-venue-name="Coinbase">

**Coinbase**

```python
sdk = report.venue('coinbase')
count = 0
async with sdk:
  async for record in sdk.history(start, end):
    count += 1
print('coinbase', count, 'records')
```

```
coinbase 2 records
```

</div><!-- /venue -->

<div data-venue="deribit" data-venue-name="Deribit">

**Deribit**

Transaction-log rows include unknown observations for unsupported trade/settlement interpretations.

```python
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 records
```

</div><!-- /venue -->

<div data-venue="dydx" data-venue-name="dYdX">

**dYdX**

Full older chain history requires an archive provider, not a shorter fallback window.

```python
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 records
```

</div><!-- /venue -->

<div data-venue="ethereum" data-venue-name="Ethereum (EVM)">

**Ethereum (EVM)**

Requires configured data providers; chain history and interpretation depend on provider/configuration.

```python
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 records
```

</div><!-- /venue -->

<div data-venue="hyperliquid" data-venue-name="Hyperliquid">

**Hyperliquid**

```python
sdk = report.venue('hyperliquid')
count = 0
async with sdk:
  async for record in sdk.history(start, end):
    count += 1
print('hyperliquid', count, 'records')
```

```
hyperliquid 2 records
```

</div><!-- /venue -->

<div data-venue="kraken" data-venue-name="Kraken">

**Kraken**

```python
sdk = report.venue('kraken')
count = 0
async with sdk:
  async for record in sdk.history(start, end):
    count += 1
print('kraken', count, 'records')
```

```
kraken 2 records
```

</div><!-- /venue -->

<div data-venue="kucoin" data-venue-name="KuCoin">

**KuCoin**

Classic spot fills and successful capital events; native retention limits apply.

```python
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 records
```

</div><!-- /venue -->

<div data-venue="mexc" data-venue-name="MEXC">

**MEXC**

```python
sdk = 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
```

</div><!-- /venue -->
