-- forked from polymarket example mergeposition @ https://flipsidecrypto.xyz/edit/queries/221fd757-bb00-4100-b0ec-07e54d445f9a
with mergePosition as (
select
*
from polygon.core.ez_decoded_event_logs
where 1=1
--and tx_hash = '0xf2c15787f6c56a80c4b16bd34ec277e4aa316c42cf6544ef434e010cfc903f4b'
and block_timestamp > '2023-09-18'
--and event_name = 'PositionSplit'
and contract_address = '0x4d97dcd97ec945f40cf65f87097ace5ea0476045'
and decoded_log:conditionId = '0x076b6f30c07411b5d8b10a9e236ce919f592e5d663fe4776ba459591ecf481f2'
)
select
*
from polygon.core.ez_decoded_event_logs
where tx_hash in (select tx_hash from mergePosition)
-- 26406000