Exchange Subgraph
Last updated
Last updated
The Exchange Subgraph contains indexed information about exchange, exchange volumes, asset volumes, the orders, developer royalties, etc.
type Exchange @entity {
id: ID!
orders: [Order!]!
numOfOrders: BigInt!
numOfBuyOrders: BigInt!
numOfSellOrders: BigInt!
}
type Token @entity {
id: ID!
address: Bytes!
escrow: TokenEscrow!
totalVolume: BigInt!
dailyData: [TokenDayData!]
}
type Account @entity {
id: ID!
address: Bytes!
orders: [Order!]!
numOfOpenBuyOrders: BigInt!
numOfOpenSellOrders: BigInt!
numOfFilledOrders: BigInt!
numOfCancelledOrders: BigInt!
volume: BigInt!
volumeAsBuyer: BigInt!
volumeAsSeller: BigInt!
dailyData: [AccountDayData!]
claimedRoyalties: [UserRoyalty!]
}
type UserRoyalty @entity {
id: ID!
user: Account!
token: Token!
claimedAmount: BigInt!
}
type Order @entity {
id: ID!
exchange: Exchange!
asset: Asset!
owner: Account!
type: OrderType!
price: BigInt!
amountOrdered: BigInt!
amountFilled: BigInt!
status: OrderStatus!
createdAtTimestamp: BigInt!
filledAtTimestamp: BigInt!
cancelledAtTimestamp: BigInt!
lastClaimedAtTimestamp: BigInt!
orderFills: [OrderFill!]
}
type OrderFill @entity {
id: ID!
filler: Account!
order: Order!
amount: BigInt!
pricePerItem: BigInt!
totalPrice: BigInt!
token: Token!
}
type Asset @entity {
id: ID!
tokenId: BigInt!
parentContract: Bytes!
orders: [Order!] @derivedFrom(field: "asset")
assetVolumeTransacted: BigInt!
}
type TokenDayData @entity {
id: ID!
token: Token!
volume: BigInt!
startTimestamp: Int!
}
type AccountDayData @entity {
id: ID!
account: Account!
token: Token!
volume: BigInt!
volumeAsBuyer: BigInt!
volumeAsSeller: BigInt!
startTimestamp: Int!
}