Query editor
-- select * from prices.usd where blockchain = 'arbitrum'-- and contract_address = 0xCB1A0a9C9cBBca82A395301267d525125cFBa557;-- SELECT * FROM UNNEST(-- CAST(json_parse(json_query(http_post (-- 'https://kong-two.vercel.app/api/gql',-- '{"query":-- "query Query($chainId: Int, $address: String, $timestamp: BigInt) { prices(chainId: $chainId, address: $address, timestamp: $timestamp) { chainId address priceUsd priceSource blockNumber timestamp } }",-- "variables": {"chainId": 42161,"address": "0x6FAF8b7fFeE3306EfcFc2BA9Fec912b4d49834C1","timestamp": 1611131419} }',-- ARRAY['Content-Type: application/json']-- ), 'strict $.data.prices[*]' WITH ARRAY WRAPPER)) AS array(json)));withtvl as (SELECT*FROMUNNEST (CAST(json_parse(json_query(http_post ('https://kong-two.vercel.app/api/gql','{ "query": "query Timeseries($chainId: Int!, $address: String!, $label: String!, $period: String, $timestamp: BigInt) { timeseries(chainId: $chainId, address: $address, label: $label, period: $period, timestamp: $timestamp) { chainId address label value period timestamp: time } }","variables": {"chainId": 42161,"address": "0xc0ba9bfED28aB46Da48d2B69316A3838698EF3f5","label": "tvl","period": "1 day","timestamp": 1716768000} }',ARRAY['Content-Type: application/json']),'strict $.data.timeseries[*]'WITHARRAY WRAPPER)) AS array (json))) t (result))selectjson_extract_scalar(result, '$.chainId') as chainid,json_extract_scalar(result, '$.address') as address,json_extract_scalar(result, '$.value') as value,json_extract_scalar(result, '$.timestamp') as timestampfromtvl