dannyamahTotal Liquidity
Updated 2024-08-14
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
›
⌄
-- forked from hess / Top Pools Based on Volume in USD @ https://flipsidecrypto.xyz/hess/q/mAsdwAPfhHxU/top-pools-based-on-volume-in-usd
with action as (
select
method_name ,
a.tx_hash ,
tx_signer,
tx_receiver
from near.core.fact_actions_events_function_call AS a
join near.core.fact_transactions AS b
on a.tx_hash = b.tx_hash
where tx_receiver = 'v2.ref-finance.near'
and method_name in ('add_liquidity')
and a.block_timestamp::date >= CURRENT_DATE - INTERVAL '2 Months'),
logs as (
select
block_timestamp,
a.tx_hash,
method_name,
tx_signer,
replace(value, 'EVENT_JSON:') as decode,
split(decode, ' ') as log,
log[2] as amount_1,
log[3] as token_1,
log[4] as amount_2,
log[5] as token_2
from near.core.fact_receipts AS a
join action AS b
on a.tx_hash = b.tx_hash, table(flatten(input =>logs))
where method_name = 'add_liquidity'
and (log[2] not ilike '%of%'
and log[2] not ilike '%removed%'
QueryRunArchived: QueryRun has been archived