tornado-governance-subgraph/README.md

41 lines
2.2 KiB
Markdown

# Tornado Governance Subgraph
Tornado Cash Governance, Relayer Registry & TORN Subgraph
Designed for replacement of [tornado-relayer-registry-subgraph](https://github.com/tornadocash/tornado-relayer-registry-subgraph)
### About
This subgraph will index Tornado Cash Governance, Relayer Registry & TORN Contract
This subgraph is intended to index lightweight, without requirement of indexing third party contracts or making historic contract calls and thus has no guarantees of accuracy for using those data to calculate APYs, relayer status because those value would be only accurate by static contract calls ( in short we only mimic contract's flow and credit balances ).
This subgraph would likely break when implementation contract is changed by governance vote or when changes from governance proposals doesn't emit contract events correctly. It would be the obligation of the proposer to maintain this subgraph to match values.
### Features
+ Integrated features of [tornado-relayer-registry-subgraph](https://github.com/tornadocash/tornado-relayer-registry-subgraph) with additional properties like staked balance for relayers
+ Using [Chainlink](https://data.chain.link/feeds/ethereum/mainnet/eth-usd) to fetch ETH/USD price (because they would less emit than Uniswap V3 ETH/USDC pair and would be more accurate)
+ Using Uniswap V3 TORN/ETH price because they are also used to calculate relayer fees from governance so it must be accurate
+ Historic Proposals & Votes for Tornado Governance
+ Historic Locks & Reward claims for staking TORN
+ Historic Transfers & Rich List for TORN balance / staking balances
+ Historic TORN price in USD & ETH
+ Historic TORN Staking APYs
+ Historic Relayer Burns ( Can not index if relayer cheats because if it does it wouldn't emit burn events, I would recommend coding custom backend to index those rather than making inefficient subgraph )
Price and TORN supply ( including total locked and burned balances ) are snapshotted hourly basis
For relayer TORN burns they are snapshotted daily basis ( and can be used to build UI or TG bots for TORN APY statistics )
### Getting Started
Refer [./QUERY.md](./QUERY.md) for an example GraphQL query object