Tracking Assets
In tracking these assets, we are mostly interested in “where are they now?” and “how did they get there?”. In a more practical sense, that translates to tracking their ownership and their transfer history. On Dune, we track these assets by looking at the events emitted by the smart contracts that manage them. For example, theTransfer
event is emitted by the ERC20, ERC721, and ERC1155 standards when a token is transferred from one address to another. By tracking these events, we can create a history of the ownership and transfer of these assets.
To keep track of the balances, we also look at the balanceOf
function, which returns the balance of a particular address for a given token and store that data in our database.