Query editor
SELECTget_href('https://basescan.org/address/' || CAST(trader AS varchar), "LEFT"(CAST(trader AS varchar), 6) || '...' || "RIGHT"(CAST(trader AS varchar), 4)) AS ft_trader,twitterusername,reciprocated_eth_volume,unreciprocated_eth_volume,reciprocated_buys,unreciprocated_buys,num_buyers,ROUND(CASE WHEN num_buyers > 0 THEN CAST(reciprocated_buys AS REAL) / CAST(num_buyers AS REAL) ELSE 0.0 END, 2) as prop_reciprocated_buyersFROM (SELECTsubject as three_three_candidate,count(DISTINCT trader) as num_buyersFROM friendtech_base.FriendtechSharesV1_evt_TradeWHERE isBuyGROUP BY 1) num_buyersLEFT OUTER JOIN(SELECTtrader,sum(CASE WHEN friend IS NOT NULL THEN eth_price ELSE 0 END) as reciprocated_eth_volume,sum(CASE WHEN friend IS NULL THEN eth_price ELSE 0 END) as unreciprocated_eth_volume,sum(CASE WHEN friend IS NOT NULL THEN 1 ELSE 0 END) as reciprocated_buys,sum(CASE WHEN friend IS NULL THEN 1 ELSE 0 END) as unreciprocated_buysFROM (SELECTtrader,subject,sum(ethAmount)/1e18 as eth_priceFROM friendtech_base.FriendtechSharesV1_evt_TradeWHERE isBuy AND trader != subjectGROUP BY 1, 2) trades_1LEFT OUTER JOIN (SELECT DISTINCTtrader as friend,subject as three_three_subjectFROM friendtech_base.FriendtechSharesV1_evt_TradeWHERE isBuy) trades_2ON trades_1.trader = trades_2.three_three_subject AND trades_1.subject = trades_2.friendGROUP BY 1) reciprocated_tradesON reciprocated_trades.trader = num_buyers.three_three_candidateLEFT OUTER JOIN dune.hildobby.dataset_friendtech_profiles usersON users.address=num_buyers.three_three_candidateWHERE num_buyers > 4ORDER BY 5 DESC