Code Monkey home page Code Monkey logo

Comments (4)

calvinkei avatar calvinkei commented on August 23, 2024
type Vault @entity {
  id: ID!
  address: Bytes!
  asset: Token!
  timestamp: BigInt!
  totalAssets: BigInt!
  totalSupply: BigInt!
  assetPerShare: BigInt!
  apy: BigDecimal!
  DailyVaultStats: [DailyVaultStat!]! @derivedFrom(field: "vault")
}

type DailyVaultStat @entity {
  id: ID!
  vault: Vault!
  timestamp: BigInt!
  apy: BigDecimal!
  totalAssets: BigInt!
  totalSupply: BigInt!
  assetPerShare: BigInt!
}

type VaultBalance @entity {
  id: ID!
  owner: Bytes!
  vault: Vault!
  timestamp: BigInt!
  shareBalance: BigInt!
  assetBalance: BigInt!
  assetDeposited: BigInt!
  dailyVaultBalances: [DailyVaultBalance!]! @derivedFrom(field: "vaultBalance")
}

type DailyVaultBalance @entity {
  id: ID!
  vaultBalance: VaultBalance!
  timestamp: BigInt!
  shareBalance: BigInt!
  assetBalance: BigInt!
  assetDeposited: BigInt!
}

enum TransactionType {
  DEPOSIT
  WITHDRAW
  TRANSFER
}

type Transaction @entity {
  id: ID!
  vault: Vault!
  timestamp: BigInt!
  type: TransactionType!
  shareAmount: BigInt!
  assetAmount: BigInt!
  hash: Bytes!
  to: Bytes!
  from: Bytes!
}

type Token @entity {
  id: ID!
  symbol: String!
  name: String!
  decimals: Int!
}

type TokenBalance @entity {
  id: ID!
  owner: Bytes!
  token: Token!
  balance: BigInt!
  timestamp: BigInt!
}

from mstable-subgraphs-monorepo.

toniocodo avatar toniocodo commented on August 23, 2024

a few comments:

  • what do you think of adding the address on relevant entities (or maybe you were planning on using id field for it)
  • we actually have 4 transaction types (+ MINT, REDEEM)
  • is transaction data enough? Don't we need hash, to, from, spender,...

from mstable-subgraphs-monorepo.

calvinkei avatar calvinkei commented on August 23, 2024

@toniocodo

  1. yes we can, and it will also be the id field
  2. from the ABI I see there's only Deposit, Withdraw and Transfer events https://api-goerli.etherscan.io/api?module=contract&action=getabi&address=0xA54f8A870f1817271bcb1DeDa0aB37566f6C4556
  3. yes you're right, will add that too

from mstable-subgraphs-monorepo.

calvinkei avatar calvinkei commented on August 23, 2024

agreed on the schema, move on to the development and integration

from mstable-subgraphs-monorepo.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.