A subgraph for the DAI token.
Documentation: https://thegraph.com/docs/en/cookbook/quick-start/
- Add a Transfer entity with these fields:
- from: String (address)
- to: String (address)
- amount: BigInt (transfer amount)
-
Add a daily entity that summarizes totaly daily transfer count, transfer amount, and unique users (from or to).
-
Find a price oracle contract and convert the transfer amount to US dollar.
- Find pairs on UniSwap v2 with one of the tokens is DAI
- handle PairCreated event
- add a template data source for DAI pairs
- For each DAI pair, track pool (pair address, token0, token1, reserve0, reserve1) and swap (to, from, tokenA, tokenB, amountIn, amountOut) with a pool and swap entity
- add to daily entity, total DAI liquidity (reserve) across all pools, total swap count, total swap amount (USD)
- add to daily entity, % of DAI supply that is providing liquidity at UniSwap v2, % of DAI transfer counts that is swaps, % DAI transfer amount that is swaps
Develop a subgraph for Uniswap v2 using Messari's DEX schema: https://github.com/messari/subgraphs/blob/master/schema-dex-amm.graphql