amir007-Q63RX1Incentivized wMATIC
Updated 2023-02-13
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
›
⌄
WITH matic_price AS
(
SELECT avg(price) as price
FROM ethereum.core.fact_hourly_token_prices
WHERE symbol = 'MATIC'
ORDER BY hour DESC
LIMIT 1
), summary AS
(
SELECT trn.block_timestamp::date AS date
, COUNT(DISTINCT receiver) AS count_receiver
, COUNT(DISTINCT tx_id) AS count_tx
, SUM(trn.amount / pow(10, decimal)) AS vol_matic
, SUM(trn.amount / pow(10, decimal) * (SELECT price FROM matic_price)) AS vol_usd
FROM osmosis.core.fact_transfers trn
JOIN osmosis.core.dim_labels lbl ON trn.currency = lbl.address
WHERE trn.sender LIKE 'axelar%' -- from
AND trn.receiver LIKE 'osmo%' -- to
AND lbl.project_name = 'wMATIC'
GROUP BY 1
)
SELECT
CASE WHEN date > '2022-12-19' THEN 'Incentivized wMATIC' ELSE 'Before Incentivized wMATIC' END AS Incentivized_type
, avg(count_receiver) AS average_active_user
, avg(count_tx) AS average_tx
, avg(vol_matic) AS average_vol_matic
, avg(vol_usd) AS average_vol_usd
FROM summary
GROUP BY 1
Run a query to Download Data