messariOverall Dexalot Swaps (Avalanche) copy
Updated 2024-12-02
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
›
⌄
-- forked from Ali3N / Overall Dexalot Swaps (Avalanche) @ https://flipsidecrypto.xyz/Ali3N/q/trWWRV0mw9DS/overall-dexalot-swaps-avalanche
-- forked from cloudr3n / SimpleSwap Metrics @ https://flipsidecrypto.xyz/cloudr3n/q/Rwx7F-keRLBL/simpleswap-metrics
-- taker asset = token in
-- updated with new contract on MAY2024
with SimpleSwap as (
SELECT
block_timestamp,
tx_hash,
decoded_log:maker as maker,
decoded_log:makerAsset as makerAsset,
decoded_log:makerAmountReceived as makerAmountReceived,
decoded_log:taker as taker,
decoded_log:takerAsset as takerAsset,
decoded_log:takerAmountReceived as takerAmountReceived,
decoded_log
FROM
avalanche.core.ez_decoded_event_logs
WHERE
contract_address='0xeed3c159f3a96ab8d41c8b9ca49ee1e5071a7cdd' and event_name='SwapExecuted'
),
token as (
select * FROM
(
SELECT
address as token_address, symbol, decimals
FROM
avalanche.core.dim_contracts
where
address in (select distinct (address) from (select distinct makerAsset as address from SimpleSwap union all select distinct takerAsset as address from SimpleSwap))
)
union all
select '0x0000000000000000000000000000000000000000' as token_address, 'AVAX' as symbol, 18 as decimals
QueryRunArchived: QueryRun has been archived