Query editor
WITH api_data AS (SELECTCAST(json_parse(http_get('https://gateway.prod.nado.xyz/v1/query?type=all_products')) AS json) AS response),nlp_price AS (SELECTCAST(json_extract_scalar(product, '$.oracle_price_x18')AS DOUBLE) / 1e18 AS current_priceFROM api_data,UNNEST(CAST(json_extract(json_extract(response, '$.data'), '$.spot_products')AS array(json))) AS t(product)WHERE CAST(json_extract_scalar(product, '$.product_id') AS bigint) = 11),mint AS (SELECTcall_block_date AS day,call_block_time AS block_time,SUBSTRING(json_extract_scalar(txn, '$.sender'), 1, 42) AS wallet,CAST(json_extract_scalar(txn, '$.quoteAmount') AS DOUBLE) / 1e18 AS nlp_tokens,(CAST(json_extract_scalar(txn, '$.quoteAmount') AS DOUBLE) / 1e18)* (oraclePriceX18 / 1e18) AS usd_value_at_mint,oraclePriceX18 / 1e18 AS oracle_price,nlpPoolRebalanceX18[1] / 1e18 AS pool_rebalance_0,nlpPoolRebalanceX18[2] / 1e18 AS pool_rebalance_1,'mint' AS action,1 AS flow_signFROM nado_ink.clearinghouse_call_mintnlpWHERE call_success = true),burn AS (SELECTcall_block_date AS day,call_block_time AS block_time,SUBSTRING(json_extract_scalar(txn, '$.sender'), 1, 42) AS wallet,-(CAST(json_extract_scalar(txn, '$.nlpAmount') AS DOUBLE) / 1e18) AS nlp_tokens,-(CAST(json_extract_scalar(txn, '$.nlpAmount') AS DOUBLE) / 1e18)* (oraclePriceX18 / 1e18) AS usd_value_at_mint,oraclePriceX18 / 1e18 AS oracle_price,nlpPoolRebalanceX18[1] / 1e18 AS pool_rebalance_0,nlpPoolRebalanceX18[2] / 1e18 AS pool_rebalance_1,'burn' AS action,-1 AS flow_signFROM nado_ink.clearinghouse_call_burnnlp