Skip to content

Commit

Permalink
Add block_date to social trades
Browse files Browse the repository at this point in the history
  • Loading branch information
aalan3 committed Jul 4, 2024
1 parent c619546 commit 83205c1
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion macros/models/_sector/social/enrich_social_trades.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% macro enrich_social_trades(base_trades) %}

SELECT
SELECT
t.blockchain AS blockchain
, CAST(date_trunc('month', t.block_time) AS date) AS block_month
, t.block_date
, t.block_time
, t.block_number
, t.project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

{% set cipher_start_date = '2023-09-20' %}

SELECT
SELECT
'arbitrum' AS blockchain
, evt_block_time AS block_time
, evt_block_number AS block_number
, cast(date_trunc('day', l.block_time) as date) as block_date
, 'cipher' AS project
, trader
, subject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

{% set post_tech_start_date = '2023-08-30' %}

SELECT
SELECT
'arbitrum' AS blockchain
, evt_block_time AS block_time
, evt_block_number AS block_number
, cast(date_trunc('day', evt_block_time) as date) as block_date
, 'post_tech' AS project
, trader
, subject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ WITH base_union AS (
blockchain
, block_time
, block_number
, block_date
, project
, trader
, subject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ WITH base_union AS (
blockchain
, block_time
, block_number
, block_date
, project
, trader
, subject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

{% set stars_arena_start_date = '2023-09-20' %}

SELECT
SELECT
'avalanche_c' AS blockchain
, txs.block_time
, txs.block_number
, cast(date_trunc('day', txs.block_time) as date) as block_date
, 'stars_arena' AS project
, bytearray_ltrim(bytearray_substring(logs.data, 1, 32)) AS trader
, bytearray_ltrim(bytearray_substring(logs.data, 1 + 32, 32)) AS subject
Expand Down
3 changes: 2 additions & 1 deletion models/_sector/social/base/friend_tech_base_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

{% set friend_tech_start_date = '2023-08-10' %}

SELECT
SELECT
'base' AS blockchain
, evt_block_time AS block_time
, evt_block_number AS block_number
, cast(date_trunc('day', evt_block_time) as date) as block_date
, 'friend_tech' AS project
, trader
, subject
Expand Down
1 change: 1 addition & 0 deletions models/_sector/social/base/social_base_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ WITH base_union AS (
blockchain
, block_time
, block_number
, block_date
, project
, trader
, subject
Expand Down
3 changes: 2 additions & 1 deletion models/_sector/social/bnb/friend3_bnb_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

{% set friend3_start_date = '2023-09-20' %}

SELECT
SELECT
'bnb' AS blockchain
, evt_block_time AS block_time
, evt_block_number AS block_number
, cast(date_trunc('day', evt_block_number) as date) as block_date
, 'friend3' AS project
, trader
, subject
Expand Down
1 change: 1 addition & 0 deletions models/_sector/social/bnb/social_bnb_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ WITH base_union AS (
blockchain
, block_time
, block_number
, block_date
, project
, trader
, subject
Expand Down
3 changes: 2 additions & 1 deletion models/_sector/social/social_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ with base_union as (
SELECT *
FROM (
{% for chain_specific_model in chain_specific_models %}
SELECT
SELECT
blockchain
, block_time
, block_number
, block_date
, project
, trader
, subject
Expand Down

0 comments on commit 83205c1

Please sign in to comment.