Defi Users vs. Newbies
Are Uniswap users coming from other De-Fi projects?
The share of UNI tokens (of wallet) of Uniswap users who have deposited in Compound peaked at 0.5% in April. UNI share of wallet balance has since stayed under 0.2%.
Next, we analyze the percentage UNI share of wallets of Uniswap users who have deposited in other pools or protocols.
We narrow it down to Uniswap users who have deposited to the compound protocol.
Our query maps Uniswap users who are compound depositors to their wallet balance, where the UNI share of their total is calculated.
Here's how the query looks like:
WITH uniswap_users AS (
SELECT DISTINCT(from_address) AS uniswap_user
FROM ethereum.dex_swaps
WHERE platform = 'uniswap-v2' OR platform = 'uniswap-v3'
),
comp_depositors AS (
SELECT u.uniswap_user AS uniswap_user
FROM compound.deposits AS c
JOIN uniswap_users AS u ON c.supplier = u.uniswap_user
),
total_balance AS (
SELECT b.balance_date, SUM(amount_usd) AS total
FROM ethereum.erc20_balances AS b
JOIN comp_depositors AS c ON c.uniswap_user = b.user_address
GROUP BY 1
)
SELECT b.balance_date, ((SUM(amount_usd)*100)/SUM(t.total)) AS uni_share
FROM ethereum.erc20_balances AS b
JOIN total_balance AS t ON t.balance_date = b.balance_date
WHERE symbol = 'UNI' AND b.balance_date >= CURRENT_DATE - 90
GROUP BY 1
The resulting table is visualized in the graph below:
At a point in the past 3 months, Uniswap users seemed to have more in AAVE tokens than COMP and SUSHI combined. The graph looks quite unpredictable.
As of July 4, 2021, the USD equivalent breakdown of tokens other than UNI of Uniswap users is as follows:
- SUSHI - $271.9885K
- AAVE - $250.9856K
- COMP - $179.1324K
The resulting table is visualized below:
Methodology
To understand the flow of users into Uniswap, we need to know the breakdown of tokens other than UNI in Uniswap users' addresses and their change over time.
Before that, we need to define who a Uniswap user is and what 'other tokens' are.
A Uniswap user will be defined as any address that has successfully completed at least a transaction on Uniswap. We can get a list of Uniswap users with the following query:
SELECT DISTINCT(from_address) AS uniswap_user
FROM ethereum.dex_swaps
WHERE platform = 'uniswap-v2' OR platform = 'uniswap-v3'
We define other tokens are a closed list of De-Fi tokens selected from the top 10 projects on the defipulse leaderboard. These tokens are:
- COMP
- AAVE
- SUSHI
To break down these tokens for Uniswap users, we map every Uniswap address to a token query, where balances are summed up by date. For every day in the past 3 months, the daily balances of all Uniswap users are collected with each column representing a different token.
This is how the query looks like.
WITH uniswap_users AS (
SELECT DISTINCT(from_address) AS uniswap_user
FROM ethereum.dex_swaps
WHERE platform = 'uniswap-v2' OR platform = 'uniswap-v3'
),
sushiswap_balances AS (
SELECT balance_date, SUM(amount_usd) AS daily_sum
FROM ethereum.erc20_balances
JOIN uniswap_users AS u ON ethereum.erc20_balances.user_address = u.uniswap_user
WHERE contract_label = 'sushiswap' AND balance_date >= CURRENT_DATE - 90
GROUP BY 1
),
comp_balances AS (
SELECT balance_date, SUM(amount_usd) AS daily_sum
FROM ethereum.erc20_balances
JOIN uniswap_users AS u ON ethereum.erc20_balances.user_address = u.uniswap_user
WHERE symbol = 'COMP' AND balance_date >= CURRENT_DATE - 90
GROUP BY 1
),
aave_balances AS (
SELECT balance_date, SUM(amount_usd) AS daily_sum
FROM ethereum.erc20_balances
JOIN uniswap_users AS u ON ethereum.erc20_balances.user_address = u.uniswap_user
WHERE symbol = 'AAVE' AND balance_date >= CURRENT_DATE - 90
GROUP BY 1
)
SELECT sushiswap_balances.balance_date AS balance_date, sushiswap_balances.daily_sum AS sushi, comp_balances.daily_sum AS comp, aave_balances.daily_sum AS aave
FROM sushiswap_balances
JOIN comp_balances ON comp_balances.balance_date = sushiswap_balances.balance_date
JOIN aave_balances ON aave_balances.balance_date = sushiswap_balances.balance_date