Onchain data
Onchain data is what a blockchain records about itself: blocks, transactions, the event logs contracts emit, and the state of each account, such as its balance. The chain’s nodes keep it, and anyone can read it. Offchain data, such as an exchange’s prices, comes from outside the chain and needs another source.
In BlockJuice
BlockJuice reads onchain data in two ways. A call source reads state. It asks an RPC node for a value at one block, such as a wallet’s ETH balance. A stream source reads history. It reads a range of blocks through SQD Portal and keeps what it needs, such as every ERC-20 Transfer log of the tokens you list.
Both write raw JSON rows into a raw table, such as raw.ethereum_erc20_transfers, and dbt builds them into tables in the analytics schema. Most sources read only the wallets, tokens, feeds and contracts you list in their addresses.json, so their tables cover the addresses you follow, not the whole chain.
BlockJuice loads onchain data from Ethereum, Arbitrum, Base, Polygon, Solana, Bitcoin and Hyperliquid’s HyperCore. Exchange prices come from the public APIs of Binance and Coinbase, which are offchain. Both kinds sit in the same Postgres, so one SQL query can read them together.
Example
A wallet’s balance is state, one value at one block. This query reads the latest ETH and ERC-20 balances BlockJuice loaded on Ethereum, in base units.
select wallet, asset_type, asset, balance, block_number
from analytics.latest_balances
where chain = 'ethereum'
order by wallet, asset