Built With

TheGraph Subgraph URL:

NetworkChainIDSubgraph
Sepolia11155111D9Gqgx33iq8L6W3JVTxYreaU7w8pRGFpUs44Cui9sUdF
Arbitrum421617FsGux71c4UrU8hAj9LdeC4cghL5Ye3GxXbt7LHCJs1N
Polygon1375KdktDzHygaRe4RXwi1XjkU48HG2kpBp2dCgdnyGdxeg
Polygon Amoy800023f4Xu5Ws33rWv666JpVgiionCWs3StfAT9r84rpwmWVq

Queries

Query many raffles

Get raffles

{
  raffles(first: 1000, skip: 0) {
    id
    entryPrice
    minEntries
    prizes {
      asset
      type
      value
      name
      symbol
      decimals
      uri
    }
    creator {
      id
    }
    participantsCount
    participants {
      user {
        id
      }
      blockTimestamp
    }
    deadline
    state
    result {
      winner {
        id
      }
      drawSuccess {
        blockTimestamp
        transactionHash
      }
    }
    creation {
      blockTimestamp
      transactionHash
    }
  }
}

Query one raffle

Get one raffle

{
  raffle(id: "0xb374575756c701209a219158934ec2d763d46509") {
    networkId
    id
    entryPrice
    minEntries
    prizes {
      asset
      type
      value
      name
      symbol
      decimals
      uri
    }
    creator {
      id
    }
    participantsCount
    participants {
      user {
        id
      }
      blockTimestamp
    }
    deadline
    state
    result {
      winner {
        id
      }
      drawSuccess {
        blockTimestamp
        transactionHash
      }
    }
    creation {
      blockTimestamp
      transactionHash
    }
  }
}

Query a raffle activity

Get all the activity from a raffle

{
  entries(where: { raffle: "0xb374575756c701209a219158934ec2d763d46509" }) {
    user {
      id
    }
    quantity
    total
    boughtEvent {
      blockTimestamp
      transactionHash
    }
  }
  deadlineFailedCriterias(
    where: { raffle: "0xb374575756c701209a219158934ec2d763d46509" }
  ) {
    entries
    transactionHash
    blockTimestamp
  }
  deadlineSuccessCriterias(
    where: { raffle: "0xb374575756c701209a219158934ec2d763d46509" }
  ) {
    entries
    transactionHash
    blockTimestamp
  }
}

Query a raffle refunds

Get the user refunds from a raffle

{
  raffle(id: $address) {
    prizesRefunded {
      blockTimestamp
      transactionHash
    }
    participants(where: { user: $userAddress }) {
      id
    }
    entriesRefunded(where: { user: $userAddress }) {
      entriesRefunded
      blockTimestamp
      transactionHash
    }
  }
}