Balancer DOCS
Concepts
SDK
Developer Guides
  • Contracts

    • Deployment Addresses
      • Mainnet
      • Arbitrum
      • Optimism
      • Polygon
      • Gnosis
      • Goerli
    • APIs
    • Security
    • Error Codes
    • Query Functions
  • Subgraph

    • Overview
      • Core
      • Gauges
  • Swaps / Joins / Exits

    • Batch Swaps
    • Flash Swaps
    • Single Swap
    • Pool Joins
    • Pool Exits
  • Math

    • Weighted Math
    • Stable Math
    • Linear Math
  • veBAL & Gauges

    • APR Calculation
    • Gauges
    • veBAL
Concepts
SDK
Developer Guides
  • Contracts

    • Deployment Addresses
      • Mainnet
      • Arbitrum
      • Optimism
      • Polygon
      • Gnosis
      • Goerli
    • APIs
    • Security
    • Error Codes
    • Query Functions
  • Subgraph

    • Overview
      • Core
      • Gauges
  • Swaps / Joins / Exits

    • Batch Swaps
    • Flash Swaps
    • Single Swap
    • Pool Joins
    • Pool Exits
  • Math

    • Weighted Math
    • Stable Math
    • Linear Math
  • veBAL & Gauges

    • APR Calculation
    • Gauges
    • veBAL
  • Contracts
    • Deployment Addresses
      • Mainnet
      • Arbitrum
      • Optimism
      • Polygon
      • Gnosis
      • Goerli
    • Error Codes
    • Apis
      • Vault
    • Flash Loans
    • Internal User Balances
    • Pool Interfacing
    • Query Functions
    • Rate Providers
    • Security
  • Subgraph
    • Overview
    • Core
      • Entities
      • Querying
    • Gauges
      • Entities
      • Querying
  • Swaps
    • Batch Swaps
    • Single Swap
    • Flash Swaps
  • Joins And Exits
    • Pool Joins
    • Pool Exits
  • Lp Tokens
    • Underlying
    • Valuing
  • Math
    • Weighted Math
    • Stable Math
    • Linear Math
  • Vebal And Gauges
    • APR Calculation
    • Estimating Gauge Incentive APRs
    • Gauges
    • How Many BPT in veBAL?
    • veBAL

# Querying

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

You can build your own queries using a GraphQL Exploreropen in new window and enter your endpoint to limit the data to exactly what you need.

# Get first 5 of voting escrow

{
  votingEscrows(first: 5) {
    id
    stakedSupply
    locks {
      id
    }
  }
  votingEscrowLocks(first: 5) {
    id
    user {
      id
    }
    unlockTime
    lockedBalance
  }
}

Entities

Page contents
  • Get first 5 of voting escrow
Edit page on GitHub open in new window