# Queries

Below are some sample queries you can use to gather information from UMA contracts.

You can build your own queries using a [GraphQL Explorer](https://graphiql-online.com/graphiql) and enter your endpoint to limit the data to exactly what you need.

## Financial Contracts

```graphql
{
  financialContracts {
    id
    creator {
      id
      isRemoved
      manager
    }
    deployer {
      id
    }
    address
    collateralToken {
      id
      name
    }
    collateralRequirement
    expirationTimestamp
    totalSyntheticTokensBurned
    totalSyntheticTokensCreated
    totalTokensOutstanding
    cumulativeFeeMultiplier
    globalCollateralizationRatio
    rawTotalPositionCollateral
    totalCollateralDeposited
    totalCollateralWithdrawn
    totalPositionCollateral
    rawLiquidationCollateral
    positions {
      id
      rawCollateral
      collateral
      tokensOutstanding
      isEnded
    }
    liquidations {
      id
      status
      amountWithdrawn
    }
  }
}
```

## Liquidations

```graphql
{
  liquidations {
    id
    status
    sponsor {
      id
    }
    liquidator {
      id
    }
    disputer {
      id
    }
    liquidationId
    tokensLiquidated
    lockedCollateral
    liquidatedCollateral
    disputeBondAmount
    disputeSucceeded
    amountWithdrawn
    events {
      __typename
    }
  }
}
```

## Price Requests

```graphql
{
  priceRequests {
    id
    isResolved
    price
    latestRound {
      roundId
      snapshotId
      totalVotesRevealed
      totalRewardsClaimed
      totalSupplyAtSnapshot
      votersAmount
      votersClaimedAmount
      tokenVoteParticipationRatio
      tokenVoteParticipationPercentage
      votersEligibleForRewardsRatio
      votersEligibleForRewardsPercentage
      votersClaimedRatio
      votersClaimedPercentage
      tokensClaimedRatio
      tokensClaimedPercentage
      winnerGroup {
        votersAmount
        totalVoteAmount
      }
      groups {
        price
        totalVoteAmount
        won
        votersAmount
      }
    }
    time
    identifier {
      id
      isSupported
    }
    committedVotes(first: 2) {
      time
    }
    revealedVotes(first: 2) {
      price
      time
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uma.xyz/resources/subgraph-data/queries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
