KaskoazulArbitrage CTE
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
›
⌄
with FIRSTSWAP as (
select swapper,
tx_group_id,
block_timestamp::date as fecha,
swap_from_asset_id,
swap_from_amount,
swap_to_asset_id,
swap_to_amount,
swap_program
from algorand.swaps
where swap_from_asset_id IN (31566704, 312769)
and fecha >= '2022-01-01'
),
SECONDSWAP as (
select swapper,
tx_group_id,
block_timestamp::date as fecha,
swap_from_asset_id,
swap_from_amount,
swap_to_asset_id,
swap_to_amount,
swap_program
from algorand.swaps
where swap_to_asset_id IN (31566704, 312769)
and fecha > FIRSTSWAP.fecha
and swap_from_asset_id = FIRSTSWAP.swap_to_asset_id
and swap_from_amount = FIRSTSWAP.swap_to_amount
)
SELECT * FROM SECONDSWAP
LIMIT 10