Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Integrate Enzyme as a Data Provider #2139

Open
MartinGbz opened this issue Aug 1, 2023 · 2 comments
Open

[Proposal] Integrate Enzyme as a Data Provider #2139

MartinGbz opened this issue Aug 1, 2023 · 2 comments
Labels
Data Provider Contribute to Sismo Hub by creating a new Data Provider

Comments

@MartinGbz
Copy link
Contributor

Enzyme is a platform that allows people to invest in DeFi with very little management. Users deposit tokens in vaults that generate income through DeFi strategies.
Integrate Enzyme as a Data Provider will enable to create new Data Groups from Vaults depositors.

Specifications

Here is the interface-schema.json that represents the specifications of the Data Provider:

 {
  "name": "Enzyme",
  "iconUrl": "",
  "providerClassName": "EnzymeProvider",
  "functions": [
    {
      "name": "Get the depositors of a vault",
      "functionName": "getVaultDepositors",
      "countFunctionName": "getVaultDepositorsCount",
      "description": "Returns all the depositors of a specific vault on Enzyme. The value of each group member is the total amount they have deposited in the vault.",
      "args": [
         {
          "name": "Vault ID",
          "argName": "vaultId",
          "type": "string",
          "example": "0x9cfe227cab5ed97cd6781aee5f7ed6401f566355",
          "description": "The ID of the vault"
        }
      ]
    }
  ]
}

Tips on how to integrate the Data Provider

The easiest way to integrate Enzyme is to use their subgraph: https://thegraph.com/hosted-service/subgraph/enzymefinance/enzyme-core

You can find easily the depositors by using this query for instance:

query {
  vault(id: "0x9cfe227cab5ed97cd6781aee5f7ed6401f566355") {
    id
    deposits {
      id
      depositor {
        id
      }
      shares
      since
    }
    depositCount
    counter
  }
}

FYI: another subgraph exists: https://thegraph.com/hosted-service/subgraph/enzymefinance/enzyme feel free to explore it if you can't find what you want in the first given subgraph.

You are also free to use any other way to fetch this data, for example you can use the BigQuery Data Provider.


Remember that the aim is to get the all the depositors in a vault, but that the value of each depositor must be the total amount he has deposited.
Here’s an example of the object that your Data Provider needs to return:

{
  "0x123": "20000000000000000000",
  "0x456": "140000000000000000000", 
  "0x789": "1000000000000000000" 
}

⚠️ The amount deposited can’t be a decimal value (because for now we don’t support this). To avoid this: convert the decimal number in Wei (20 ETH <=> 20000000000000000000 wei)


See the Sismo documentation to understand what a Data Provider is, and the tutorial to learn how to create one.

Please don’t hesitate to ping the team in this GitHub issue if you have any questions. You can also contact us on Telegram or Discord.

Have fun!

@MartinGbz MartinGbz added the Data Provider Contribute to Sismo Hub by creating a new Data Provider label Aug 1, 2023
@3scava1i3r
Copy link
Contributor

Taking this up @MartinGbz

@3scava1i3r
Copy link
Contributor

Just confirming that I am still working on the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Provider Contribute to Sismo Hub by creating a new Data Provider
Projects
None yet
Development

No branches or pull requests

2 participants