Form Related Entities

These keep track of forms, vaults and superforms which are core of the protocol

Introduction

These queries can be used to keep track of Forms, vaults, and consequently Superforms that are created.

Core Concepts

formImplementaion

formBeacons are form implementations that have been added to the protocol using SuperformFactory. When vaults are added to them, Superforms are created, and handle the actual deposit/withdraw in our protocol. They can be queried as follows-

{
  formImplementation(id: "1") {
    id
    formImplementationAddress
    formImplementationID
    creationBlockNumber
    creationTransactionHash
    totalFormImplementationCreated
  }
}

The fields of formBeacon are as follows-

  1. id- This is the stringifed representation of formBeaconId and is used as the reference for the entity

  2. formImplementationAddress- It is the address of the underlying form implementation for the formBeacon

  3. creationBlockNumber- Block Number in which the formBeacon was created

  4. creationTransactionHash- Hash of transacrtion used to create the formBeacon

  5. totalBeaconCreated- Total number of formBeacons that were created on the chain as of creation of the formBeacon

Superforms

This tracks all the Superforms that have been created in the protocol using the various formBeacons created on the chain. The Superforms can be queried as follows-

{
  superforms(first:5){
    id
    formImplementationID
    vaultAddress
    superformID
    superformAddress
    creationBlockNumber
    creationTransactionHash
    vaultDetails {
      id
      name
      decimals
      vaultAsset {
              id
              address
              name
              symbol
              decimals
      }
      vaultFinancials{
              id
              formBalance
              totalAssets
              pricePerVaultShare
              previewPPS
      }
    }
  }
}

The fields are as follows-

  1. id- This is the stringified version of the superformId and is used for referencing the individual superforms

  2. formImplementationID- formImplementationID of the underlying form using which the superform has been built.

  3. vaultAddress- Address of the underlying vault serving the superform

  4. superformId- This is used as the Id for the superform and is unique for each superForm that is created

  5. superformAddress- Address of the superform itself deployed by the superformFactory

  6. creationBlockNumber- Block Number in which the superform was created

  7. creationTransactionHash- Hash of transaction used to create the superform

  8. totalSuperformsCreated- Total number of superforms that were created on the chain as of creation of the superform

  9. vaultDetails- This entity represent basic details of the vault on top of which the superform has been built. More details can found in VaultDetails

VaultDetails

This represents basic details related to a vault. Every vault has one VaultBasic which then can be queried using-

{
  vaultDetails(first:5){
    id
    name
    symbol
    decimals
    vaultAsset {
              id
              address
              name
              symbol
              decimals
      }
    vaultFinancials{
              id
              formBalance
              totalAssets
              pricePerVaultShare
              previewPPS
      }
  }
}

Fields for VaultBasic are as follows-

  1. id- This is the id used for referencing for the VaultBasic. To relate every VaultBasic with individual vaults, the id of VaultBasic is the address of the vault which it represents.

  2. name- Name of the vault that it represents

  3. symbol- Symbol of the vault which is being represented by the VaultBasic

  4. decimals-Vault decimals for the corresponding vault.

VaultAsset

This represents the underlying asset of the vault. Every vault has one VaultAsset and this can be queried as-

{
  vaultAssets(first:5){
    id
    name
    symbol
    decimals
  }
}

Fields for VaultAsset are as follows-

  1. id- This is the id used for referencing the VaultAsset. To relate every VaultAsset with individual vaults, the id of VaultAsset is the address of the vault which it represents.

  2. name- Name of the asset used for the vault that it represents

  3. symbol- Symbol of the asset of the vault

  4. decimals-Vault decimals for the asset of the corresponding vault.

VaultFinancials

This is the field that actually denotes the financials of the vaults. This helps in establishing metrics like TVL and APR for the vaults in Superform protocol and thus the forms built using them. VaultData can be queried as follows-

{
  vaultFinancials(first:5){
    id
    totalAssets
    formBalance
    previewPPS
    pricePerVaultShare
  }
}

The fields in VaultFinancials are as follows-

  1. id- This is the id used for referencing the VaultData instances. To relate every VaultData with individual vaults, the id of VaultData is the address of the vault which it represents.

  2. totalAssets- This the total assets that are in the vault. This hence thus represents the TVL of the vaults.

  3. formBalance- This is the total assets part of the vault through various forms of the protocol

  4. previewPPS- This is used to preview the price per vault share at any given point for the various vaults

  5. pricePerVaultShare- This is used to get the Price Per Vault Share of various vaults which then along with previewPPS can be used for APR calculation.

VaultMapping

This is a mapping of various vaults with the Superforms and formBeacons they serve. This helps to establish an 1 to N connection between vaults and all the different superforms that it serves in the protocol. VaultMapping can be queried as follows-

{
  vaultMappings(id: "0x73958d46b7aa2bc94926d8a215fa560a5cdca3ea"){
    id
    vaultAddress
    superForm(first:5){
      id
      superFormId
    }
    formBeacon(first:5){
      id
      formBeaconId
    }
  }
}

The fields are as follows-

  1. id- This is the id used for referencing the VaultMapping instances. To relate every VaultMapping with individual vaults, the id of VaultMapping is the address of the vault which it represents.

  2. vaultAddress- This is the address of the vault itself from which we are establishing the mappings to different superforms and formBeacons

  3. superForm- It is a list of Superform entities and lists all the Superforms that are using the particular vault. Different fields part of Superform entity can be queried as part of the mappings

  4. formBeacon- It is the list of formBeacons that are built using the particular vault. Similar to Superforms, different fields of formBeacons can be queried as part of the mappings.

Last updated