bachiAnchor dom
Updated 2022-02-20
99
1
2
3
4
5
6
7
8
9
10
11
12
›
⌄
--select * from terra.transfer_events where tx_id='B7F4B3C5DC35918664FBAECEAB44E3B22F4EA94B89CE7F37F29A5E93323F30D4'
with dep as (
select sum(deposit_amount_usd) as amount, sender from anchor.deposits group by sender),
bor as (
select sum(amount_usd) as amount, sender from anchor.borrows group by sender
),
depbor as (
select (d.amount - b.amount) as amount, d.sender from dep d join bor b on d.sender = b.sender
)
select * from depbor where amount > 0 and amount is not null;
--select * from anchor.deposits
Run a query to Download Data