Skip to content

Commit

Permalink
Add block_time and block_slot to solana_utils balances (duneanalytics…
Browse files Browse the repository at this point in the history
…#6539)

* Add block_time and block_slot to solana_utils balances

* test: hardcode small time window

* fix incremental

* Revert "fix incremental"

This reverts commit 1a2ed02.

* Revert "test: hardcode small time window"

This reverts commit 7ccb104.

---------

Co-authored-by: jeff-dude <jeff@dune.xyz>
  • Loading branch information
enriquerodbe and jeff-dude authored Aug 13, 2024
1 parent f3cfd20 commit 4a6999c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ SELECT
, token_mint_address
, token_balance
, token_balance_owner
, block_time
, block_slot
, {{ dbt_utils.generate_surrogate_key(['address', 'token_mint_address', 'day']) }} as unique_address_key
, now() as updated_at
FROM updated_balances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ WITH
, token_mint_address
, token_balance
, token_balance_owner
, block_time
, block_slot
, row_number() OVER (partition by address order by day desc) as latest_balance
FROM {{ ref('solana_utils_daily_balances') }}
{% if is_incremental() %}
Expand All @@ -31,6 +33,8 @@ WITH

SELECT
ub.address
, ub.block_time
, ub.block_slot
, ub.sol_balance
, ub.token_balance
, coalesce(ub.token_mint_address, tk.token_mint_address) as token_mint_address
Expand Down

0 comments on commit 4a6999c

Please sign in to comment.