MultipartiteOutbound-to-gas ratio over time (all chains)
Updated 2022-02-21
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
›
⌄
SELECT
block_id,
avg(allchains_total_outbound_fees_rune) AS allchains_total_outbound_fees_in_rune,
avg(allchains_total_gas_reimbursement_rune) as allchains_total_gas_reimbursement_in_rune,
avg(allchains_fee_reimbursement_ratio) as allchains_fee_reimbursement_ratio
--The rows aggregated are exact duplicates, but if not aggregating their values are added in the visual.
FROM
(
SELECT
block_id,
sum(outbound_fees_rune) OVER(ORDER BY block_id) AS allchains_total_outbound_fees_rune,
sum(gas_reimbursement_rune) OVER(ORDER BY block_id) AS allchains_total_gas_reimbursement_rune,
(sum(outbound_fees_rune) OVER(ORDER BY block_id)) / (sum(gas_reimbursement_rune) OVER(ORDER BY block_id)) AS allchains_fee_reimbursement_ratio
FROM
(
(
SELECT
block_id,
POWER(10,-8) * pool_deduct AS outbound_fees_rune,
NULL AS gas_reimbursement_rune
FROM thorchain.fee_events
)
UNION ALL
--If not 'ALL', some fees are dropped (from same-block-ID rows?)
(
SELECT
block_id,
NULL AS outbound_fees_rune,
POWER(10,-8) * rune_e8 AS gas_reimbursement_rune
FROM thorchain.gas_events
)
)
)
WHERE (MOD(block_id,100)=0)
--If too many final rows, some left out and not all time covered in the visual.
GROUP BY block_id
Run a query to Download Data