BlockTrackeroverview [custom Affiliate]
Updated 2025-06-09Copy Reference Fork
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 init as (
select
block_timestamp,
tx_id,
from_amount_usd,
to_amount_usd,
from_address,
array_size(affiliate_addresses_array) as aff_adds_count,
case
when aff_adds_count > 1 and affiliate_address = '_' then affiliate_addresses_array[1]
else affiliate_address
end as affiliate_address,
case
when aff_adds_count > 1 and affiliate_address = '_' then AFFILIATE_FEE_BASIS_POINTS_ARRAY[1]
else AFFILIATE_FEE_BASIS_POINTS end as AFFILIATE_FEE_BASIS_POINTS
from maya.defi.fact_swaps
where tx_id not in (select tx_id from maya.defi.fact_refund_events)
),
affiliate as (
select
case
when affiliate_address = 'ts' then 'ThorSwap'
when affiliate_address = 'wr' then 'THORWallet'
when affiliate_address = 'dx' then 'Asgardex'
when affiliate_address IN ('ELD','eld') then 'DoritoDEX'
when affiliate_address IN ('cs', 'CS') then 'CacaoSwap'
when affiliate_address = 'rg' then 'Rango'
when affiliate_address = 'ej' then 'Edge Wallet'
when affiliate_address IN ('vi', 'va', 'v0') then 'Vultisig'
when affiliate_address = 'leo' then 'LeoDex'
when affiliate_address = 'dp' then 'Astrolescent'
when affiliate_address = 'ms' then 'ClioSwap'
when affiliate_address = 'ds' then 'Defispot'
when affiliate_address = 'moca' then 'Moca'
when affiliate_address = 'is' then 'Instaswap'
QueryRunArchived: QueryRun has been archived