2021-09-02 11:08:47 +02:00
|
|
|
type Token @entity {
|
2021-11-15 13:04:26 +01:00
|
|
|
id: ID!
|
|
|
|
symbol: String
|
|
|
|
name: String
|
|
|
|
decimals: Int!
|
|
|
|
address: String!
|
|
|
|
cap: BigDecimal
|
|
|
|
supply: BigDecimal
|
|
|
|
isDatatoken: Boolean!
|
|
|
|
|
|
|
|
"address of ERC721 that owns the token, valid only for datatokens"
|
2022-01-13 17:24:57 +01:00
|
|
|
nft: Nft
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2022-02-18 12:09:18 +01:00
|
|
|
"array of addresses with minter role"
|
|
|
|
minter: [String!]
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2022-02-18 12:09:18 +01:00
|
|
|
"array of addresses with payment manager minter role"
|
|
|
|
paymentManager: [String!]
|
|
|
|
|
|
|
|
"address that collects the payments (NOT fees)"
|
|
|
|
paymentCollector: String
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"address of the market where the datatoken was created. This address collects market fees."
|
2021-11-23 08:59:59 +01:00
|
|
|
publishMarketFeeAddress: String
|
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"adreess of fee token (can be Ocean, ETH, etc.)"
|
2021-11-23 08:59:59 +01:00
|
|
|
publishMarketFeeToken: String
|
|
|
|
|
2022-04-29 13:37:07 +02:00
|
|
|
"fee amount. Fixed value."
|
|
|
|
publishMarketFeeAmount: BigDecimal
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"template ID of the datatoken"
|
|
|
|
templateId: Int
|
|
|
|
|
|
|
|
"number of addresses holding a balance of datatoken , TODO: can we actually calculate this? what happens when users trade the dts"
|
2021-12-02 13:10:23 +01:00
|
|
|
holderCount: BigInt!
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"number of orders executed for this datatoken"
|
2021-12-02 13:10:23 +01:00
|
|
|
orderCount: BigInt!
|
2021-11-15 13:04:26 +01:00
|
|
|
|
2022-01-31 14:03:33 +01:00
|
|
|
"orders created with the datatoken, only available for datatokens"
|
|
|
|
orders: [Order!] @derivedFrom(field:"datatoken")
|
2022-01-31 11:09:05 +01:00
|
|
|
|
|
|
|
"fixed rate exchanges, only available for datatokens"
|
|
|
|
fixedRateExchanges: [FixedRateExchange!] @derivedFrom(field:"datatoken")
|
|
|
|
|
|
|
|
"dispensers using this token"
|
|
|
|
dispensers: [Dispenser!] @derivedFrom(field:"token")
|
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"block time datatoken was created"
|
2021-12-02 13:10:23 +01:00
|
|
|
createdTimestamp: Int!
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"datatoken creation transaction id"
|
2021-12-02 12:08:47 +01:00
|
|
|
tx: String!
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"block number when it was created"
|
2022-03-03 10:55:43 +01:00
|
|
|
block: Int!
|
|
|
|
|
|
|
|
lastPriceToken: String!
|
|
|
|
lastPriceValue: BigDecimal!
|
2021-07-30 09:36:44 +02:00
|
|
|
}
|
2021-05-13 08:19:21 +02:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"utility type"
|
2021-11-04 16:00:43 +01:00
|
|
|
type TokenValuePair @entity {
|
2022-02-15 17:13:55 +01:00
|
|
|
"address of the token"
|
2021-11-04 16:00:43 +01:00
|
|
|
id : ID!
|
2021-10-28 18:48:53 +02:00
|
|
|
token : Token!
|
|
|
|
value : BigDecimal!
|
|
|
|
}
|
|
|
|
|
2021-11-04 16:00:43 +01:00
|
|
|
type Nft @entity{
|
2021-11-15 13:04:26 +01:00
|
|
|
"nft address"
|
|
|
|
id: ID!
|
|
|
|
symbol: String!
|
|
|
|
name: String!
|
2022-08-01 13:58:09 +02:00
|
|
|
tokenUri: String
|
2021-11-29 13:11:58 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"address of the owner of the nft"
|
|
|
|
owner: String!
|
2022-04-04 14:52:30 +02:00
|
|
|
"address of the creator of the nft"
|
|
|
|
creator: String!
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"same as id, it's just for easy discoverability"
|
|
|
|
address: String!
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"provider url that can decrypt the ddo"
|
|
|
|
providerUrl: String
|
2021-11-23 08:59:59 +01:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"state of the asset (described in docs)"
|
|
|
|
assetState: Int!
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-11-04 16:00:43 +01:00
|
|
|
managerRole: [String!]
|
|
|
|
erc20DeployerRole: [String!]
|
|
|
|
storeUpdateRole: [String!]
|
2021-11-15 13:04:26 +01:00
|
|
|
"addresses that can update the metadata"
|
|
|
|
metadataRole: [String!]
|
|
|
|
|
|
|
|
"template address"
|
|
|
|
template: String!
|
|
|
|
|
2022-04-04 14:52:30 +02:00
|
|
|
"set if NFT is transferable"
|
|
|
|
transferable: Boolean!
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-11-15 13:04:26 +01:00
|
|
|
"block time nft was created"
|
|
|
|
createdTimestamp: Int!
|
|
|
|
"nft creation transaction id"
|
2021-12-02 12:08:47 +01:00
|
|
|
tx: String!
|
2021-11-15 13:04:26 +01:00
|
|
|
"block number when it was created"
|
2022-02-17 13:00:54 +01:00
|
|
|
block: Int
|
|
|
|
|
|
|
|
"number of orders executed for all underlying datatokens"
|
|
|
|
orderCount: BigInt!
|
2021-10-28 18:48:53 +02:00
|
|
|
}
|
|
|
|
|
2022-05-25 19:04:26 +02:00
|
|
|
type OrderReuse @entity {
|
|
|
|
id: ID!
|
|
|
|
order: Order!
|
|
|
|
caller: String!
|
2022-07-25 15:12:28 +02:00
|
|
|
createdTimestamp: Int!
|
2022-05-25 19:04:26 +02:00
|
|
|
tx: String!
|
2022-07-25 15:12:28 +02:00
|
|
|
block: Int!
|
2022-07-12 10:11:43 +02:00
|
|
|
providerFee: String
|
2022-07-20 13:34:56 +02:00
|
|
|
providerFeeValidUntil: BigInt
|
2022-05-25 19:04:26 +02:00
|
|
|
}
|
2022-08-01 13:58:09 +02:00
|
|
|
|
2021-11-26 09:04:14 +01:00
|
|
|
type Order @entity {
|
|
|
|
"transaction hash - token address - from address"
|
|
|
|
id: ID!
|
2022-01-31 11:09:05 +01:00
|
|
|
datatoken: Token!
|
2021-05-13 08:19:21 +02:00
|
|
|
|
|
|
|
consumer: User!
|
|
|
|
payer: User!
|
|
|
|
amount: BigDecimal!
|
2022-01-31 11:09:05 +01:00
|
|
|
serviceIndex: Int!
|
2021-10-28 18:48:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
# the fees will be updated from an event that will be created after (todo)
|
2021-11-26 09:04:14 +01:00
|
|
|
publishingMarket: User
|
2021-10-28 18:48:53 +02:00
|
|
|
publishingMarketToken: Token #
|
2022-02-11 12:41:47 +01:00
|
|
|
publishingMarketAmmount: BigDecimal #call contract to get fee amount
|
2022-07-12 10:11:43 +02:00
|
|
|
providerFee: String
|
2022-07-20 13:34:56 +02:00
|
|
|
providerFeeValidUntil: BigInt
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-11-26 09:04:14 +01:00
|
|
|
consumerMarket: User
|
2021-10-28 18:48:53 +02:00
|
|
|
consumerMarketToken: Token #
|
2022-02-11 12:41:47 +01:00
|
|
|
consumerMarketAmmount: BigDecimal #call contract to get fee amount
|
2021-05-13 08:19:21 +02:00
|
|
|
|
2022-05-25 19:04:26 +02:00
|
|
|
reuses: [OrderReuse!] @derivedFrom(field: "order")
|
|
|
|
|
2021-11-10 13:47:44 +01:00
|
|
|
createdTimestamp: Int!
|
2021-12-02 12:08:47 +01:00
|
|
|
tx: String!
|
2021-05-13 08:19:21 +02:00
|
|
|
block: Int!
|
2022-03-03 10:55:43 +01:00
|
|
|
|
2022-06-30 11:54:05 +02:00
|
|
|
lastPriceToken: String!
|
2022-03-03 10:55:43 +01:00
|
|
|
lastPriceValue: BigDecimal!
|
|
|
|
estimatedUSDValue: BigDecimal!
|
2020-11-26 12:10:45 +01:00
|
|
|
}
|
|
|
|
|
2020-12-02 11:07:09 +01:00
|
|
|
type User @entity {
|
2021-05-13 08:19:21 +02:00
|
|
|
id: ID!
|
2021-11-04 16:00:43 +01:00
|
|
|
tokenBalancesOwned: [TokenValuePair!]
|
2021-09-13 15:20:29 +02:00
|
|
|
orders: [Order!] @derivedFrom(field: "payer")
|
2021-05-13 08:19:21 +02:00
|
|
|
freSwaps: [FixedRateExchangeSwap!] @derivedFrom(field: "by")
|
2022-02-17 16:22:02 +01:00
|
|
|
|
|
|
|
"total number of orders made by this user"
|
|
|
|
totalOrders: BigInt!
|
|
|
|
|
|
|
|
"total number of orders made on assets owned by this user"
|
|
|
|
totalSales: BigInt!
|
2020-12-02 11:07:09 +01:00
|
|
|
}
|
2021-03-10 22:36:51 +01:00
|
|
|
|
|
|
|
type FixedRateExchange @entity {
|
2021-11-15 13:04:26 +01:00
|
|
|
"fixed rate exchange id"
|
2022-02-20 09:00:16 +01:00
|
|
|
id: ID!
|
|
|
|
contract: String!
|
|
|
|
exchangeId: String!
|
2021-11-04 16:00:43 +01:00
|
|
|
owner: User!
|
2021-09-13 15:20:29 +02:00
|
|
|
datatoken: Token!
|
|
|
|
baseToken: Token!
|
2022-02-11 12:41:47 +01:00
|
|
|
"amount of datatokens available to be sold, this is relevant if the exchange is not able to mint"
|
2022-02-20 09:00:16 +01:00
|
|
|
datatokenSupply: BigDecimal!
|
2022-02-11 12:41:47 +01:00
|
|
|
"amount of basetokens available to be collected by the owner"
|
2022-02-20 09:00:16 +01:00
|
|
|
baseTokenSupply: BigDecimal!
|
|
|
|
datatokenBalance: BigDecimal!
|
2022-02-11 12:41:47 +01:00
|
|
|
baseTokenBalance: BigDecimal!
|
2021-10-28 18:48:53 +02:00
|
|
|
price: BigDecimal!
|
2021-05-13 08:19:21 +02:00
|
|
|
active: Boolean!
|
2021-11-15 13:04:26 +01:00
|
|
|
"amount of total basetokens spent"
|
|
|
|
totalSwapValue: BigDecimal!
|
|
|
|
"address that is allowed to swap tokens"
|
|
|
|
allowedSwapper: String
|
|
|
|
"if the owner allowes the fre to mint"
|
|
|
|
withMint: Boolean
|
|
|
|
"if the fre has the minter role on the datatoken"
|
2022-02-15 17:12:29 +01:00
|
|
|
isMinter: Boolean
|
|
|
|
|
2021-05-13 08:19:21 +02:00
|
|
|
updates: [FixedRateExchangeUpdate!] @derivedFrom(field: "exchangeId")
|
|
|
|
swaps: [FixedRateExchangeSwap!] @derivedFrom(field: "exchangeId")
|
2021-11-10 13:47:44 +01:00
|
|
|
|
|
|
|
createdTimestamp: Int!
|
2021-12-02 12:08:47 +01:00
|
|
|
tx: String!
|
2021-11-10 13:47:44 +01:00
|
|
|
block: Int!
|
2022-02-17 11:26:05 +01:00
|
|
|
|
|
|
|
"address of the market where the datatoken was created. This address collects market fees."
|
|
|
|
publishMarketFeeAddress: String
|
|
|
|
|
2022-04-29 13:37:07 +02:00
|
|
|
"fee amount. Fixed value"
|
2022-02-17 11:26:05 +01:00
|
|
|
publishMarketSwapFee: BigDecimal
|
|
|
|
|
2021-03-10 22:36:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type FixedRateExchangeUpdate @entity {
|
2021-05-13 08:19:21 +02:00
|
|
|
id: ID!
|
|
|
|
exchangeId: FixedRateExchange!
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-11-10 13:47:44 +01:00
|
|
|
oldPrice: BigDecimal
|
|
|
|
newPrice: BigDecimal
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-11-10 13:47:44 +01:00
|
|
|
oldActive: Boolean
|
|
|
|
newActive: Boolean
|
2021-10-28 18:48:53 +02:00
|
|
|
|
|
|
|
oldAllowedSwapper: String
|
|
|
|
newAllowedSwapper: String
|
|
|
|
|
2021-05-13 08:19:21 +02:00
|
|
|
block: Int!
|
2021-11-10 13:47:44 +01:00
|
|
|
createdTimestamp: Int!
|
2021-12-02 12:08:47 +01:00
|
|
|
tx: String!
|
2021-03-10 22:36:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type FixedRateExchangeSwap @entity {
|
2021-05-13 08:19:21 +02:00
|
|
|
id: ID!
|
|
|
|
exchangeId: FixedRateExchange!
|
|
|
|
by: User!
|
|
|
|
baseTokenAmount: BigDecimal!
|
|
|
|
dataTokenAmount: BigDecimal!
|
|
|
|
block: Int!
|
2021-11-10 13:47:44 +01:00
|
|
|
createdTimestamp: Int!
|
2021-12-02 12:08:47 +01:00
|
|
|
tx: String!
|
2021-05-13 08:19:21 +02:00
|
|
|
}
|
|
|
|
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-05-13 08:19:21 +02:00
|
|
|
type Dispenser @entity {
|
2022-01-13 17:24:57 +01:00
|
|
|
"token address"
|
2022-02-21 11:45:24 +01:00
|
|
|
id: ID!
|
|
|
|
contract: String!
|
2022-01-13 17:24:57 +01:00
|
|
|
active: Boolean!
|
|
|
|
"if using the enterprise template the owner will always be the erc721 factory, for normal template it will a user"
|
|
|
|
owner: String
|
|
|
|
token: Token!
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-11-10 13:47:44 +01:00
|
|
|
allowedSwapper: String
|
2021-11-15 13:04:26 +01:00
|
|
|
isMinter: Boolean
|
|
|
|
"max tokens that can be dispensed"
|
|
|
|
maxTokens: BigDecimal!
|
|
|
|
"max balance of requester. If the balance is higher, the dispense is rejected"
|
|
|
|
maxBalance: BigDecimal!
|
|
|
|
"how many tokens are left"
|
2022-01-13 17:24:57 +01:00
|
|
|
balance: BigDecimal!
|
|
|
|
|
|
|
|
|
|
|
|
block: Int!
|
|
|
|
createdTimestamp: Int!
|
|
|
|
tx: String!
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-11-04 16:00:43 +01:00
|
|
|
dispenses: [DispenserTransaction!] @derivedFrom(field: "dispenser")
|
2021-05-13 08:19:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type DispenserTransaction @entity {
|
2021-11-10 13:47:44 +01:00
|
|
|
id: ID!
|
2021-10-28 18:48:53 +02:00
|
|
|
dispenser: Dispenser!
|
2021-05-13 08:19:21 +02:00
|
|
|
user: User!
|
|
|
|
amount: BigDecimal!
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2021-05-13 08:19:21 +02:00
|
|
|
block: Int!
|
2021-11-10 13:47:44 +01:00
|
|
|
createdTimestamp: Int!
|
2021-12-02 12:08:47 +01:00
|
|
|
tx: String!
|
2021-09-02 16:57:14 +02:00
|
|
|
}
|
|
|
|
|
2022-02-15 17:13:55 +01:00
|
|
|
"utility type"
|
|
|
|
type GlobalTotalLiquidityPair @entity {
|
|
|
|
"address of the token"
|
|
|
|
id : ID!
|
|
|
|
globalStatistic: GlobalStatistic!
|
|
|
|
token : Token!
|
|
|
|
value : BigDecimal!
|
|
|
|
}
|
|
|
|
|
|
|
|
"utility type"
|
|
|
|
type GlobalTotalFixedSwapPair @entity {
|
|
|
|
"address of the token"
|
|
|
|
id : ID!
|
|
|
|
globalStatistic: GlobalStatistic!
|
|
|
|
token : Token!
|
|
|
|
value : BigDecimal!
|
2022-02-20 14:51:01 +01:00
|
|
|
count: BigInt!
|
2022-02-15 17:13:55 +01:00
|
|
|
}
|
|
|
|
type GlobalStatistic @entity {
|
2022-08-01 13:58:09 +02:00
|
|
|
id: ID!
|
2022-02-15 17:13:55 +01:00
|
|
|
|
|
|
|
"total swap volume for each base token in fixed rate exchanges"
|
|
|
|
totalFixedSwapVolume: [GlobalTotalFixedSwapPair!] @derivedFrom(field: "globalStatistic")
|
2021-10-28 18:48:53 +02:00
|
|
|
|
2022-08-01 13:58:09 +02:00
|
|
|
"number of total orders. fixed rate exchange orders + dispenser orders"
|
2022-02-15 17:13:55 +01:00
|
|
|
orderCount: Int!
|
2021-12-07 10:47:58 +01:00
|
|
|
|
2022-02-15 17:13:55 +01:00
|
|
|
"total nfts(erc721) created"
|
|
|
|
nftCount: Int!
|
|
|
|
"total datatokens (tokens with isDatatoken = true) created"
|
2022-08-01 13:58:09 +02:00
|
|
|
datatokenCount:Int!
|
2022-02-15 17:13:55 +01:00
|
|
|
|
|
|
|
"number of fixed rate exchanges"
|
|
|
|
fixedCount: Int!
|
|
|
|
|
|
|
|
"number of dispensers created"
|
|
|
|
dispenserCount: Int!
|
2022-06-23 13:51:32 +02:00
|
|
|
|
|
|
|
"current version"
|
|
|
|
version: String
|
2021-10-28 18:48:53 +02:00
|
|
|
}
|
|
|
|
|
2022-02-18 16:38:51 +01:00
|
|
|
type OPC @entity {
|
|
|
|
id: ID!
|
|
|
|
"fee in percent for swaps involving OPC approved tokens"
|
|
|
|
swapOceanFee: BigDecimal
|
|
|
|
"fee in percent for swaps involving non OPC approved tokens"
|
|
|
|
swapNonOceanFee: BigDecimal
|
2022-05-17 11:27:48 +02:00
|
|
|
"fee in percent taken by OPC from orderFees"
|
|
|
|
orderFee: BigDecimal
|
2022-02-18 16:38:51 +01:00
|
|
|
"fee in percent taken by OPC from providerFees"
|
|
|
|
providerFee: BigDecimal
|
2022-06-13 18:11:25 +02:00
|
|
|
approvedTokens: [Token!]
|
2022-02-18 16:38:51 +01:00
|
|
|
}
|
2021-09-13 15:20:29 +02:00
|
|
|
|
2021-12-02 12:08:47 +01:00
|
|
|
enum NftUpdateType {
|
|
|
|
METADATA_CREATED,
|
|
|
|
METADATA_UPDATED,
|
|
|
|
STATE_UPDATED,
|
|
|
|
TOKENURI_UPDATED
|
|
|
|
}
|
|
|
|
|
2021-11-29 13:11:58 +01:00
|
|
|
type NftUpdate @entity {
|
|
|
|
id: ID! # update tx + nft address
|
2022-08-01 13:58:09 +02:00
|
|
|
tokenUri: String
|
2021-12-02 12:08:47 +01:00
|
|
|
nft: Nft!
|
2021-09-13 15:20:29 +02:00
|
|
|
|
2022-01-28 12:05:04 +01:00
|
|
|
"provider url that can decrypt the ddo"
|
|
|
|
providerUrl: String
|
|
|
|
|
2021-11-29 13:11:58 +01:00
|
|
|
"user that made the update"
|
2021-09-13 15:20:29 +02:00
|
|
|
userAddress: String!
|
|
|
|
|
2021-12-02 12:08:47 +01:00
|
|
|
"state of the asset in this update"
|
2021-11-29 13:11:58 +01:00
|
|
|
assetState: Int!
|
|
|
|
|
2021-12-02 12:08:47 +01:00
|
|
|
"type of the update: metadata created, metadata update, state update, token uri update"
|
|
|
|
type: NftUpdateType!
|
|
|
|
|
2021-09-13 15:20:29 +02:00
|
|
|
block: Int!
|
2021-11-29 13:11:58 +01:00
|
|
|
timestamp: Int!
|
2021-12-02 12:08:47 +01:00
|
|
|
tx: String!
|
2021-09-13 15:20:29 +02:00
|
|
|
}
|
2022-02-21 11:45:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
type Template @entity{
|
|
|
|
id: ID!
|
|
|
|
fixedRateTemplates: [String!]
|
|
|
|
dispenserTemplates: [String!]
|
|
|
|
ssTemplates: [String!]
|
2022-02-23 16:47:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|