akshaymahajanmbg web shop
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
›
⌄
WITH prices AS (
SELECT
hour,
price
FROM
ethereum.price.ez_hourly_token_prices prices
WHERE
lower(token_address) = lower('0x82aF49447D8a07e3bd95BD0d56f35241523fBab1')
and date(hour) >= '2022-01-01'
),
latest_price AS (
SELECT
price
FROM
prices
ORDER BY
hour DESC
LIMIT
1
)
select
tx.tx_hash,
tx.block_timestamp,
tx.block_number,
tx.tx_hash || decoded.event_index as tx_signature,
tx.from_address as address,
'item_shop_purchase' as action,
tx.to_address as contract_address,
decoded.event_name,
to_json(
object_construct(
'shopItemId', decoded.decoded_log:shopItemId,
'staticItemId', decoded.decoded_log:staticItemId,
'quantity', decoded.decoded_log:boughtSupply,
'currency_id', transfers.contract_address,
'currency_symbol', case when transfers.symbol is not null then transfers.symbol else 'ETH' end,
Run a query to Download Data