Lewati ke konten utama

LooksRare YOLO Subgraph

Introduction

The LooksRare YOLO Subgraph is designed to index data from the YOLO contract deployed on the Ethereum network. The YOLO contract is a system where users can deposit different types of tokens (ETH/ERC-20/ERC-721) to participate in YOLO rounds.

The LooksRare YOLO Subgraph organizes its data into several core entities. These entities include:

  • YOLO: Represents the overall YOLO state.
  • Round: Contains information about a specific YOLO round.
  • Entry: Describes a single user's participation in a round.
  • Deposit: Represents a deposit made by a user in a round.
  • Transaction: Represents an Ethereum transaction associated with a YOLO event.
  • RoundStatusLog: Contains logs for the status changes of a round.

If you're unfamiliar with GraphQL, you may want to check out an Introduction to GraphQL.

The YOLO Subgraph is located at the following endpoint: YOLO Subgraph.

Entities Schema

More information about each field can also be found in the YOLO Smart Contract documentation.

Entry

An Entry entity represents an entry in a round.

  • id: The entry’s id (ID!).
  • depositor: The address of the depositor (Bytes!).
  • round: The Round entity associated with the entry (Round!).
  • totalNumberOfEntries: The total number of entries for the depositor in the round (BigInt!).
  • deposits: A list of Deposit entities associated with this entry ([Deposit!]!)

Round

A Round entity represents a round of the YOLO.

  • id: The round’s id (ID!).
  • roundId: The roundId within the contract (BigInt!).
  • status: The status of the round (Int!).
  • lastStatusUpdate: The timestamp of the last status update (BigInt).
  • statusLog: A list of RoundStatusLog entities associated with the round ([RoundStatusLog!]!).
  • winner: The address of the round’s winner (Bytes).
  • cutoffTime: The cutoff time for the round (BigInt!).
  • drawnAt: The timestamp when the winner was drawn (BigInt).
  • drawnHash: The transaction hash where the winner was drawn (Bytes).
  • numberOfParticipants: The number of participants in the round (BigInt!).
  • maximumNumberOfDeposits: The maximum number of deposits for the round (BigInt!).
  • maximumNumberOfParticipants: The maximum number of participants for the round (BigInt!).
  • valuePerEntry: The value per entry for the round (BigInt!).
  • numberOfEntries: The number of entries in the round (BigInt!).
  • deposits: A list of Deposit entities associated with the round ([Deposit!]!).
  • transactions: A list of Transaction entities associated with the round ([Transaction!]!).

RoundStatusLog

A RoundStatusLog entity represents a log of a round's status change.

  • id: The log’s id (ID!).
  • round: The Round entity associated with the status log (Round!).
  • status: The status of the round (Int!).
  • transaction: The transaction hash that caused the status to change (Bytes!).
  • timestamp: The timestamp when the status was updated (BigInt!).
  • block: The block number when the status was updated (BigInt!).

YOLO

A YOLO entity represents the overall YOLO game.

  • id: The YOLO entity id (ID!).
  • totalRounds: The total number of rounds in the YOLO (BigInt!).

Deposit

A Deposit entity represents a deposit made in a round.

  • id: The deposit’s id (ID!).
  • round: The Round entity associated with the deposit (Round!).
  • entry: The Entry entity associated with the deposit (Entry!).
  • transaction: The Transaction entity associated with the deposit (Transaction!).
  • indice: The index of the deposit (BigInt!).
  • tokenType: The type of token deposited (Int!).
  • tokenAddress: The address of the token (Bytes!).
  • tokenId: The id of the token (BigInt!).
  • tokenAmount: The amount of tokens deposited (BigInt!).
  • depositor: The address of the depositor (Bytes!).
  • numberOfEntries: The number of entries corresponding to the deposit (BigInt!).
  • claimed: Indicates whether the deposit has been claimed (Boolean!).
  • withdrawn: Indicates whether the deposit has been withdrawn (Boolean!).
  • claimedHash: The transaction hash when the deposit was claimed (Bytes).

Transaction

A Transaction entity represents a transaction in a round.

  • id: The transaction's hash (ID!).
  • hash: The transaction’s hash (Bytes!).
  • round: The Round entity associated with the transaction (Round!).
  • depositor: The address of the depositor (Bytes!).
  • deposits: A list of Deposit entities associated with the transaction ([Deposit!]!).
  • totalNumberOfEntries: The total number of entries associated with the transaction (BigInt!).
  • gasLimit: The gas limit of the transaction (BigInt!).
  • gasPrice: The gas price of the transaction (BigInt!).
  • block: The block number when the transaction was made (BigInt!).
  • timestamp: The timestamp when the transaction was made (BigInt!).

Examples

Querying YOLO total rounds

This query retrieves the totalRounds of the YOLO game.

{
yolos {
totalRounds
}
}

Querying a Round

This query retrieves a specific Round by its id.

{
round(id: "4") {
id
roundId
status
lastStatusUpdate
cutoffTime
deposits {
tokenType
depositor
tokenAddress
tokenAmount
}
numberOfParticipants
maximumNumberOfDeposits
maximumNumberOfParticipants
valuePerEntry
numberOfEntries
drawnAt
winner
}
}

Querying an Entry

This query retrieves a specific Entry by its id.

{
entry(id: "4-0x992c659e3a3a2a7902c145441c77e8c216a1332f") {
id
depositor
round {
roundId
drawnAt
cutoffTime
}
totalNumberOfEntries
}
}

Querying a Deposit

This query retrieves a specific Deposit by its id.

{
deposit(id: "4-2") {
id
round {
roundId
lastStatusUpdate
}
entry {
id
totalNumberOfEntries
}
transaction {
hash
}
indice
tokenType
tokenAddress
tokenId
tokenAmount
depositor
numberOfEntries
claimed
withdrawn
claimedHash
}
}

Querying a Transaction

This query retrieves a specific Transaction by its id.

{
transaction(
id: "0x06332cd7009ac080ddb6af6d86e2a0756bc6d7c6071d29e89e5481edc43d38fa"
) {
id
hash
round {
roundId
}
depositor
totalNumberOfEntries
gasLimit
gasPrice
block
timestamp
}
}

Querying a RoundStatusLog

This query retrieves a specific RoundStatusLog by its id.

{
roundStatusLog(id: "4-2") {
id
round {
roundId
}
status
transaction
timestamp
block
}
}