datavortexWeekly Inbound Outbound USDT per Platform
Updated 2024-12-21
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
›
⌄
WITH usdt_bridge AS (
SELECT
DATE_TRUNC('week', block_timestamp) AS week,
platform,
direction,
token_address,
SUM(CASE WHEN direction = 'inbound' THEN amount_unadj ELSE 0 END) AS usdt_received,
SUM(CASE WHEN direction = 'outbound' THEN amount_unadj ELSE 0 END) AS usdt_sent
FROM aptos.defi.fact_bridge_activity
WHERE
token_address = '0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDT'
AND block_timestamp BETWEEN '2024-01-01' AND '2024-12-31'
GROUP BY week, platform, direction, token_address
)
SELECT
week,
platform,
SUM(usdt_received) / POWER(10, 6) AS "Total USDT Inbound",
SUM(usdt_sent) / POWER(10, 6) AS "Total USDT Outbound",
(SUM(usdt_received) - SUM(usdt_sent)) / POWER(10, 6) AS "Net USDT Flow"
FROM usdt_bridge
GROUP BY week, platform
ORDER BY week, platform;
QueryRunArchived: QueryRun has been archived