add/bridge-updates-op (#224)

* updates for native

* docs

* symbol for axelar

* bridge dst chain seed
This commit is contained in:
drethereum 2024-01-04 16:08:15 -05:00 committed by GitHub
parent 28a7897706
commit adbabc5e91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 148 additions and 22 deletions

View File

@ -37,4 +37,5 @@ Sui,0x0310
Terra,0x014a
Thorchain,0x03a3
Tron,0x00c3
zkSync Era,0x0324
zkSync Era,0x0324
zkFair,0xa70e
1 chain short_coin_type
37 Terra 0x014a
38 Thorchain 0x03a3
39 Tron 0x00c3
40 zkSync Era 0x0324
41 zkFair 0xa70e

View File

@ -0,0 +1,98 @@
destination_chain,standard_destination_chain
acala,acala
algorand,algorand
aptos,aptos
arbitrum,arbitrum
arbitrum nova,arbitrum nova
arbitrum one,arbitrum
archway,archway
astar,astar
aurora,aurora
aurora mainnet,aurora
avalanche,avalanche
avalanche c-chain,avalanche
base,base
bnb,bsc
bnb chain,bsc
bnb smart chain mainnet,bsc
boba bnb mainnet,boba
boba network,boba
bsc,bsc
canto,canto
carbon,carbon
celo,celo
celo mainnet,celo
coinweb,coinweb
conflux,conflux
conflux espace,conflux
crab network,crab
crescent,crescent
cronos mainnet,cronos
crypto chain,crypto
dfk chain,dfk
dogechain mainnet,dogechain
eos,eos
ethereum,ethereum
ethereum mainnet,ethereum
evmos,evmos
fantom,fantom
fantom opera,fantom
filecoin,filecoin
fuse,fuse
gnosis,gnosis
harmony mainnet shard 0,harmony
huobi eco chain mainnet,huobi eco
injective,injective
juno,juno
karura,karura
kava,kava
klaytn,klaytn
klaytn mainnet cypress,klaytn
kujira,kujira
linea,linea
manta,manta
mantle,mantle
metis,metis
metis andromeda mainnet,metis
moonbeam,moonbeam
moonriver,moonriver
nautilus,nautilus
near,near
neutron,neutron
oasis,oasis
okxchain mainnet,okxchain
ontology mainnet,ontology
op mainnet,optimism
opbnb,opbnb
optimism,optimism
osmosis,osmosis
polygon,polygon
polygon mainnet,polygon
polygon pos,polygon
polygon zkevm,polygon zkevm
ronin,ronin
scroll,scroll
secret-snip,secret
sei,sei
skale europa,skale europa
skale nebula,skale nebula
solana,solana
stargaze,stargaze
starknet,starknet
sui,sui
telos evm mainnet,telos
terra,terra
terra-2,terra2
terra2,terra2
tezos,tezos
tron,tron
umee,umee
waves,waves
xpla,xpla
xrpl,xrpl
zkfair,zkfair
zksync era,zksync era
zksync era mainnet,zksync era
zksync lite,zksync lite
zora,zora
zzz,zzz
1 destination_chain standard_destination_chain
2 acala acala
3 algorand algorand
4 aptos aptos
5 arbitrum arbitrum
6 arbitrum nova arbitrum nova
7 arbitrum one arbitrum
8 archway archway
9 astar astar
10 aurora aurora
11 aurora mainnet aurora
12 avalanche avalanche
13 avalanche c-chain avalanche
14 base base
15 bnb bsc
16 bnb chain bsc
17 bnb smart chain mainnet bsc
18 boba bnb mainnet boba
19 boba network boba
20 bsc bsc
21 canto canto
22 carbon carbon
23 celo celo
24 celo mainnet celo
25 coinweb coinweb
26 conflux conflux
27 conflux espace conflux
28 crab network crab
29 crescent crescent
30 cronos mainnet cronos
31 crypto chain crypto
32 dfk chain dfk
33 dogechain mainnet dogechain
34 eos eos
35 ethereum ethereum
36 ethereum mainnet ethereum
37 evmos evmos
38 fantom fantom
39 fantom opera fantom
40 filecoin filecoin
41 fuse fuse
42 gnosis gnosis
43 harmony mainnet shard 0 harmony
44 huobi eco chain mainnet huobi eco
45 injective injective
46 juno juno
47 karura karura
48 kava kava
49 klaytn klaytn
50 klaytn mainnet cypress klaytn
51 kujira kujira
52 linea linea
53 manta manta
54 mantle mantle
55 metis metis
56 metis andromeda mainnet metis
57 moonbeam moonbeam
58 moonriver moonriver
59 nautilus nautilus
60 near near
61 neutron neutron
62 oasis oasis
63 okxchain mainnet okxchain
64 ontology mainnet ontology
65 op mainnet optimism
66 opbnb opbnb
67 optimism optimism
68 osmosis osmosis
69 polygon polygon
70 polygon mainnet polygon
71 polygon pos polygon
72 polygon zkevm polygon zkevm
73 ronin ronin
74 scroll scroll
75 secret-snip secret
76 sei sei
77 skale europa skale europa
78 skale nebula skale nebula
79 solana solana
80 stargaze stargaze
81 starknet starknet
82 sui sui
83 telos evm mainnet telos
84 terra terra
85 terra-2 terra2
86 terra2 terra2
87 tezos tezos
88 tron tron
89 umee umee
90 waves waves
91 xpla xpla
92 xrpl xrpl
93 zkfair zkfair
94 zksync era zksync era
95 zksync era mainnet zksync era
96 zksync lite zksync lite
97 zora zora
98 zzz zzz

View File

@ -1,6 +1,6 @@
{% docs evm_bridge_table_doc %}
A convenience table that aggregates bridge activity from event_logs, traces and transfers, including bridge deposits and transfers sent from the following protocols: ACROSS, AXELAR, CELER, CBRIDGE, HOP, MESON, MULTICHAIN, NATIVE, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE along with other helpful columns, including an amount USD where available. Note, this table only includes records for the protocols listed above with live, onchain bridge activity and may not represent the complete bridging picture.
A convenience table that aggregates bridge activity from event_logs, traces and transfers, including bridge deposits and transfers sent from the following protocols: ACROSS, AXELAR, CELER, CBRIDGE, HOP, MESON, MULTICHAIN, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE along with other helpful columns, including an amount USD where available. Note, this table only includes records for the protocols listed above with live, onchain bridge activity and may not represent the complete bridging picture.
{% enddocs %}

View File

@ -24,7 +24,10 @@ SELECT
sender,
receiver,
destination_chain_receiver,
destination_chain,
COALESCE(
standard_destination_chain,
b.destination_chain
) AS destination_chain,
destination_chain_id,
token_address,
token_symbol,
@ -47,3 +50,6 @@ SELECT
) AS modified_timestamp
FROM
{{ ref('silver_bridge__complete_bridge_activity') }}
b
LEFT JOIN {{ ref('silver_bridge__standard_dst_chain_seed') }} C
ON b.destination_chain = C.destination_chain

View File

@ -45,21 +45,21 @@ native_transfers AS (
tx.from_address AS origin_from_address,
tx.to_address AS origin_to_address,
tx.origin_function_signature,
et.eth_from_address,
et.eth_to_address,
et.from_address,
et.to_address,
amount_precise_raw,
identifier,
_call_id,
et._inserted_timestamp
FROM
{{ ref('core__ez_eth_transfers') }}
{{ ref('silver__native_transfers') }}
et
INNER JOIN {{ ref('silver__transactions') }}
tx
ON et.block_number = tx.block_number
AND et.tx_hash = tx.tx_hash
WHERE
et.eth_to_address = '0x25ab3efd52e6470681ce037cd546dc60726948d3'
et.to_address = '0x25ab3efd52e6470681ce037cd546dc60726948d3'
{% if is_incremental() %}
AND et._inserted_timestamp >= (
@ -101,9 +101,9 @@ all_transfers AS (
tx_hash,
NULL AS event_index,
NULL AS event_name,
eth_to_address AS bridge_address,
eth_from_address AS sender,
eth_to_address AS receiver,
to_address AS bridge_address,
from_address AS sender,
to_address AS receiver,
amount_precise_raw AS amount_unadj,
'0x4200000000000000000000000000000000000006' AS token_address,
{{ dbt_utils.generate_surrogate_key(

View File

@ -26,6 +26,7 @@ WITH across AS (
destination_chain_id :: STRING AS destination_chain_id,
NULL AS destination_chain,
token_address,
NULL AS token_symbol,
amount AS amount_unadj,
_log_id AS _id,
_inserted_timestamp
@ -61,6 +62,7 @@ axelar AS (
NULL AS destination_chain_id,
destination_chain,
token_address,
token_symbol,
amount AS amount_unadj,
_log_id AS _id,
_inserted_timestamp
@ -96,6 +98,7 @@ celer_cbridge AS (
destination_chain_id :: STRING AS destination_chain_id,
NULL AS destination_chain,
token_address,
NULL AS token_symbol,
amount AS amount_unadj,
_log_id AS _id,
_inserted_timestamp
@ -131,6 +134,7 @@ hop AS (
destination_chain_id :: STRING AS destination_chain_id,
NULL AS destination_chain,
token_address,
NULL AS token_symbol,
amount AS amount_unadj,
_log_id AS _id,
_inserted_timestamp
@ -166,6 +170,7 @@ meson AS (
destination_chain_id :: STRING AS destination_chain_id,
destination_chain,
token_address,
NULL AS token_symbol,
amount_unadj,
_id,
_inserted_timestamp
@ -201,6 +206,7 @@ multichain AS (
destination_chain_id :: STRING AS destination_chain_id,
NULL AS destination_chain,
token_address,
NULL AS token_symbol,
amount AS amount_unadj,
_log_id AS _id,
_inserted_timestamp
@ -236,6 +242,7 @@ stargate AS (
destination_chain_id :: STRING AS destination_chain_id,
destination_chain,
token_address,
NULL AS token_symbol,
amount_unadj,
_log_id AS _id,
_inserted_timestamp
@ -271,6 +278,7 @@ symbiosis AS (
destination_chain_id :: STRING AS destination_chain_id,
NULL AS destination_chain,
token_address,
NULL AS token_symbol,
amount AS amount_unadj,
_log_id AS _id,
_inserted_timestamp
@ -287,7 +295,7 @@ WHERE
)
{% endif %}
),
synapse_tr AS (
synapse_tb AS (
SELECT
block_number,
block_timestamp,
@ -299,18 +307,19 @@ synapse_tr AS (
bridge_address,
event_name,
platform,
'v1-td' AS version,
'v1-tb' AS version,
sender,
receiver,
destination_chain_receiver,
destination_chain_id :: STRING AS destination_chain_id,
NULL AS destination_chain,
token_address,
NULL AS token_symbol,
amount AS amount_unadj,
_log_id AS _id,
_inserted_timestamp
FROM
{{ ref('silver_bridge__synapse_tokenredeem') }}
{{ ref('silver_bridge__synapse_token_bridge') }}
{% if is_incremental() %}
WHERE
@ -322,7 +331,7 @@ WHERE
)
{% endif %}
),
synapse_trs AS (
synapse_tbs AS (
SELECT
block_number,
block_timestamp,
@ -334,18 +343,19 @@ synapse_trs AS (
bridge_address,
event_name,
platform,
'v1-tds' AS version,
'v1-tbs' AS version,
sender,
receiver,
destination_chain_receiver,
destination_chain_id :: STRING AS destination_chain_id,
NULL AS destination_chain,
token_address,
NULL AS token_symbol,
amount AS amount_unadj,
_log_id AS _id,
_inserted_timestamp
FROM
{{ ref('silver_bridge__synapse_tokenredeemandswap') }}
{{ ref('silver_bridge__synapse_tokenbridgeandswap') }}
{% if is_incremental() %}
WHERE
@ -376,6 +386,7 @@ wormhole AS (
destination_chain_id :: STRING AS destination_chain_id,
destination_chain,
token_address,
NULL AS token_symbol,
amount_unadj,
_id,
_inserted_timestamp
@ -436,12 +447,12 @@ all_protocols AS (
SELECT
*
FROM
synapse_tr
synapse_tb
UNION ALL
SELECT
*
FROM
synapse_trs
synapse_tbs
UNION ALL
SELECT
*
@ -485,7 +496,13 @@ FINAL AS (
)
END AS destination_chain,
b.token_address,
C.token_symbol AS token_symbol,
CASE
WHEN platform = 'axelar' THEN COALESCE(
C.token_symbol,
b.token_symbol
)
ELSE C.token_symbol
END AS token_symbol,
C.token_decimals AS token_decimals,
amount_unadj,
CASE

View File

@ -36,7 +36,11 @@ WITH base_evt AS (
FROM
{{ ref('silver__decoded_logs') }}
WHERE
topics [0] :: STRING = '0xdc5bad4651c5fbe9977a696aadc65996c468cde1448dd468ec0d83bf61c4b57c'
topics [0] :: STRING IN (
'0xdc5bad4651c5fbe9977a696aadc65996c468cde1448dd468ec0d83bf61c4b57c',
--redeem
'0xda5273705dbef4bf1b902a131c2eac086b7e1476a8ab0cb4da08af1fe1bd8e3b' --deposit
)
AND contract_address = '0xaf41a65f786339e7911f4acdad6bd49426f2dc6b'
AND origin_to_address IS NOT NULL

View File

@ -1,6 +1,6 @@
version: 2
models:
- name: silver_bridge__synapse_tokenredeem
- name: silver_bridge__synapse_token_bridge
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:

View File

@ -1,6 +1,6 @@
version: 2
models:
- name: silver_bridge__synapse_tokenredeemandswap
- name: silver_bridge__synapse_tokenbridgeandswap
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns: