scottincryptoSaddle Stablecoin V2 Swaps
Updated 2021-09-18
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
›
⌄
with all_tx_list as (
select
tx_id
from ethereum.udm_events
where event_name = 'TokenSwap'
and contract_address = '0xacb83e0633d6605c5001e2ab59ef3c745547c8c7'
and block_timestamp > getdate() - interval'2 month'
group by tx_id
)
, curve_only_tx as (
select
tx_id,
count(event_id) as event_count
from ethereum.udm_events
where tx_id in (select tx_id from all_tx_list)
group by tx_id
having event_count = 3
)
, usdc_dai_tx as (
select
u.tx_id as tx
, u.block_timestamp as block_ts
-- , u.event_type as
, u.symbol as source_symbol
, u.amount as source_amount
, d.symbol as dest_symbol
, d.amount as dest_amount
, t.fee_usd as tx_fee_usd
, t.tx_fee as tx_fee
, t.gas_used as gas_used
from ethereum.udm_events u
left join ethereum.udm_events d on (u.tx_id = d.tx_id)
left join ethereum.transactions t on (u.tx_id = t.tx_id)
where u.to_address = '0xacb83e0633d6605c5001e2ab59ef3c745547c8c7'
Run a query to Download Data