Query editor
/*-----------This query extracts the NetSyOut amounts in AMM Swap Events emitted by Pendle market-LP contracts on auser-selected chain over a user-defined time window.The reason we didn’t use the decode data is that the decoding of Pendle market contracts on Dune has become quite messy.Calculating directly from the logs is much clearer.*/select '{{chain}}' as blockchain,block_time,tx_index,tx_hash,index,contract_address,varbinary_to_int256(varbinary_substring(data, 1 + 32, 32)) as net_sy_outfrom {{chain}}.logswhere contract_address in (SELECT address FROM dune.p_team.result_all_pendle_market_lp_address WHERE chain = '{{chain}}')and topic0 = 0x829000a5bc6a12d46e30cdcecd7c56b1efd88f6d7d059da6734a04f3764557c4and block_time >= date '{{start_date}}'