bachisushi stblcoin
    Updated 2022-06-12
    with usdclend as (
    SELECT
    date(block_timestamp) as day,
    COUNT(tx_id) as txns,
    'USDC' as stabelcoin,
    COUNT(DISTINCT origin_address) as users,
    round(sum(amount),2) as tvl
    FROM polygon.udm_events
    where tx_id in (
    SELECT
    tx_id
    FROM polygon.udm_events
    WHERE SYMBOL LIKE '%km%USDC%'
    and (select count(*) FROM polygon.udm_events where event_name = 'LogAddAsset' and tx_id in (
    SELECT
    tx_id
    FROM polygon.udm_events
    WHERE
    SYMBOL LIKE '%km%USDC%')) > 0
    ) and event_name='transfer' and from_address='0x0000000000000000000000000000000000000000'
    GROUP BY 1,3
    ),
    usdtlend as (
    SELECT
    date(block_timestamp) as day,
    COUNT(tx_id) as txns,
    'USDT' as stabelcoin,
    COUNT(DISTINCT origin_address) as users,
    round(sum(amount),2) as tvl
    FROM polygon.udm_events
    where tx_id in (
    SELECT
    tx_id
    FROM polygon.udm_events
    WHERE SYMBOL LIKE '%km%USDT%'
    and (select count(*) FROM polygon.udm_events where event_name = 'LogAddAsset' and tx_id in (
    Run a query to Download Data