Skip to content

Commit

Permalink
fixing transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMelendez01 committed Dec 16, 2024
1 parent ba5cc22 commit b7d63a9
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 81 deletions.
156 changes: 78 additions & 78 deletions macros/rolling_active_addresses.sql
Original file line number Diff line number Diff line change
Expand Up @@ -235,86 +235,86 @@
),
{% elif chain == 'aptos' %}
single_signed_transactions as (
select block_timestamp::date as date, parse_json(signature):public_key as signer
from aptos_flipside.core.fact_transactions
where
tx_type = 'user_transaction'
and success = 'true'
and parse_json(signature):public_key is not null
{% if is_incremental() %}
and block_timestamp::date > (select dateadd('day', -30, max(date)) from {{ this }})
{% endif %}
),
primary_multi_signed_transactions as (
select
block_timestamp::date as date,
parse_json(signature):sender:public_key as signer
from aptos_flipside.core.fact_transactions
where
tx_type = 'user_transaction'
and success = 'true'
and parse_json(signature):sender is not null
{% if is_incremental() %}
and block_timestamp::date > (select dateadd('day', -30, max(date)) from {{ this }})
{% endif %}
),
raw_secondary_multi_signed_transactions as (
select
block_timestamp,
parse_json(signature):secondary_signers as secondary_signers
from aptos_flipside.core.fact_transactions
where
tx_type = 'user_transaction'
and success = 'true'
and parse_json(signature):secondary_signers is not null
select block_timestamp::date as date, parse_json(signature):public_key as signer
from aptos_flipside.core.fact_transactions
where
tx_type = 'user_transaction'
and success = 'true'
and parse_json(signature):public_key is not null
{% if is_incremental() %}
and block_timestamp::date > (select dateadd('day', -30, max(date)) from {{ this }})
{% endif %}
),
primary_multi_signed_transactions as (
select
block_timestamp::date as date,
parse_json(signature):sender:public_key as signer
from aptos_flipside.core.fact_transactions
where
tx_type = 'user_transaction'
and success = 'true'
and parse_json(signature):sender is not null
{% if is_incremental() %}
and block_timestamp::date > (select dateadd('day', -30, max(date)) from {{ this }})
{% endif %}
),
raw_secondary_multi_signed_transactions as (
select
block_timestamp,
parse_json(signature):secondary_signers as secondary_signers
from aptos_flipside.core.fact_transactions
where
tx_type = 'user_transaction'
and success = 'true'
and parse_json(signature):secondary_signers is not null
{% if is_incremental() %}
and block_timestamp::date > (select dateadd('day', -30, max(date)) from {{ this }})
{% endif %}
),
secondary_multi_signed_transactions as (
select block_timestamp::date as date, value:"public_key" as signer
from
raw_secondary_multi_signed_transactions,
lateral flatten(input => secondary_signers)
where value:"public_key" is not null
),
raw_bitmap_multi_sig_transactions as (
select block_timestamp::date as date, value:"public_keys" as public_keys
from
raw_secondary_multi_signed_transactions,
lateral flatten(input => secondary_signers)
),
bitmap_multi_sig_transactions as (
select date, value as signer
from raw_bitmap_multi_sig_transactions, lateral flatten(input => public_keys)
),
combined_signers as (
select date, signer
from single_signed_transactions
union all
select date, signer
from primary_multi_signed_transactions
union all
select date, signer
from secondary_multi_signed_transactions
union all
select date, signer
from bitmap_multi_sig_transactions
),
distinct_dates as (
select distinct
date as raw_date
from combined_signers
{% if is_incremental() %}
and block_timestamp::date > (select dateadd('day', -30, max(date)) from {{ this }})
where raw_date > (select dateadd('day', -1, max(date)) from {{ this }})
{% endif %}
),
secondary_multi_signed_transactions as (
select block_timestamp::date as date, value:"public_key" as signer
from
raw_secondary_multi_signed_transactions,
lateral flatten(input => secondary_signers)
where value:"public_key" is not null
),
raw_bitmap_multi_sig_transactions as (
select block_timestamp::date as date, value:"public_keys" as public_keys
from
raw_secondary_multi_signed_transactions,
lateral flatten(input => secondary_signers)
),
bitmap_multi_sig_transactions as (
select date, value as signer
from raw_bitmap_multi_sig_transactions, lateral flatten(input => public_keys)
),
combined_signers as (
select date, signer
from single_signed_transactions
union all
select date, signer
from primary_multi_signed_transactions
union all
select date, signer
from secondary_multi_signed_transactions
union all
select date, signer
from bitmap_multi_sig_transactions
),
distinct_dates as (
select distinct
date as raw_date
from combined_signers
{% if is_incremental() %}
where raw_date > (select dateadd('day', -1, max(date)) from {{ this }})
{% endif %}
),
distinct_dates_for_rolling_active_address as (
select distinct
date as raw_date
, signer as from_address
from combined_signers
),
),
distinct_dates_for_rolling_active_address as (
select distinct
date as raw_date
, signer as from_address
from combined_signers
),
{% elif chain == 'zora' %}
distinct_dates as (
select
Expand Down
1 change: 0 additions & 1 deletion models/projects/across/raw/ez_across_bridge_transfers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ select
from {{ref('fact_across_transfers')}} t1
left join {{ref('chain_ids')}} t2 on t1.destination_chain_id = t2.id
left join {{ref('chain_ids')}} t3 on t1.origin_chain_id = t3.id
limit 10
4 changes: 2 additions & 2 deletions models/projects/synapse/raw/ez_synapse_bridge_transfers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ select
s.chain as origin_chain
, origin_tx_hash
, origin_block_timestamp
, depositor as source_address
, depositor as origin_address
, origin_token_address
, origin_token_symbol
, origin_token_amount
, d.chain as destiantion_chain
, d.chain as destination_chain
, destination_tx_hash
, destination_block_timestamp
, recipient as destination_address
Expand Down
1 change: 1 addition & 0 deletions seeds/chain_ids.csv
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ id,chain
534352,scroll
34443,mode
1135,lisk
480,worldchain

0 comments on commit b7d63a9

Please sign in to comment.