schema update

This commit is contained in:
mihaisc 2021-09-08 14:34:33 +03:00
parent 2e0f4b9e12
commit bcc520f38d

View File

@ -108,66 +108,25 @@ type Pool @entity {
transactionsTokenValues: [PoolTransactionTokenValues!] @derivedFrom(field: "poolAddress")
}
//PoolToken - all good as it is
type PoolToken @entity {
id: ID! # poolId + token address
// can be on multiple pools, should remove
poolId: Pool!
isDatatoken: Boolean!
address: String
tokenId: Datatoken
tokenAddress: String
balance: BigDecimal!
denormWeight: BigDecimal!
symbol: String
name: String
decimals: Int
pool: Pool! #
isDatatoken: Boolean! # if the token is a datatoken , not sure if this makes sense since it is duplicate information found on token
token: Token!
balance: BigDecimal! # balance of the token in this pool
denormWeight: BigDecimal!
symbol: String # should we keep this, it is found on token?
name: String # should we keep this, it is found on token?
decimals: Int # should we keep this, it is found on token?
}
// 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 {
id: ID! # poolId + userAddress
userAddress -> user: User!
poolId --> pool: Pool!
id: ID! # poolId + userAddress
user: User!
pool: Pool!
balance: BigDecimal!
}