From 95c10913aabb38a7c18b593e49d47240902bb5d3 Mon Sep 17 00:00:00 2001 From: Sebastian Melendez Date: Sat, 14 Dec 2024 09:52:54 -0500 Subject: [PATCH] updateing art share models --- .../across/raw/ez_across_bridge_transfers.sql | 21 ++++++++- .../raw/ez_arbitrum_bridge_transfers.sql | 11 ++++- .../raw/ez_avalanche_bridge_transfers.sql | 11 ++++- .../base/raw/ez_base_bridge_transfers.sql | 11 ++++- .../cctp/raw/ez_cctp_bridge_transfers.sql | 18 ++++++- .../raw/ez_optimism_bridge_transfers.sql | 11 ++++- .../raw/ez_polygon_bridge_transfers.sql | 11 ++++- .../raw/ez_starknet_bridge_transfers.sql | 11 ++++- .../raw/ez_synapse_bridge_transfers.sql | 20 +++++++- .../raw/ez_wormhole_bridge_transfers.sql | 18 +++++-- .../zksync/raw/ez_zksync_bridge_transfers.sql | 11 ++++- seeds/cctp_chain_ids.csv | 9 ++++ seeds/chain_ids.csv | 26 ++++++++++ seeds/wormhole_chain_ids.csv | 47 +++++++++++++++++++ 14 files changed, 220 insertions(+), 16 deletions(-) create mode 100644 seeds/cctp_chain_ids.csv create mode 100644 seeds/chain_ids.csv create mode 100644 seeds/wormhole_chain_ids.csv diff --git a/models/projects/across/raw/ez_across_bridge_transfers.sql b/models/projects/across/raw/ez_across_bridge_transfers.sql index f9418eb4..186d2854 100644 --- a/models/projects/across/raw/ez_across_bridge_transfers.sql +++ b/models/projects/across/raw/ez_across_bridge_transfers.sql @@ -9,5 +9,22 @@ }} -select * -from {{ref('fact_across_transfers')}} \ No newline at end of file + +select + version + , contract_address + , block_timestamp + , event_index + , t3.chain as source_chain + , depositor as source_address + , tx_hash as destination_tx_hash + + , t2.chain as destination_chain + , recipient as destination_address + , destination_token_symbol + , destination_token + , amount +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 diff --git a/models/projects/arbitrum/raw/ez_arbitrum_bridge_transfers.sql b/models/projects/arbitrum/raw/ez_arbitrum_bridge_transfers.sql index 317783d8..9d8a3997 100644 --- a/models/projects/arbitrum/raw/ez_arbitrum_bridge_transfers.sql +++ b/models/projects/arbitrum/raw/ez_arbitrum_bridge_transfers.sql @@ -9,5 +9,14 @@ }} -select * +select + block_timestamp, + tx_hash as ethereum_tx_hash, + event_index, + depositor as source_address, + recipient as destination_address, + amount, + token_address as ethereum_token_address, + source_chain, + destination_chain from {{ref('fact_arbitrum_one_bridge_transfers')}} \ No newline at end of file diff --git a/models/projects/avalanche/raw/ez_avalanche_bridge_transfers.sql b/models/projects/avalanche/raw/ez_avalanche_bridge_transfers.sql index 2c457181..a9585d94 100644 --- a/models/projects/avalanche/raw/ez_avalanche_bridge_transfers.sql +++ b/models/projects/avalanche/raw/ez_avalanche_bridge_transfers.sql @@ -9,5 +9,14 @@ }} -select * +select + block_timestamp, + tx_hash as ethereum_tx_hash, + event_index, + depositor as source_address, + recipient as destination_address, + amount, + token_address as ethereum_token_address, + source_chain, + destination_chain from {{ref('fact_avalanche_bridge_transfers')}} \ No newline at end of file diff --git a/models/projects/base/raw/ez_base_bridge_transfers.sql b/models/projects/base/raw/ez_base_bridge_transfers.sql index d9a23fb0..3fee325b 100644 --- a/models/projects/base/raw/ez_base_bridge_transfers.sql +++ b/models/projects/base/raw/ez_base_bridge_transfers.sql @@ -9,5 +9,14 @@ }} -select * +select + block_timestamp, + tx_hash as ethereum_tx_hash, + event_index, + depositor as source_address, + recipient as destination_address, + amount, + token_address as ethereum_token_address, + source_chain, + destination_chain from {{ref('fact_base_bridge_transfers')}} \ No newline at end of file diff --git a/models/projects/cctp/raw/ez_cctp_bridge_transfers.sql b/models/projects/cctp/raw/ez_cctp_bridge_transfers.sql index fb06b97f..c0f50376 100644 --- a/models/projects/cctp/raw/ez_cctp_bridge_transfers.sql +++ b/models/projects/cctp/raw/ez_cctp_bridge_transfers.sql @@ -9,5 +9,19 @@ }} -select * -from {{ref('fact_cctp_transfers')}} \ No newline at end of file +select + block_timestamp, + block_number, + tx_hash as source_tx_hash, + nonce as source_nonce, + contract_address as source_contract_address, + sender as source_address, + c1.chain as source_chain, + burn_token as source_token_address, + reciepient as destination_address, + c2.chain as destination_chain, + amount, + amount_usd, +from {{ref('fact_cctp_transfers')}} t +left join {{ref('cctp_chain_ids')}} c1 on t.source_domain_id = c1.chain_id +left join {{ref('cctp_chain_ids')}} c2 on t.destination_domain_id = c2.chain_id \ No newline at end of file diff --git a/models/projects/optimism/raw/ez_optimism_bridge_transfers.sql b/models/projects/optimism/raw/ez_optimism_bridge_transfers.sql index 5da9d58f..41f5b3f6 100644 --- a/models/projects/optimism/raw/ez_optimism_bridge_transfers.sql +++ b/models/projects/optimism/raw/ez_optimism_bridge_transfers.sql @@ -9,5 +9,14 @@ }} -select * +select + block_timestamp, + tx_hash as ethereum_tx_hash, + event_index, + depositor as source_address, + recipient as destination_address, + amount, + token_address as ethereum_token_address, + source_chain, + destination_chain from {{ref('fact_optimism_bridge_transfers')}} \ No newline at end of file diff --git a/models/projects/polygon/raw/ez_polygon_bridge_transfers.sql b/models/projects/polygon/raw/ez_polygon_bridge_transfers.sql index a08d3253..295cbf33 100644 --- a/models/projects/polygon/raw/ez_polygon_bridge_transfers.sql +++ b/models/projects/polygon/raw/ez_polygon_bridge_transfers.sql @@ -9,5 +9,14 @@ }} -select * +select + block_timestamp, + tx_hash as ethereum_tx_hash, + event_index, + depositor as source_address, + recipient as destination_address, + amount, + token_address as ethereum_token_address, + source_chain, + destination_chain from {{ref('fact_polygon_pos_bridge_transfers')}} \ No newline at end of file diff --git a/models/projects/starknet/raw/ez_starknet_bridge_transfers.sql b/models/projects/starknet/raw/ez_starknet_bridge_transfers.sql index b4c6f357..12809f9f 100644 --- a/models/projects/starknet/raw/ez_starknet_bridge_transfers.sql +++ b/models/projects/starknet/raw/ez_starknet_bridge_transfers.sql @@ -9,5 +9,14 @@ }} -select * +select + block_timestamp, + tx_hash as ethereum_tx_hash, + event_index, + depositor as source_address, + recipient as destination_address, + amount, + token_address as ethereum_token_address, + source_chain, + destination_chain from {{ref('fact_starknet_bridge_transfers')}} \ No newline at end of file diff --git a/models/projects/synapse/raw/ez_synapse_bridge_transfers.sql b/models/projects/synapse/raw/ez_synapse_bridge_transfers.sql index 396910bc..1cb6499b 100644 --- a/models/projects/synapse/raw/ez_synapse_bridge_transfers.sql +++ b/models/projects/synapse/raw/ez_synapse_bridge_transfers.sql @@ -9,5 +9,21 @@ }} -select * -from {{ref('fact_synapse_transfers')}} \ No newline at end of file +select + s.chain as origin_chain + , origin_tx_hash + , origin_block_timestamp + , depositor as source_address + , origin_token_address + , origin_token_symbol + , origin_token_amount + , d.chain as destiantion_chain + , destination_tx_hash + , destination_block_timestamp + , recipient as destination_address + , destination_token_address + , destination_token_symbol + , destination_token_amount +from {{ref('fact_synapse_transfers')}} +left join {{ref('chain_ids')}} d on destination_chain_id = d.id +left join {{ref('chain_ids')}} s on origin_chain_id = s.id diff --git a/models/projects/wormhole/raw/ez_wormhole_bridge_transfers.sql b/models/projects/wormhole/raw/ez_wormhole_bridge_transfers.sql index 9f2c9aa2..97f688bf 100644 --- a/models/projects/wormhole/raw/ez_wormhole_bridge_transfers.sql +++ b/models/projects/wormhole/raw/ez_wormhole_bridge_transfers.sql @@ -8,6 +8,18 @@ ) }} - -select * -from {{ref('fact_wormhole_transfers')}} \ No newline at end of file +select + t.id as wormhole_txn_hash + , timestamp + , date_trunc('day', timestamp) as date + , c1.chain as source_chain + , c2.chain as destination_chain + , from_address as source_address + , to_address as destiantion_address + , symbol as token_symbol + , token_address + , amount + , amount_usd +from {{ref('fact_wormhole_transfers')}} t +inner join {{ref('wormhole_chain_ids')}} c1 on t.from_chain = c1.id +inner join {{ref('wormhole_chain_ids')}} c2 on t.to_chain = c2.id \ No newline at end of file diff --git a/models/projects/zksync/raw/ez_zksync_bridge_transfers.sql b/models/projects/zksync/raw/ez_zksync_bridge_transfers.sql index 441086a6..b0ce7bda 100644 --- a/models/projects/zksync/raw/ez_zksync_bridge_transfers.sql +++ b/models/projects/zksync/raw/ez_zksync_bridge_transfers.sql @@ -9,5 +9,14 @@ }} -select * +select + block_timestamp, + tx_hash as ethereum_tx_hash, + event_index, + depositor as source_address, + recipient as destination_address, + amount, + token_address as ethereum_token_address, + source_chain, + destination_chain from {{ref('fact_zksync_era_bridge_transfers')}} \ No newline at end of file diff --git a/seeds/cctp_chain_ids.csv b/seeds/cctp_chain_ids.csv new file mode 100644 index 00000000..7babf2d2 --- /dev/null +++ b/seeds/cctp_chain_ids.csv @@ -0,0 +1,9 @@ +chain_id,chain +0,ethereum +1,avalanche +2,optimism +3,arbitrum +4,noble +5,solana +6,base +7,polygon diff --git a/seeds/chain_ids.csv b/seeds/chain_ids.csv new file mode 100644 index 00000000..daa440cd --- /dev/null +++ b/seeds/chain_ids.csv @@ -0,0 +1,26 @@ +id,chain +1,ethereum +10,optimism +137,polygon +288,boba +42161,arbitrum +8453,base +324,zksync +59144,linea +1313161554,aurora +250,fantom +1088,metis +1284,moonbeam +8217,klaytn +43114,avalanche +1285,moonriver +7700,canto +2000,dogechain +53935,dfk +1666600000,harmony +56,bsc +25,cronos +81457,blast +534352,scroll +34443,mode +1135,lisk diff --git a/seeds/wormhole_chain_ids.csv b/seeds/wormhole_chain_ids.csv new file mode 100644 index 00000000..640cc431 --- /dev/null +++ b/seeds/wormhole_chain_ids.csv @@ -0,0 +1,47 @@ +id,chain +1,solana +2,ethereum +3,terra +4,bsc +5,polygon +6,avalanche +7,oasis +8,algorand +9,aurora +10,fantom +11,karura +12,acala +13,klaytn +14,celo +15,near +16,moonbeam +17,neon +18,terra2 +19,injective +20,osmosis +21,sui +22,aptos +23,arbitrum +24,optimism +25,gnosis +26,pythnet +28,xpla +30,base +32,sei +33,rootstock +34,scroll +35,mantle +36,blast +37,xlayer +38,linea +39,berachain +40,seievm +4000,cosmoshub +4001,evmos +4002,kujira +4003,neutron +4004,celestia +4005,stargaze +4006,seda +4007,dymension +4008,provenance