SocioAnalyticaaffiliate_Reward
Updated 2024-06-21
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 all_azuro_tx as (
SELECT
DISTINCT tx_hash
FROM polygon.core.ez_decoded_event_logs
WHERE contract_name ilike '%Azuro%'
AND block_timestamp::date >= '2023-01-01'
AND
TX_STATUS = 'SUCCESS'
)
,
azuro_NewBet as (
SELECT
block_timestamp,
block_number,
a.tx_hash,
event_index,
contract_address,
decoded_log:affiliate as affiliate,
decoded_log:amount/1e6 as amount,
decoded_log:bettor as bettor,
decoded_log:conditionId as conditionId,
decoded_log:funds as funds,
decoded_log:odds/1e12 as odds,
decoded_log:outcomeId as outcomeid,
decoded_log:tokenId as tokenId
FROM polygon.core.ez_decoded_event_logs a
JOIN all_azuro_tx b ON a.tx_hash = b.tx_hash
WHERE event_name = 'NewBet'
AND block_timestamp::date >= '2023-01-01'
AND
TX_STATUS = 'SUCCESS'
)
,
bettor_win as (
SELECT
block_timestamp,
QueryRunArchived: QueryRun has been archived