Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add arbitrum-stack gas fees #7909

Merged
merged 17 commits into from
Mar 31, 2025
Merged

Conversation

Hosuke
Copy link
Collaborator

@Hosuke Hosuke commented Mar 24, 2025

towards DUX-944

@github-actions github-actions bot marked this pull request as draft March 24, 2025 09:09
@github-actions github-actions bot added WIP work in progress dbt: hourly covers the hourly dbt subproject labels Mar 24, 2025
check_columns:
- tx_fee_raw
# - dbt_utils.expression_is_true:
# expression: "element_at(tx_fee_breakdown_raw, 'l2_base_fee') + element_at(tx_fee_breakdown_raw, 'l2_surplus_fee') + element_at(tx_fee_breakdown_raw, 'l1_base_fee') + element_at(tx_fee_breakdown_raw, 'l1_surplus_fee') = tx_fee_raw"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May change this to double typed testing, but not meaningful.

@Hosuke Hosuke marked this pull request as ready for review March 25, 2025 18:50
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Mar 25, 2025
@jeff-dude
Copy link
Member

okay, for our three chains on arbitrum orbit stack, looks like they all use base fee from blocks for the calculation. the below three tx's all match the explorer if we use the tx_fee_raw_alternative approach. i think this means we should use that calculation in all three models.

can you add all three into this PR and add / modify existing?

with
    corn as (
        --https://cornscan.io/tx/0xf4e150632515c82cab0d634346e30ce4768349bcf65ce5e759a814565d375685
        select
            t.block_time,
            t.block_number,
            t.hash as tx_hash,
            t.type,
            t.gas_limit,
            t.gas_price,
            b.base_fee_per_gas,
            t.gas_used,
            t.gas_price * t.gas_used as tx_fee_raw,
            b.base_fee_per_gas * t.gas_used as tx_fee_raw_alternative
        from
            corn.transactions as t
            inner join corn.blocks as b on t.block_number = b.number
            and b.date >= date '2025-03-24'
        where
            t.block_time >= date '2025-03-24'
            and t.type = 'DynamicFee'
            and t.hash = 0xf4e150632515c82cab0d634346e30ce4768349bcf65ce5e759a814565d375685
    ),
    apechain as (
        --https://apescan.io/tx/0xcc0171a08bc320a7da74bd6e6343630a53b584f933913f66f603be92b194fe7f
        select
            t.block_time,
            t.block_number,
            t.hash as tx_hash,
            t.type,
            t.gas_limit,
            t.gas_price,
            b.base_fee_per_gas,
            t.gas_used,
            t.gas_price * t.gas_used as tx_fee_raw,
            b.base_fee_per_gas * t.gas_used as tx_fee_raw_alternative
        from
            apechain.transactions as t
            inner join apechain.blocks as b on t.block_number = b.number
            and b.date >= date '2025-03-24'
        where
            t.block_time >= date '2025-03-24'
            and t.type = 'DynamicFee'
            and t.hash = 0xcc0171a08bc320a7da74bd6e6343630a53b584f933913f66f603be92b194fe7f
    ),
    degen as (
        --https://explorer.degen.tips/tx/0x1e6fe5d34aadc5ee5bf40aaa6e79912fbec266e684bb77309001a14885afaaf3
        select
            t.block_time,
            t.block_number,
            t.hash as tx_hash,
            t.type,
            t.gas_limit,
            t.gas_price,
            b.base_fee_per_gas,
            t.gas_used,
            t.gas_price * t.gas_used as tx_fee_raw,
            b.base_fee_per_gas * t.gas_used as tx_fee_raw_alternative
        from
            degen.transactions as t
            inner join degen.blocks as b on t.block_number = b.number
            and b.date >= date '2025-03-24'
        where
            t.block_time >= date '2025-03-24'
            and t.type = 'DynamicFee'
            and t.hash = 0x1e6fe5d34aadc5ee5bf40aaa6e79912fbec266e684bb77309001a14885afaaf3
    )
select
    *
from
    degen
limit
    10

@jeff-dude jeff-dude self-assigned this Mar 26, 2025
@jeff-dude jeff-dude added in review Assignee is currently reviewing the PR and removed ready-for-review this PR development is complete, please review labels Mar 26, 2025
@jeff-dude
Copy link
Member

i know we don't have degen in transfers yet, it was just migrated to our full offering, but we might as well add since we have it figured out here.

@Hosuke
Copy link
Collaborator Author

Hosuke commented Mar 28, 2025

I will try to make orbit gas a macro then.

@Hosuke Hosuke changed the title Add arb-stack gas fees Add arbitrum-stack gas fees Mar 28, 2025
@jeff-dude
Copy link
Member

same feedback here on the CI param from opstack PR

@Hosuke
Copy link
Collaborator Author

Hosuke commented Mar 29, 2025

same feedback here on the CI param from opstack PR

Fixed.

@0xRobin 0xRobin added ready-for-merging and removed in review Assignee is currently reviewing the PR labels Mar 31, 2025
@0xRobin 0xRobin merged commit 7639ef3 into duneanalytics:main Mar 31, 2025
4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dbt: hourly covers the hourly dbt subproject ready-for-merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants