charliemarketplace
    discord@charliemktplace

    Onchain Summit: Example Transaction

    db-image-image-Xj7h
    db-image-image-yHze
    ethereum.core.fact_transactions
    • Users submit transactions via RPC to nodes (typically using their browser wallet)

    • Transactions come from an Externally Owned Account (from_address) and

    • call contracts (to_address) by calling a

    • function (origin_function_signature) and including relevant

    • arguments to the function (input_data).

    • Blocks (block_number) aggregate these

    • transactions (tx_hash).

    ethereum.core.fact_transactions
    • If raw ETH (value) is used the value is > 0; otherwise it is 0.

    • Users bid (gas_price) to have their transactions included.

    • More complicated transactions are more expensive (tx_fee)

    • due to computation (gas_used), because tx complexity varies, users set a

    • limit to their request (gas_limit) to ensure they aren't bankrupted by an endless tx.

    • Since EIP-1559 (tx_type) a portion of fees are

    • burned (gas_price - max_priority)

    • An only-used-once (nonce) is attached to transactions to make sure they can't be reused & make it possible to cancel/replace them before they're included.

    ethereum.core.ez_decoded_event_logs
    • Because transactions are complicated, most contracts will emit logs so humans can review transactions and understand what happened.

    • Note: Not all developers value human readability, so not all contracts will emit logs.

    • Contracts must have their Application Binary Interface (ABI) published to translate from computer code to human language. (ethereum.core.dim_contracts_abis)

    • Developers choose which code/results to emit as logs, so logs may not include all the information you could want- it is also possible they are not accurately representing the code.

    • Logs are 99% trustworthy, but beware that 1%.

    db-image-image-nU6t
    ethereum.core.ez_decoded_event_logs
    • Flipside ez_ tables combine our fact and dim tables to make analytics easier.

    • Here, we include the contract name, event name, and the decoded logs (via the contract ABIs) all in 1 row per event_index.

    ethereum.core.ez_dex_swaps
    • Flipside uses these logs to curate even easier to use tables like ez_token_transfers for when the event_name is Transfer; and ez_dex_swaps when Swap events happen.

    • Etherscan shows that the primary event of this transaction was a swap on the uniswap-v2 platform.

    • Flipside uses the hourly closing price of the assets in a swap to estimate the amount_in_usd and amount_out_usd.

    • NOTE: Etherscan will by default show you the current value of the tokens, not the value when the trade occurred.

    db-image-image-wGDS
    What Happened in this Transaction?
    1. 0. The user (from_address 0xf91...43bf) included raw ETH (value) in their contract call to the Coinbase Wallet Proxy (to_address 0xe66B...3750).

    2. NOTE: Raw ETH does not emit any logs. (it is visible in traces data which is beyond the scope of this tutorial).

    3. 1. The Coinbase Wallet Proxy uses the 0xExchangeRouter which deposited the raw ETH to get Wrapped Ether (WETH) (dst: 0xdef...eff).

    4. 2. The router (src: 0xdef...eff) sends the WETH to the Uniswap v2 WETH-USDC Pool (dst: 0xb4...c9dc).

    5. 3. The pool sends USDC to the Proxy Wallet (0xe66B...3750)

    6. 4. The Uniswap v2 pool updates its reserve balance and emits a log for the new reserve balance.

    7. 5. The Uniswap v2 pool summarizes the transaction and emits a log.

    8. 6. The Coinbase Wallet Proxy (from: 0xe66B...3750) sends the USDC to the user (0xf91...43bf)

    Disclaimer: Flipside AI is here to help but it can make mistakes. Always review outputs and use the upvote/downvote buttons to help us improve. This content is not financial advice.