Links

Event logs

Our docs are now available at dune.com/docs. We'll keep this around as a reference, but we won't update them and eventually plan to deprecate.

Event logs

Smart Contracts emit event logs when certain predefined actions are completed. The structure published in these logs is predefined by the developer of the smart contract, the content is dynamically created during the transaction. Logs are useful for monitoring, alerting and in general keeping track of what happens inside of a smart contract. Logs are your best friend as a data analyst since they reliably present you with data that is intended to be analysed post factum. If you ever want to see which logs can be emitted by a smart contract, you can simply search for the keyword emit in the source code of the smart contract. We will decode all event logs for smart contracts into tables named accordingly to this schema: projectname."contractName_evt_eventName".
Let's stay in the context of the uniswap v3 factory and look at the event that gets emitted upon the creation of a new pool. The event is called PoolCreated and gets emitted every time somebody successfully deployed a new Uniswap V3 pool by calling the function createPool. The event will readily give us information like the tokens in the pool, the fee tier of this pool and the tick spacing. In Etherscan, you can easily look at the event logs of transaction by opening the logs tab. In Dune, this particular event will be stored in the table uniswap_v3."Factory_evt_PoolCreated".
Multiple Instances
If there is multiple instances of a contract we will collect all event logs across all instances of this smart contract in one table. For example, all uniswap v3 pool swap events are stored in the table `` uniswap_v3."Pair_evt_Swap". The column contract_address indicates as to which smart contract emitted this event.
Further Reading: