|
8 | 8 | - sql: select symbol, address from token where decimals > 10 |
9 | 9 | ok: > |
10 | 10 | select symbol, address from ( |
11 | | - select id, address, symbol, name, decimals from "sgd0815"."token" where block_range @> 2147483647) as token |
| 11 | + select "id", "address", "symbol", "name", "decimals" from "sgd0815"."token" where block_range @> 2147483647) as token |
12 | 12 | where decimals > 10 |
13 | 13 | - sql: > |
14 | 14 | with tokens as ( |
|
40 | 40 | as t (address, symbol, name, decimals)) |
41 | 41 | select date, t.symbol, sum(amount) / pow(10, t.decimals) as amount |
42 | 42 | from (select date(to_timestamp(block_timestamp) at time zone 'utc') as date, token, amount |
43 | | - from (select id, timestamp, pool, token_0, token_1, sender, recipient, origin, amount_0, amount_1, amount_usd, sqrt_price_x96, tick, log_index |
| 43 | + from (select "id", "timestamp", "pool", "token_0", "token_1", "sender", "recipient", "origin", "amount_0", "amount_1", "amount_usd", "sqrt_price_x96", "tick", "log_index" |
44 | 44 | from "sgd0815"."swap" where block$ <= 2147483647) as sm, |
45 | 45 | unnest(sm.amounts_in, sm.tokens_in) as smi (amount, token) |
46 | 46 | union all |
47 | 47 | select date(to_timestamp(block_timestamp) at time zone 'utc') as date, token, amount |
48 | | - from (select id, timestamp, pool, token_0, token_1, sender, recipient, origin, amount_0, amount_1, amount_usd, sqrt_price_x96, tick, log_index |
| 48 | + from (select "id", "timestamp", "pool", "token_0", "token_1", "sender", "recipient", "origin", "amount_0", "amount_1", "amount_usd", "sqrt_price_x96", "tick", "log_index" |
49 | 49 | from "sgd0815"."swap" where block$ <= 2147483647) as sm, |
50 | 50 | unnest(sm.amounts_out, sm.tokens_out) as smo (amount, token)) as tp |
51 | 51 | join tokens as t on t.address = tp.token |
|
71 | 71 | having sum(amount0) > 1000 |
72 | 72 | ok: > |
73 | 73 | SELECT token0, sum(amount0) AS total_amount |
74 | | - FROM (SELECT id, timestamp, pool, token_0, token_1, sender, recipient, origin, amount_0, amount_1, amount_usd, sqrt_price_x96, tick, log_index |
| 74 | + FROM (SELECT "id", "timestamp", "pool", "token_0", "token_1", "sender", "recipient", "origin", "amount_0", "amount_1", "amount_usd", "sqrt_price_x96", "tick", "log_index" |
75 | 75 | FROM "sgd0815"."swap" WHERE block$ <= 2147483647) AS swap |
76 | 76 | GROUP BY token0 |
77 | 77 | HAVING sum(amount0) > 1000 |
|
0 commit comments