-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating the ton stablecoin pipeline
- Loading branch information
1 parent
0a52b52
commit a811479
Showing
15 changed files
with
63 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
{{ distinct_eoa_addresses("solana") }} | ||
{{config(materialized="table") }} | ||
{{ distinct_eoa_addresses("ton") }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{config(materialized="table") }} | ||
|
||
{{ distinct_eoa_addresses("ton") }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
{{config(materialized="table") }} | ||
|
||
{{ distinct_eoa_addresses("tron") }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
--depends_on: {{ ref("ez_ton_stablecoin_transfers") }} | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="tx_hash", | ||
materialized="view", | ||
snowflake_warehouse="TON", | ||
database="ton", | ||
schema="raw", | ||
alias="ez_p2p_stablecoin_transfers", | ||
) | ||
}} | ||
|
||
{{ p2p_stablecoin_transfers("ton") }} | ||
select * | ||
from {{ref("fact_ton_p2p_stablecoin_transfers")}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
unique_key="tx_hash", | ||
) | ||
}} | ||
{{ p2p_stablecoin_transfers("ton") }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
{{ config( | ||
materialized="incremental", | ||
materialized="table", | ||
unique_key="tx_hash", | ||
snowflake_warehouse="TON", | ||
) }} | ||
|
||
select | ||
avro_raw:utime::timestamp as block_timestamp | ||
, avro_raw:trace_id::string as trace_id | ||
, avro_raw:tx_hash::string as tx_hash | ||
, avro_raw:type::string as type | ||
, avro_raw:jetton_master::string as contract_address | ||
, avro_raw:jetton_wallet::string as jetton_wallet | ||
, avro_raw:source::string as from_address | ||
, avro_raw:destination::string as to_address | ||
, avro_raw:amount::float as amount | ||
, avro_raw:comment::string as comment | ||
, avro_raw:custom_payload::string as custom_payload | ||
, avro_raw:forward_payload::string as forward_payload | ||
, avro_raw:forward_ton_amount::float as forward_ton_amount | ||
, avro_raw:query_id::string as query_id | ||
, avro_raw:response_destination as response_destination | ||
, not avro_raw:tx_aborted::boolean as tx_status | ||
, avro_raw:tx_lt::bigint as event_index | ||
from {{source("PROD_LANDING", "raw_ton_jetton_events_avro")}} | ||
{% if is_incremental() %} | ||
where avro_raw:utime::timestamp > (select dateadd('day', -5, max(utime)) from {{ this }}) | ||
{% endif %} | ||
with | ||
raw_receipt_transactions as ( | ||
select | ||
avro_raw:utime::timestamp as block_timestamp | ||
, avro_raw:trace_id::string as trace_id | ||
, avro_raw:tx_hash::string as tx_hash | ||
, avro_raw:type::string as type | ||
, avro_raw:jetton_master::string as contract_address | ||
, avro_raw:jetton_wallet::string as jetton_wallet | ||
, avro_raw:source::string as from_address | ||
, avro_raw:destination::string as to_address | ||
, avro_raw:amount::float as amount | ||
, avro_raw:comment::string as comment | ||
, avro_raw:custom_payload::string as custom_payload | ||
, avro_raw:forward_payload::string as forward_payload | ||
, avro_raw:forward_ton_amount::float as forward_ton_amount | ||
, avro_raw:query_id::string as query_id | ||
, avro_raw:response_destination as response_destination | ||
, not avro_raw:tx_aborted::boolean as tx_status | ||
, avro_raw:tx_lt::bigint as event_index | ||
from {{ source("PROD_LANDING", "raw_ton_jetton_events_avro") }} | ||
) | ||
select * | ||
from raw_receipt_transactions | ||
where tx_status = 'TRUE' | ||
qualify row_number() over (partition by tx_hash order by block_timestamp desc) = 1 |