Developers Docs
Search…
⌃K

Integrate with SimpleFi's DeFi ROI dashboard

Our DeFi ROI dashboard is SimpleFi's first product. It makes it easy for people to figure out how their investments are doing. You don't need us to integrate your protocol - all it takes is a subgraph
Welcome fellow developer, Here we discuss how our ROI dashboard works and how you can integrate your DeFi protocol to give your users the ability to track their returns.
One of its main strengths is that it "rewinds" complex DeFi positions - like staking LP tokens in a yield farm for example - and provides a complete breakdown of your returns. So if you ever wondered if your farming rewards compensate for impermanent loss in the underlying liquidity pool, now you know!
For a more general overview please read this. Or read on to get straight to the technical nitty gritty and tutorials!
Our dashboard can be thought of having four main components -
  1. 1.
    Blockchain data indexing service
  2. 2.
    Pricing service
  3. 3.
    Back-end service
  4. 4.
    Front-end web application

Blockchain Data Indexing Service

We use subgraphs (The Graph's method to index data) to make ROI calculations faster, and to allow any developer to integrate their own DeFi protocol into SimpleFi dashboard. All you need is knowledge of subgraph and smart contracts development.
We assume that you know basics of subgraph development. If you are not familiar with subgraph development then please go though their documentation at https://thegraph.com/docs/developer/quick-start
The use of the subgraph is particularly aimed at indexing the user investment/debt positions in any DeFi protocol, from which their ROI can be easily derived.
We have defined a common GraphQL schema that can be used to track a user's position in almost all DeFi protocols. The reason we developed a generalized graphing schema, and dedicated subgraphs for each protocol, rather than, say, using existing (and often excellent) subgraphs is because:
  1. 1.
    It makes it extremely easy for developers to integrate their own protocols into the SimpleFi dashboard. They can simply follow the template, and avoid having to wait on the SimpleFi team to do it for them #noBottlenecks
  2. 2.
    It ensures a consistent data structure across all protocols, and allows developers to build applications without the headache of having to implement slightly different calls and tailored data transformations for each protocol
These docs contain a walk through of how we developed the subgraphs for SushiSwap liquidity pools and farms to help you understand how you can use this schema to develop subgraph for your own protocol.
The code for all the subgraphs that our team has developed can be found at https://github.com/SimpleFi-finance/subgraphs

Content Index