Query editor
withraw as (select try(json_parse(http_get('https://api.backed.fi/rest/tokens'))) as resp), nodes as (select nodefrom raw, unnest(cast(json_extract(resp, '$.nodes') as array(json))) as t(node)), deployments_expanded as (selectjson_extract_scalar(node, '$.id') as id, json_extract_scalar(node, '$.symbol') as symbol, json_extract_scalar(node, '$.name') as name, json_extract_scalar(node, '$.isin') as isin, json_extract_scalar(node, '$.underlyingSymbol') as underlying_symbol, json_extract_scalar(node, '$.underlyingIsin') as underlying_isin, json_extract_scalar(node, '$.isTradingHalted') as is_trading_halted, json_extract_scalar(node, '$.logo') as logo_url, depfrom nodes, unnest(cast(json_extract(node, '$.deployments') as array(json))) as t(dep)), per_deployment as (selectid, symbol, name, isin, underlying_symbol, underlying_isin, is_trading_halted, logo_url, case json_extract_scalar(dep, '$.network')when 'Ethereum' then 'ethereum'when 'Arbitrum' then 'arbitrum'when 'BinanceSmartChain' then 'bnb'when 'Polygon' then 'polygon'when 'Avalanche' then 'avalanche_c'when 'Base' then 'base'when 'Gnosis' then 'gnosis'when 'Fantom' then 'fantom'when 'Sonic' then 'sonic'when 'Mantle' then 'mantle'when 'Ink' then 'ink'when 'HyperEVM' then 'hyperevm'when 'Solana' then 'solana'when 'Ton' then 'ton'when 'Tron' then 'tron'else json_extract_scalar(dep, '$.network')end as chain-- strip prefixes: "svm:", "ton:", etc., regexp_replace(json_extract_scalar(dep, '$.address'), '^[a-z]+:', '') as address, regexp_replace(json_extract_scalar(dep, '$.wrapperAddress'), '^[a-z]+:', '') as wrapper_addressfrom deployments_expanded)