misaghlbBridger Destinations
Updated 2022-08-01Copy Reference Fork
999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with chain_id AS (
SELECT
tx_hash as chain_tx,
tokenflow_eth.hextoint(substr(input_data, 11, 64)) as chain_id,
case when chain_id = '137' then 'hop'
end as chain_destination
FROM ethereum.core.fact_transactions
WHERE to_address IN ('0x3d4cc8a61c7528fd86c55cfe061a78dcba48edd1', -- HOP DAI
'0x3666f603cc164936c1b87e207f36beba4ac5f18a', -- HOP USDC
'0x3e4a3a4796d16c0cd582c382691998f7c06420b6', -- HOP USDT
'0xb8901acb165ed027e32754e0ffe830802919727f', -- HOP ETH (Native)
'0x22b1cbb8d98a01a3b71d034bb899775a76eb1cc2') -- HOP MATIC
AND chain_destination IS NOT NULL
),
bridge_labels as ( -- rename for consistency
SELECT
address,
address_name,
case when address = '0x40ec5b33f54e0e8a33a975908c5ba1c14e5bbbdf' then 'polygon'
when address = '0x401f6c983ea34274ec46f84d70b31c151321188b' then 'polygon' -- rename
when address = '0x3666f603cc164936c1b87e207f36beba4ac5f18a' then 'hop protocol' else label end as relabel
FROM ethereum.core.dim_labels
where address IN ('0x40ec5b33f54e0e8a33a975908c5ba1c14e5bbbdf', -- Polygon ERC-20 Bridge
'0xa0c68c638235ee32657e8f720a23cec1bfc77c77', -- Polygon bridge / Empty Balance (22k), re-routes to 0x84
'0x8484ef722627bf18ca5ae6bcf031c23e6e922b30', -- Polygon Ether Bridge / Ether only
'0x401f6c983ea34274ec46f84d70b31c151321188b' -- Polygon Plasma Bridge / ERC-20 so far
)
ORDER BY RELABEL
),
HOP_BRIDGE AS (
SELECT
block_timestamp,
origin_from_address,
from_address,
to_address,
symbol,
Run a query to Download Data