keshanAnchor bETH Collateralization
Updated 2022-03-27
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 DEPOSITS AS (
SELECT
sender,
sum(amount) as collateral_deposit,
count(DISTINCT tx_id) as num_deposits
FROM anchor.collateral
WHERE datediff(day, block_timestamp::date, getdate()) between 0 and 90
AND event_type = 'provide'
AND currency = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' -- bETH Contract
GROUP BY sender
),
WITHDRAWALS AS (
SELECT
sender,
sum(amount) as collateral_withdraw,
count(DISTINCT tx_id) as num_withdrawals
FROM anchor.collateral
WHERE datediff(day, block_timestamp::date, getdate()) between 0 and 90
AND event_type = 'withdraw'
AND currency = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun'
GROUP BY sender
),
LIQUIDATIONS AS (
SELECT
borrower,
sum(LIQUIDATED_AMOUNT) as collateral_liquidated,
count(DISTINCT tx_id) as num_liquidations
FROM anchor.liquidations
WHERE datediff(day, block_timestamp::date, getdate()) between 0 and 90
AND liquidated_currency = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun'
GROUP BY borrower
),
BORROWINGS AS (
SELECT
sender,
sum(AMOUNT) as borrowed_amount,
Run a query to Download Data