Query editor
with lvm as (SELECT date_trunc('day', block_time) AS day, sum(cast(bytearray_to_int256(SUBSTRING(data FROM 5 FOR 32)) as double)/cast(1e36 as double)) as eth_in, count(*) as lands_mintedFROM polygon.transactionsWHERE to = 0xa2a13ce1824f3916fc84c65e559391fc6674e6e8AND SUBSTRING(data FROM 1 FOR 4) = 0xabdf05ef --0xabdf05efAND success = trueand block_time > cast('2022-08-01' as timestamp)and block_time < cast('2024-05-30' as timestamp)group by 1union allselectdate_trunc('day', cast(block_timestamp as timestamp)) as day,sum(cast(json_extract(json_parse(replace(data, '''', '"')), '$.args.price') as double)) / 1e18 as eth_in,count(*) as lands_mintedfrom dune.lagunagames12_team.dataset_land_eventswhere event_name = 'beginKeystoneToLand'group by 1),secondary_sales as (select date_trunc('day',evt_block_time) as day, sum(value/1e18) as eth_in, 0 as cu_in, 0 as xai_in, count(*) as num_second_txs, count(distinct("from")) as unique_addressesfrom erc20_polygon.evt_Transferwhere contract_address = 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619 --and to = 0x3491edaa671cd03c64300614d82fec86972f7b12 -- Treasuryand evt_block_time > cast('2022-05-03' as timestamp)and evt_block_time < cast('2024-06-25' as timestamp)and not "from" = 0x94f557dddb245b11d031f57ba7f2c4f28c4a203e --WETH Transfers from Gamebank, not frequent transfer from LVM Salesgroup by 1union allselectdate_trunc('day', cast(block_timestamp as timestamp)) as day,sum(case when currency = 'WETH' then amount_raw/1e18 else 0 end) * 0.04 as eth_in,sum(case when currency = 'CU' then amount_raw/1e18 else 0 end) * 0.04 as cu_in,sum(case when currency = 'XAI' then amount_raw/1e18 else 0 end) * 0.04 as xai_in,count(*) as num_second_txs,count(distinct(buyer)) as unique_addressesfrom dune.lagunagames12_team.dataset_marketplace_sales_v2group by 1--seaport batch https://polygonscan.com/tx/0xfea450f74216798df01adbebd8720e6c2579743ebbc78b4d060b48dfdc73c757),eth_price as (selectdate_trunc('day', hour) as day,avg(case when contract_address = 0x89C49A3fA372920aC23ce757A029e6936c0b8e02 then median_price else NULL end) as cu_price, -- cu priceavg(case when contract_address = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 then median_price else NULL end) as eth_price, -- eth priceavg(case when contract_address = 0x4Cb9a7AE498CEDcBb5EAe9f25736aE7d428C9D66 then median_price else NULL end) as xai_price -- xai pricefrom dex.priceswhere blockchain = 'arbitrum'and hour > cast('2022-05-03' as timestamp)group by 1),eth_out_market AS (select date_trunc('day',evt_block_time) as day, -1 * sum(value/1e18) as eth_marketing from erc20_polygon.evt_Transferwhere contract_address = 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619 --and "from" in(0xF4567ef1FBcE3ae78D6590F94553ece6bD8EDCB4, --Marketing Wallet0x25eB699EeCE8c12F4492F1a76efCcB026adEC874,