freemartian3CLP-USDC-USDT_BUSD
Updated 2023-03-17
99
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
›
⌄
-- SELECT * FROM polygon.core.ez_decoded_event_logs
-- WHERE tx_hash = '0xf576525df5d8b52b5b4dad6310036936e703468dc21b1fa6ef0956297787de0c'
with join_tx AS (
SELECT tx_hash
FROM polygon.core.ez_decoded_event_logs
WHERE decoded_log:from = '0x0000000000000000000000000000000000000000'
AND contract_address = '0x17f1ef81707811ea15d9ee7c741179bbe2a63887'
AND origin_function_signature = '0xb95cac28'
AND TX_STATUS = 'SUCCESS'
),
exit_tx AS (
SELECT tx_hash
FROM polygon.core.ez_decoded_event_logs
WHERE decoded_log:to = '0x0000000000000000000000000000000000000000'
AND contract_address = '0x17f1ef81707811ea15d9ee7c741179bbe2a63887'
AND origin_function_signature = '0x8bdb3913'
AND TX_STATUS = 'SUCCESS'),
pool_join AS (
SELECT
CASE
when contract_address = '0x9c9e5fd8bbc25984b178fdce6117defa39d2db39' then sum(raw_amount)/pow(10,18)
when contract_address = '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' then sum(raw_amount)/pow(10,6)
when contract_address = '0xc2132d05d31c914a87c6611c10748aeb04b58e8f' then sum(raw_amount)/pow(10,6)
end AS Three_CLP_USDC_USDT_BUSD_stake_amount,
CASE
when contract_address = '0x9c9e5fd8bbc25984b178fdce6117defa39d2db39' then 'BUSD'
when contract_address = '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' then 'USDC'
when contract_address = '0xc2132d05d31c914a87c6611c10748aeb04b58e8f' then 'USDT'
end AS Asset
FROM polygon.core.fact_token_transfers
WHERE tx_hash IN (select tx_hash from join_tx)
Run a query to Download Data