connorhUntitled Query
    Updated 2021-08-18
    with adds AS (
    SELECT
    DISTINCT
    aave_market,atoken_address,variable_debt_token_address
    FROM aave.market_stats
    WHERE -- aave_market = '0x6b175474e89094c44da98b954eedeac495271d0f' AND
    aave_version = 'Aave V2'
    AND aave_market IN ('0x6b175474e89094c44da98b954eedeac495271d0f',
    '0x056fd409e1d7a124bd7017459dfea2f387b6d5cd',
    '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
    '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
    '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599')
    )
    SELECT '0xd784927ff2f95ba542bfc824c8a8a98f3495f6b5' AS "Distribution Contract to Read From",'assets' AS "Function to Use",'(\'' || LISTAGG(address,'\', \'') || '\')' AS "Inputs (each individually)"
    FROM
    (SELECT atoken_address AS address FROM adds
    UNION
    SELECT variable_debt_token_address AS address FROM adds)

    Run a query to Download Data