This repository aims to serve as a source for all adapters we use to fetch TVL by users for protocols on the Mode Chain. The goal is to simplify the process of adding new protocols, making data ingestion straightforward and thereby making the data available for the OpenBlock Labs team.
The process to add a new adapters is provide a script similar to what you can see here in the adapter example.
Here is a onboarding checklist:
- Set up a subquery indexer (e.g. Goldsky Subgraph)
- Follow the docs here: https://docs.goldsky.com/guides/create-a-no-code-subgraph
- General Steps
- create an account at app.goldsky.com
- deploy a subgraph or migrate an existing subgraph - https://docs.goldsky.com/subgraphs/introduction
- Use the slugs
mode-testnet
andmode
when deploying the config
- Prepare Subquery query code according to the Data Requirement section below.
- Submit your response as a Pull Request to: https://github.com/delta-hq/openblocklabs-mode-tvl-adapters.git
Goal: Hourly snapshot of TVL by User by Asset
For each protocol, we are looking for the following:
- Query that fetches all relevant events required to calculate User TVL in the Protocol at hourly level.
- Code that uses the above query, fetches all the data and converts it to csv file in below given format.
Data Field | Notes |
---|---|
user | |
pool | |
block | |
lp_value | Converted to USD |
Sample output:
user,pool,block,lpvalue
0xff...,0xeb4b0563aac65980245660496e76d03c90ad7b26,3330408,0.0
0xff...,0x04627b24ede101b0a92211a92f996eda3fa6cc75,3332208,1.0
0xff...,0x50273860341bb80de359cd391bef9b2eb228753c,3332208,1.92
0xff...,0xeb4b0563aac65980245660496e76d03c90ad7b26,3332208,0.0
Once you provide the repository, we need to execute the following steps:
- Check if the repo is funcional, test it for small block list
- Check if the output is accordingly what we need.