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

formBeacons

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-

{
  formBeacon(id: "1") {
    id
    formImplementationAddress
    beaconAddress
    formBeaconId
    creationBlockNumber
    creationTransactionHash
    totalBeaconCreated
  }
}

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. beaconAddress- This is the address of the beacon itself which is deployed from the superformFactory

  4. formBeaconId- This is used as the Id for the formBeacon and is unique for each formBeacon that is created

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

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

  7. 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
    formBeaconId
    vaultAddress
    superformId
    superformAddress
    creationBlockNumber
    creationTransactionHash
    totalSuperformsCreated
    vaultBasicDetails{
      id
      name
      symbol
      decimals
    }
    vaultAssetDetails{
      id
      address
      name
      symbol
      decimals
    }
    vaultDataDetails{
      id
      formBalance
      totalAssets
      pricePerShare
      previewPPS
    }
    superformYieldToken{
      id
      name
      symbol
    }
  }
}

The fields are as follows-

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

  2. formBeaconId- formBeaconId 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. vaultBasicDetails- This entity represent basic details of the vault on top of which the superform has been built. More details can found in VaultBasic

  10. vaultAssetDetails- This entity represents the underlying asset of the vault used for the superform. More details can be found in VaultAsset

  11. vaultDataDetails- This entity represents metrices related to the vault used for the superform. This represents the financials of the superform as well with details like TVL and APR coming from it. More details can be found in VaultData

  12. superformYieldToken- This represents the Superform Yield Token used for the superform. More details can be found in SuperformYieldToken

VaultBasic

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

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

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.

VaultData

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-

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

The fields in VaultData 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.

SuperformYieldToken

This represents the yield tokens for the various superforms and can be queried as follows-

{
  superFormYieldTokens(first:5){
    id
    name
    symbol
  }
}

The fields of SuperformYieldToken are as follows-

  1. id- This is stringified version of Superform Id that the YieldToken is serving.

  2. name- Name of the SuperformYieldToken

  3. symbol- Symbol of the SuperformYieldToken

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