Перейти до основного змісту

Exchange v1 Subgraph Examples

обережно

The LooksRare Exchange v1 is deprecated.

This Subgraph does not return live data since the Exchange v1 is not enabled anymore.

Sample Queries

Below are some sample queries to help you get started with the LooksRare Exchange Subgraph.

You can build your own queries using a GraphQL Explorer and enter your endpoint to limit your queries to the exact data desired.

Collection Totals

Description: Get the collections total stats

query collectionTotals(
$collection: String = "0x23581767a106ae21c074b2276d25e5c3e136a68b"
) {
collection(id: $collection) {
id
totalVolume
totalRoyaltyPaid
totalTransactions
}
}

Collection Transactions

Description: Get the 10 most recent transactions for a collection.

query collectionTransactions(
$collection: String = "0x23581767a106ae21c074b2276d25e5c3e136a68b"
) {
transactions(
where: { collection: $collection }
orderBy: block
orderDirection: desc
first: 10
) {
block
date
isTakerAsk
price
tokenId
taker {
id
}
maker {
id
}
}
}

Collection Daily Stats

Description: Get the collection's daily metrics for the last 7 trading days (days will skip if no trades occur)

query collectionDailyStats(
$collection: String = "0x23581767a106ae21c074b2276d25e5c3e136a68b"
) {
collectionDailyDatas(
where: { collection: $collection }
orderBy: date
orderDirection: desc
first: 7
) {
dailyRoyalty
dailyVolume
dailyTransactions
collection {
id
}
}
}

Collection Royalties

Description: Get the 10 most recent royalty payments to a collection.

query collectionRoyalties(
$collection: String = "0x23581767a106ae21c074b2276d25e5c3e136a68b"
) {
royaltyTransfers(
where: { collection: $collection }
first: 10
orderBy: block
orderDirection: desc
) {
tokenId
block
amount
id
}
}