Query editor
WITHpairs_created as (SELECTcasewhen _bondingCurve = '0x5b6ac51d9b1cede0068a1b26533cace807f883ee' then 'linear_bonding'else 'exp_bonding'END as pricing_type, _delta/1e18 as delta --tbd how many decimals this is, casewhen _poolType = 0 THEN 'token'when _poolType = 1 THEN 'nft'else 'trade'END as pooltype, _spotPrice/1e18 as spotprice, _nft as nftcontractaddress, _initialNFTIDs as nft_ids, output_pair as pair_address, call_block_time as block_timeFROM sudo_amm_ethereum.LSSVMPairFactory_call_createPairETH creWHERE call_successAND _nft = lower('{{NFT Address}}')),most_recent_spot_delta as (-- --these update events are used on both owner param change and swap itself.-- d8a1890c => changeSpotPrice(uint128)-- 6809f664 => changeDelta(uint128)-- SELECT * FROM sudo_amm_ethereum.LSSVMPair_general_call_changeDelta-- SELECT * FROM sudo_amm_ethereum.LSSVMPair_general_call_changeSpotPriceSELECTCOALESCE(del.contract_address, spot.contract_address) as pair_address, del.delta, spot.spotpriceFROM (SELECT*FROM(SELECTcontract_address, newDelta/1e18 as delta, row_number() over (partition by contract_address order by evt_block_number desc, evt_index desc) as most_recentFROM sudo_amm_ethereum.LSSVMPair_general_evt_DeltaUpdate) aWHERE most_recent = 1) delFULL OUTER JOIN (SELECT*FROM(SELECTcontract_address, newSpotPrice/1e18 as spotprice, row_number() over (partition by contract_address order by evt_block_number desc, evt_index desc) as most_recentFROM sudo_amm_ethereum.LSSVMPair_general_evt_SpotPriceUpdate) aWHERE most_recent = 1) spot ON del.contract_address = spot.contract_address),