schma updates

This commit is contained in:
mihaisc 2021-11-23 09:59:59 +02:00
parent 3eeba287fb
commit 0ceff45ef2
1 changed files with 55 additions and 21 deletions

View File

@ -9,29 +9,38 @@ type Token @entity {
isDatatoken: Boolean! isDatatoken: Boolean!
"address of ERC721 that owns the token, valid only for datatokens" "address of ERC721 that owns the token, valid only for datatokens"
owner: String owner: String
"array of addresses with minter role, can be user wallet address, dispenser etc." "array of addresses with minter role, can be user wallet address, dispenser etc."
minter: [User!] minter: [User!]
"TODO: maybe we change name , depends on audit results . It's the address that collects the payments (NOT fees)" "TODO: maybe we change name , depends on audit results . It's the address that collects the payments (NOT fees)"
feeManager: String feeManager: String
"address of the market where the datatoken was created. This address collects market fees." "address of the market where the datatoken was created. This address collects market fees."
publishMarketFeeAddress: String publishMarketFeeAddress: String
"adreess of fee token (can be Ocean, ETH, etc.)" "adreess of fee token (can be Ocean, ETH, etc.)"
publishMarketFeeToken: String publishMarketFeeToken: String
"fee amount. Fixed value, expressed in wei in contracts, needs conversion in decimals." "fee amount. Fixed value, expressed in wei in contracts, needs conversion in decimals."
publishMarketFeeAmmount: BigDecimal publishMarketFeeAmmount: BigDecimal
"template ID of the datatoken" "template ID of the datatoken"
templateId: Int templateId: Int
"number of addresses holding a balance of datatoken , TODO: can we actually calculate this? what happens when users trade the dts" "number of addresses holding a balance of datatoken , TODO: can we actually calculate this? what happens when users trade the dts"
holderCount: BigInt holderCount: BigInt
"number of orders executed for this datatoken" "number of orders executed for this datatoken"
orderCount: BigInt orderCount: BigInt
"block time datatoken was created" "block time datatoken was created"
createdTimestamp: Int createdTimestamp: Int
"datatoken creation transaction id" "datatoken creation transaction id"
tx: Bytes tx: Bytes
"block number when it was created" "block number when it was created"
block: Int block: Int
} }
@ -49,12 +58,16 @@ type Nft @entity{
symbol: String! symbol: String!
name: String! name: String!
tokenUri: String! tokenUri: String!
"address of the owner of the nft" "address of the owner of the nft"
owner: String! owner: String!
"same as id, it's just for easy discoverability" "same as id, it's just for easy discoverability"
address: String! address: String!
"provider url that can decrypt the ddo" "provider url that can decrypt the ddo"
providerUrl: String providerUrl: String
"state of the asset (described in docs)" "state of the asset (described in docs)"
assetState: Int! assetState: Int!
@ -78,53 +91,67 @@ type Nft @entity{
type Pool @entity { type Pool @entity {
"pool address" "pool address"
id: ID! id: ID!
"owner address, pool controller" "owner address, pool controller"
owner: String! owner: String!
"only finalized pools are relevant to us" "only finalized pools are relevant to us"
isFinalized: Boolean! isFinalized: Boolean!
"pool token symbol" "pool token symbol"
symbol: String symbol: String
"pool token name" "pool token name"
name: String name: String
"maximum supply if any, converted from wei" "maximum supply if any, converted from wei"
cap: BigDecimal cap: BigDecimal
baseToken: PoolToken! baseToken: PoolToken!
datatoken: PoolToken! datatoken: PoolToken!
"pool Fee percent, fee goes to all liquidity providers : SWAP, JOIN , EXIT" "pool Fee percent, fee goes to all liquidity providers : SWAP, JOIN , EXIT"
poolFee: BigDecimal! poolFee: BigDecimal!
"OPF Fee percent, fee that goes to Ocean Protocol Foundation : SWAP" "OPF Fee percent, fee that goes to Ocean Protocol Foundation : SWAP"
opfFee: BigDecimal! opfFee: BigDecimal!
"market fee percent, fee that goes to the market where the pool was created : SWAP" "market fee percent, fee that goes to the market where the pool was created : SWAP"
marketFee: BigDecimal! marketFee: BigDecimal!
"actual value of fee collected in both tokens" "actual value of fee collected in both tokens"
totalPoolFee: [TokenValuePair!]! totalPoolFee: [TokenValuePair!]!
"actual value of fee collected in both tokens" "actual value of fee collected in both tokens"
totalOpfFee: [TokenValuePair!]! totalOpfFee: [TokenValuePair!]!
"actual value of fee collected in both tokens" "actual value of fee collected in both tokens"
totalMarketFee: [TokenValuePair!]! totalMarketFee: [TokenValuePair!]!
"fee after collection = totalFee - colectedFee" "fee after collection = totalFee - colectedFee"
currentOpfFee: [TokenValuePair!]! availableOpfFee: [TokenValuePair!]!
"fee after collection totalFee - colectedFee"
currentMarketFee: [TokenValuePair!]! "fee after collection totalFee - colectedFee"
availableMarketFee: [TokenValuePair!]!
"it's always 100 TODO: should be removed, seems redundant"
totalWeight: BigDecimal!
"total pool token shares" "total pool token shares"
totalShares: BigDecimal! totalShares: BigDecimal!
"total tokens that were swaped" "total tokens that were swaped"
totalSwapVolume: [TokenValuePair!]! totalSwapVolume: [TokenValuePair!]!
spotPrice: BigDecimal! spotPrice: BigDecimal!
"count for when liquidity has been added" "count for when liquidity has been added"
joinCount: BigInt! joinCount: BigInt!
"count for when liquidity has been removed" "count for when liquidity has been removed"
exitCount: BigInt! exitCount: BigInt!
"count for when tokens were swapped"
swapCount: BigInt! swapCount: BigInt!
"number of transactions in this pool involving liquidity changes" "number of transactions in this pool involving liquidity changes"
transactionCount: BigInt! transactionCount: BigInt!
@ -181,15 +208,19 @@ type PoolTransaction @entity {
"pool fee percent, fee goes to all liquidity providers : SWAP, JOIN , EXIT" "pool fee percent, fee goes to all liquidity providers : SWAP, JOIN , EXIT"
poolFee: BigDecimal! poolFee: BigDecimal!
"OPF Fee percent, fee that goes to Ocean Protocol Foundation : SWAP"
opfFee: BigDecimal!
marketFee: BigDecimal!
event: String # TODO: what is this?
tx: Bytes! "OPF Fee percent, fee that goes to Ocean Protocol Foundation : SWAP"
block: Int! opfFee: BigDecimal!
timestamp: Int!
"fee that goes to the publishing market"
marketFee: BigDecimal!
"block time when pool was created"
createdTimestamp: Int!
"pool creation transaction id"
tx: Bytes
"block number when it was created"
block: Int
gasLimit: BigDecimal! gasLimit: BigDecimal!
"price expressed in eth" "price expressed in eth"
@ -197,10 +228,13 @@ type PoolTransaction @entity {
"base tokens transfered" "base tokens transfered"
baseToken: TokenValuePair baseToken: TokenValuePair
"number of tokens transfered" "number of tokens transfered"
baseTokenValue: BigDecimal baseTokenValue: BigDecimal
"datatokens transfered , if value is negative it means it was removed" "datatokens transfered , if value is negative it means it was removed"
datatoken: TokenValuePair datatoken: TokenValuePair
"number of tokens transfered, if value is negative it means it was removed" "number of tokens transfered, if value is negative it means it was removed"
datatokenValue: BigDecimal datatokenValue: BigDecimal
} }