Skip to main content

Module balance

Module balance 

Source
Expand description

Sequential pipeline that feeds the schema::balance CF.

For every transaction in the checkpoint, call sui_types::balance_change::derive_detailed_balance_changes_2 and forward the returned (coin_amount, address_amount) deltas straight into the CF as a single combined merge operand per (owner, coin_type).

The derive_detailed_balance_changes_2 helper already consolidates input and output coin objects (for the coin side) and parses the effects’ accumulator writes (for the address side), so the pipeline doesn’t need to walk objects itself.

Balances are an address-level aggregate: the helper’s coin side counts only AddressOwner and ConsensusAddressOwner coins (combined per address), matching Balance::restore’s owner filter below – the two must agree, or a store restored from a live snapshot would diverge from one built by tip indexing. This is the same rule sui-indexer-alt-consistent-store’s balances handler documents; object-owned coins stay discoverable through object_by_owner under their parent, they are just not a balance.

Structs§

Balance
Pipeline marker for balance.
Delta