CryptoLioneth bridge events only
    Updated 2022-07-07
    with a as (
    SELECT
    block_timestamp,
    event_to,
    event_amount_usd,
    case
    when event_currency like 't%' then address_name
    else event_currency
    end as token,
    case
    when event_from = 'terra13yxhrk08qvdf5zdc9ss5mwsg5sf7zva9xrgwgc' then 'eth'
    when event_from = 'terra1g6llg3zed35nd3mh9zx6n64tfw3z67w2c48tn2' then 'bsc'
    end as shuttle
    FROM terra.transfers
    left join terra.labels on event_currency = address
    WHERE
    -- event_from = 'terra13yxhrk08qvdf5zdc9ss5mwsg5sf7zva9xrgwgc' -- eth
    event_from = 'terra1g6llg3zed35nd3mh9zx6n64tfw3z67w2c48tn2' -- bsc
    AND block_timestamp >= getdate() - interval '30 days'
    having event_amount_usd > 1
    order by 1),
    b as (
    select
    event_to,
    token,
    last_value(block_timestamp) over (partition by event_to order by block_timestamp) as last_transf
    from a
    order by 1),
    c as (
    select
    block_timestamp,
    case
    when msg_value:feeder IS NOT NULL then msg_value:feeder
    when msg_value:sender is not null then msg_value:sender
    when msg_value:trader is not null then msg_value:trader
    end as wallet,
    Run a query to Download Data