schema update

This commit is contained in:
mihaisc 2021-09-08 14:34:33 +03:00
parent 2e0f4b9e12
commit bcc520f38d
1 changed files with 11 additions and 52 deletions

View File

@ -108,66 +108,25 @@ type Pool @entity {
transactionsTokenValues: [PoolTransactionTokenValues!] @derivedFrom(field: "poolAddress") transactionsTokenValues: [PoolTransactionTokenValues!] @derivedFrom(field: "poolAddress")
} }
//PoolToken - all good as it is //PoolToken - all good as it is
type PoolToken @entity { type PoolToken @entity {
id: ID! # poolId + token address id: ID! # poolId + token address
// can be on multiple pools, should remove pool: Pool! #
poolId: Pool! isDatatoken: Boolean! # if the token is a datatoken , not sure if this makes sense since it is duplicate information found on token
isDatatoken: Boolean! token: Token!
address: String balance: BigDecimal! # balance of the token in this pool
tokenId: Datatoken denormWeight: BigDecimal!
tokenAddress: String symbol: String # should we keep this, it is found on token?
balance: BigDecimal! name: String # should we keep this, it is found on token?
denormWeight: BigDecimal! decimals: Int # should we keep this, it is found on token?
symbol: String
name: String
decimals: Int
} }
// not sure if we should keep both PoolToken and Datatoken
type Datatoken @entity {
id: ID! # token address
factoryID: DatatokenFactory!
symbol: String
name: String
decimals: Int!
address: String!
cap: BigDecimal!
supply: BigDecimal!
minter: String!
publisher: String!
// do we care about this?
holderCount: BigInt! # Number of addresses holding a balance of datatoken
orderCount: BigInt! # Number of orders executed for this dataset
// remove, doesn't make any sense, especially in v4
metadataUpdateCount: BigInt!
// array
orderVolume: BigDecimal
createTime: Int! # Block time datatoken was created
tx: Bytes # Datatoken creation transaction id
balances: [TokenBalance!] @derivedFrom(field: "datatokenId")
orders: [TokenOrder!] @derivedFrom(field: "datatokenId")
updates: [MetadataUpdate!] @derivedFrom(field: "datatokenId") # list of MetadataUpdate objects
}
// if we have 2 ,we can check if union works
union Token = PoolToken | Datatoken
type PoolShare @entity { type PoolShare @entity {
id: ID! # poolId + userAddress id: ID! # poolId + userAddress
userAddress -> user: User! user: User!
poolId --> pool: Pool! pool: Pool!
balance: BigDecimal! balance: BigDecimal!
} }