Sample Subgraph Queries

The following queries can be swapped into the query variable in the Subgraph Query in Python example to fetch the indicated data.

Strategies Sample Query

# The Graph query
query = """

{
  strategies(first: 10) {
    id
    order0 {
      A
      B
      y
      z
      inputToken {
        symbol
      }
      outputToken {
        symbol
      }
    }
    token0 {
      id
    }
    token1 {
      id
    }
    order1 {
      A
      B
      y
      z
      inputToken {
        symbol
      }
      outputToken {
        symbol
      }
    }
    owner {
        id
      }
  }
}
"""

Pairs Sample Query

# The Graph query
query = """
{
  pairs {
    token0 {
      symbol
    }
    token1 {
      symbol
    }
  }
}
"""

Trades Sample Query

# The Graph query
query = """
{
  trades {
    sourceAmount
    targetAmount
    sourceToken {
      symbol
    }
    targetToken {
      symbol
    }
    tradingFeeAmount
    transactionHash
    blockNumber
  }
}
"""

Last updated