Query editor
-- Liquidity Actions: GLV Deposits / Withdrawals / Shifts-- One row per GLV deposit, withdrawal or shift request (created event), with its execution or cancellation.-- Depends on: query_9092319 (raw src_chain_id)-- GLV actions run GM deposits / withdrawals internally in the execution tx ("inner legs"); the GM amounts and-- the token amounts paid out come from those legs, matched by tx, market and log-index window.-- Prices: token USD = hourly mid price from query 9092298 (section D prices table) at the hour of execution;-- GM / GLV token USD = daily mid price from query 6154239 (dune."gmx-io".result_squid_api_request_optimized).WITHraw_fields AS (SELECTblockchain, tx_hash, index, event_name, src_chain_idFROM query_9092319WHERE event_name IN ('GlvDepositCreated', 'GlvWithdrawalCreated')), markets AS (SELECTblockchain, market, market_name, long_token, short_token, long_token_decimals, short_token_decimalsFROM gmx_v2.markets_data), glvs AS (SELECT DISTINCTblockchain, glv, glv_nameFROM gmx_v2.glvs_data), token_decimals AS (SELECTblockchain, contract_address, MAX(decimals) AS decimalsFROM gmx_v2.erc20GROUP BY 1, 2), created AS (SELECTdc.blockchain, 'glv_deposit' AS action_type, 'GlvDepositCreated' AS created_event, dc.key, dc.account, dc.receiver, dc.callback_contract, dc.glv, dc.market, CAST(NULL AS VARBINARY) AS to_market, dc.block_time AS created_time, dc.block_date, dc.tx_hash AS created_tx