Pine Analytics3time.fun copy3 copy
    Updated 2025-02-14
    with tab1 as (
    SELECT
    tx_hash as tx,
    case when ORIGIN_FUNCTION_SIGNATURE like '0x6945b123' then 'Buy'
    when ORIGIN_FUNCTION_SIGNATURE like '0xb51d0534' then 'Sell'
    end AS tx_type
    from base.core.fact_event_logs
    WHERE ORIGIN_TO_ADDRESS like lower('0x428aeF7fB31E4E86162D62d4530a4dd7232D953D')
    and ORIGIN_FUNCTION_SIGNATURE in ('0x6945b123', '0xb51d0534')
    )


    SELECT
    user,
    sum(amount_usd) as trading_volume,
    count(*) as trade_events,
    min(block_timestamp) as first_trade_time

    FROM (
    select
    tx_hash,
    'Buy' as tx_type,
    block_timestamp,
    ORIGIN_FROM_ADDRESS as user,
    amount_usd

    from base.core.ez_native_transfers as a
    left outer join tab1
    on tx = tx_hash
    where a.tx_hash in (SELECT tx from tab1)
    --and tx_hash like '0x2abc25318056095fb0843cb4b7945c7f2bfb5f5b364bd597d504e88d78423688'
    AND tx_type like 'Buy'
    and ORIGIN_FROM_ADDRESS = from_address

    UNION all
    Last run: about 2 months ago
    USER
    TRADING_VOLUME
    TRADE_EVENTS
    FIRST_TRADE_TIME
    1
    0xb98e98e94fb7fe408ef001b4e2d0947181dffe1d56878.56182024-06-17 20:27:37.000
    2
    0x592c83cfdcad0d0b68151134f95efd6c5d3958ca54958.831262024-06-19 09:12:43.000
    3
    0xfb7d9fea57517665947e2f9ed2559fd6b960c1a453626.85342024-06-17 21:22:21.000
    4
    0x7e0936634542fe23469af816ee627924edbca2fd51861.64182024-06-17 20:01:05.000
    5
    0x373dff4f580766a68126952151f70fe19d9559bc50123.73462024-06-17 20:13:41.000
    6
    0x03c2ebab201c9aa1da139d729dcdfbe4a18a26f640521.073182024-06-17 21:23:07.000
    7
    0x4f05008a04e8d7ca6c497ce4ce927f1bff04ebec39907.9972024-06-17 21:11:41.000
    8
    0xada65d0694fd1374529ab54d0745113218a1150336676.27212024-06-17 21:51:17.000
    9
    0x0433b37e3d79b149526ece84a4e2f5923e26162836022.35162024-06-17 20:14:15.000
    10
    0x012d8d1fdcbe10b1176791a8dee1250c5d532f0c34815.941482024-06-18 06:59:55.000
    11
    0x84b025895272eddddff1db64f93c40822f67872b34460.11432024-06-18 12:59:43.000
    12
    0xe45e5f7a88a76dc2ae6eaffe23d09eebcccf80db34070.85152024-06-17 21:00:13.000
    13
    0x9bb15d02978498682b0a670bdbd680c68216609932147.7112024-06-18 07:52:49.000
    14
    0x41012ccfb7cf78e6e93959377c2cf80a78858bb329929.841042024-06-17 20:28:01.000
    15
    0x425ba47db844b65f732bdd8d325cb054ce53a05825770.09212024-06-17 20:24:59.000
    16
    0x7809df25690bc68a672fc904a8263ad9024ce4a825636.751692024-06-17 20:23:15.000
    17
    0x8f0924b490d67518d4424bf79f2f2ac99dadfbac25532.22162024-06-17 20:19:33.000
    18
    0xa91ece3bfa93674415154e8ed2b4a349eff053d123832.12972024-06-17 20:25:11.000
    19
    0xfdce7493068261040e0a089dda3bef3806f16ba623444.73382024-06-17 20:16:27.000
    20
    0xe4b3cacc884d69922ca21e2f479edbdca342cebe21373.21232024-06-17 20:24:27.000
    ...
    1848
    147KB
    111s