You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
balances_changes AS (
WITH token_data AS (
SELECT
pool,
ARRAY_AGG(CAST(json_extract_scalar(token, '$.token') AS varbinary) ORDER BY token_index) AS tokens -- Cast to varbinary
FROM (
SELECT
pool,
tokenConfig,
SEQUENCE(1, CARDINALITY(tokenConfig)) AS token_index_array
FROM
balancer_testnet_sepolia.Vault_evt_PoolRegistered
) AS pool_data
CROSS JOIN UNNEST(tokenConfig, token_index_array) AS t(token, token_index)
GROUP BY 1
)
SELECT
date_trunc('day', evt_block_time) AS day,
contract_address AS vault_address,
pb.pool AS pool_address,
t.token,
d.delta
FROM
balancer_testnet_sepolia.Vault_evt_PoolBalanceChanged pb
JOIN token_data td ON pb.pool = td.pool
CROSS JOIN UNNEST(td.tokens) WITH ORDINALITY AS t(token, i)
CROSS JOIN UNNEST(pb.deltas) WITH ORDINALITY AS d(delta, i)
WHERE t.i = d.i
ORDER BY 1, 2, 3
),
with the
tokens
field being removed from the event, we will have to map them based on the order they were registered on the vaultThe text was updated successfully, but these errors were encountered: