eferUSD amounts | Kashi Market | Polygon
Updated 2023-04-06
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 collateralized AS (
SELECT
BLOCK_TIMESTAMP::date AS date,
SUM(AMOUNT_USD) AS usd_amount,
SUM(usd_amount) OVER(ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_usd
FROM
polygon.sushi.ez_lending
WHERE
ACTION='Deposit'
AND SYMBOL IN (
'DAI',
'USDT',
'USDC',
'sUSD',
'TUSD',
'UST',
'FEI'
)
GROUP BY date
), borrowed AS (
SELECT
BLOCK_TIMESTAMP::date AS date,
COALESCE(SUM(AMOUNT_USD), 0) AS usd_amount
FROM
polygon.sushi.ez_borrowing
WHERE
ACTION='Borrow'
AND SYMBOL IN (
'DAI',
'USDT',
'USDC',
'sUSD',
'TUSD',
'UST',
'FEI'
)
Run a query to Download Data