Determine whether an Aptos primary fungible store actually exists
An owner and fungible asset metadata determine a primary store address even before a store has been created there. Indexers need to represent the distinction between a predictable address and a live store.
Derive the address for one exact metadata object
Use the owner account and the metadata Object for the asset under inspection. Two assets can share a display symbol and produce different primary addresses for the same owner. Test existence before interpreting the address as a holder record.
let location = primary_fungible_store::primary_store_address(owner, metadata);
let allocated = fungible_asset::store_exists(location);
Represent missing, empty and secondary stores independently
A missing store can later be created by a deposit path that ensures existence. A live primary store can hold zero after a withdrawal. The owner can also use secondary stores for the same asset, so this test alone cannot calculate the total held across all stores. Keep metadata address and store address as distinct identifiers.