Afonso_Diaz2023-08-29 08:09 PM
Updated 2023-08-30
999
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
t0 as (
select distinct tx_id from sei.core.fact_msg_attributes
where attribute_key = '_contract_address'
and attribute_value = 'sei1d2r4s2q8kumpmvx6dyj77klhgm5e6fs9njmmz6ye7ukqa77ddtdsu72dc3'
),
t as (
select * from sei.core.fact_msg_attributes a
where attribute_key in ('offer_asset', 'ask_asset', 'offer_amount', 'return_amount')
and tx_id in (select tx_id from t0)
),
t3 as (
select * from t c
where not attribute_value in (
(
select a.attribute_value
from t a
join t b
using(tx_id)
where a.attribute_key = 'offer_amount'
and b.attribute_key = 'return_amount'
and a.attribute_value = b.attribute_value
and c.tx_id = a.tx_id
)
)
and not attribute_value in (
(
select a.attribute_value
from t a
join t b
using(tx_id)
where a.attribute_key = 'ask_asset'
and b.attribute_key = 'offer_asset'
Run a query to Download Data