Accounts & Records
This section defines the two key data structures used in Connect: accounts and records. Understanding their relationship is essential for interpreting balance data correctly.
Account
An account represents a connection to an exchange or custodian (e.g., Coinbase). It serves as the top-level container for balance data.
- Each account reflects the full scope of a user’s holdings on a specific platform.
- Balances are typically queried at the account level to provide a unified view across all assets.
Example:
A user’s Coinbase account is accessed via credentials like a username and password. Within this account, they may hold balances in multiple assets (e.g., Bitcoin, USDT, USD). These are all grouped under the same account.
Record
A record is an individual asset holding within an account. Each record corresponds to a specific currency or asset and contributes to the total account balance.
Example:
If a user holds Bitcoin, USDT, and USD in their Coinbase account, Hoseki will store this as one account with three records—one for each asset. Each record includes the balance and metadata for that specific asset.
Account → Records Structure (Example)
A Coinbase account with 3 assets:
+----------------------------+
| Coinbase Account |
| +----------------------+ |
| | Bitcoin Record | |
| +----------------------+ |
| | USDT Record | |
| +----------------------+ |
| | USD Record | |
| +----------------------+ |
+----------------------------+
- Account: Represents the connection to the exchange (Coinbase).
- Records: Each asset (BTC, USDT, USD) held within the account is represented as a record.