API Documentation


Markets

Examples | Type Definition

The markets field returns an array of Market.

Markets with the same base and quote assets can be aggregated via Volume Weighted Averaging.

Examples

All BTC/USD markets

Markets can be filtered using a filter object or a marketSymbol.

A marketSymbol is used for simple and quick filtering of markets. The format is exchangeSymbol:baseSymbol/quoteSymbol. The exchange symbol and initial colon are optional and any of the three can be replaced with an asterisk for a wildcard.

query markets {
  markets(marketSymbol: "btc/usd") {
    marketSymbol
    ticker {
      lastPrice
    }
  }
}

The filter object enables more complex querying.

query markets {
  markets(filter: { baseSymbol: { _eq: "btc" }, quoteSymbol: { _in: ["usd", "usdt"] } }) {
    marketSymbol
    ticker {
      lastPrice
    }
  }
}

Filter objects and marketSymbol and can be combined. MarketSymbol will take prescedence.

query markets {
  markets(marketSymbol: "binance:*/usdt", filter: { baseSymbol: { _in: ["ltc", "btc"] } }) {
    marketSymbol
    ticker {
      lastPrice
    }
  }
}