Query editor
with cow as (selecttx_hash,token_bought_amount,token_sold_amount,token_bought_address,token_sold_address,sell.price as sellprice,buy.price as buyprice,amount_usd,((token_bought_amount/token_sold_amount) / (sell.price / buy.price)) - 1.0000 as cow_markoutfrom cow_protocol.trades tjoin prices.usd sellon sell.contract_address = token_sold_addressand sell.minute = date_trunc('minute', block_time)and sell.price > 0and sell.blockchain = t.blockchainjoin prices.usd buyon buy.contract_address = token_bought_addressand buy.minute = date_trunc('minute', block_time)and buy.price > 0and buy.blockchain = t.blockchainwhere t.blockchain = 'ethereum'and token_pair is not nulland block_date >= date '2025-09-01'and block_date < date '2025-10-01'and amount_usd >= 10000and amount_usd <= 1000000),oneinch as (selecttx_hash,dst_token_amount,src_token_amount,dst_token_address,src_token_address,sell.price as sellprice,buy.price as buyprice,amount_usd,((dst_token_amount/pow(10,dst_token_decimals))/(src_token_amount/pow(10,src_token_decimals)) / (sell.price / buy.price)) - 1.0000 as oneinch_markoutfrom oneinch.swaps tjoin prices.usd sellon sell.contract_address = src_token_addressand sell.minute = date_trunc('minute', block_time)and sell.price > 0and sell.blockchain = t.blockchainjoin prices.usd buyon buy.contract_address = dst_token_addressand buy.minute = date_trunc('minute', block_time)and buy.price > 0and buy.blockchain = t.blockchainwhere t.blockchain = 'ethereum'and block_time >= date '2025-09-01'and block_time < date '2025-10-01'and amount_usd >= 10000and amount_usd <= 1000000and flags['fusion'])select '1Inch' as project, avg(oneinch_markout) * 10000 as markout_bps