freemartianPools on Ambient Finance copy
Updated 2023-11-13
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
›
⌄
-- forked from Pools on Ambient Finance @ https://flipsidecrypto.xyz/edit/queries/08121962-fdcd-4547-8312-06a087302b81
-- ambient address: 0xaaaaaaaaa24eeeb8d57d431224f73832bc34f688
-- pool signature: 0xa15112f9
with
-- eth AS(
-- SELECT block_timestamp, tx_hash, origin_from_address, 'ETH' AS symbol,
-- amount, amount_usd, 2 AS mark
-- FROM ethereum.core.ez_eth_transfers
-- WHERE eth_to_address = '0xaaaaaaaaa24eeeb8d57d431224f73832bc34f688'
-- AND origin_function_signature = '0xa15112f9'
-- ),
-- tokens AS(
-- SELECT block_timestamp, tx_hash, origin_from_address, symbol,
-- amount, amount_usd, RANK() OVER(PARTITION BY tx_hash ORDER BY _log_id) AS mark
-- FROM ethereum.core.ez_token_transfers
-- WHERE to_address = '0xaaaaaaaaa24eeeb8d57d431224f73832bc34f688'
-- AND origin_function_signature = '0xa15112f9'
-- ),
datas_add AS (
SELECT block_timestamp, tx_hash, origin_from_address, 'ETH' AS symbol,
amount, amount_usd, 2 AS mark
FROM ethereum.core.ez_eth_transfers
WHERE eth_to_address = '0xaaaaaaaaa24eeeb8d57d431224f73832bc34f688'
AND origin_function_signature = '0xa15112f9'
UNION
SELECT block_timestamp, tx_hash, origin_from_address, symbol,
amount, amount_usd, RANK() OVER(PARTITION BY tx_hash ORDER BY _log_id DESC) AS mark
FROM ethereum.core.ez_token_transfers
WHERE to_address = '0xaaaaaaaaa24eeeb8d57d431224f73832bc34f688'
AND origin_function_signature = '0xa15112f9'
Run a query to Download Data