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 Base WETH withdrawal and deposit events tracking for Balance Changes query #100

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,38 @@ weth_deposits_withdrawals_arbitrum as (

special_balance_changes_arbitrum as ( -- noqa: ST03
select * from weth_deposits_withdrawals_arbitrum
),

weth_deposits_withdrawals_base as (
-- deposits (contract deposits ETH to get WETH)
select
evt_block_time as block_time,
evt_tx_hash as tx_hash,
contract_address as token_address,
0x0000000000000000000000000000000000000000 as sender,
0x9008d19f58aabd9ed0d60971565aa8510560ab41 as receiver,
wad as amount
from weth_base.WETH9_evt_Deposit
where
evt_block_time >= cast('{{start_time}}' as timestamp) and evt_block_time < cast('{{end_time}}' as timestamp) -- partition column
and dst = 0x9008d19f58aabd9ed0d60971565aa8510560ab41
union distinct
-- withdrawals (contract withdraws ETH by returning WETH)
select
evt_block_time as block_time,
evt_tx_hash as tx_hash,
contract_address as token_address,
0x9008d19f58aabd9ed0d60971565aa8510560ab41 as sender,
0x0000000000000000000000000000000000000000 as receiver,
wad as amount
from weth_base.WETH9_evt_Withdrawal
where
evt_block_time >= cast('{{start_time}}' as timestamp) and evt_block_time < cast('{{end_time}}' as timestamp) -- partition column
and src = 0x9008d19f58aabd9ed0d60971565aa8510560ab41
),

special_balance_changes_base as ( -- noqa: ST03
select * from weth_deposits_withdrawals_base
)

-- combine results
Expand Down
Loading