SocioCryptosecond query squid copy
Updated 2023-08-11
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 BlockTracker / second query squid @ https://flipsidecrypto.xyz/BlockTracker/q/vKPD0E4laJlH/second-query-squid
SELECT * FROM (
SELECT * FROM (
WITH graph_call as (
SELECT
livequery.live.udf_api(
'POST',
'https://api.thegraph.com/subgraphs/name/kidacrypto/fantom-squid-protocol',
{'Content-Type': 'application/json'},
{
'query': '{
tokenStatByDates(
first: 1000
skip: 0
orderBy: date
orderDirection: desc
where: {symbol: "axlUSDC"}
) {
date
sourceChain
volume
}
}',
'variables':{}
}
) as rawoutput
),
formatted_results as (
SELECT
value:date as dates,
lower(value:sourceChain::string) as source_chain,
(value:volume::numeric)/1e6 as amount
FROM graph_call, LATERAL FLATTEN (input => rawoutput:data:data:tokenStatByDates)
)
SELECT
Run a query to Download Data