Skip to content

[Proposal] Integrate Enzyme as a Data Provider #2139

@MartinGbz

Description

@MartinGbz

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Data ProviderContribute to Sismo Hub by creating a new Data Provider

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions