The markets field returns an array of Market.
Markets with the same base and quote assets can be aggregated via Volume Weighted Averaging.
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
}
}
}
Field | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | Unique identifier for the market | |||||||||||||||||||||||||
marketType | MarketType | Type of market | ||||||||||||||||||||||||
marketStatus | MarketStatus | Status of market | ||||||||||||||||||||||||
marketSymbol | String | Unique symbol identifying the market in the format {exchange_symbol}:{base_symbol}/{quote_symbol} | ||||||||||||||||||||||||
baseSymbol | String | Base asset symbol | ||||||||||||||||||||||||
quoteSymbol | String | Quote asset symbol | ||||||||||||||||||||||||
exchangeSymbol | String | Exchange symbol | ||||||||||||||||||||||||
remoteId | String | Remote identifier on the exchange | ||||||||||||||||||||||||
openedOn | Int | |||||||||||||||||||||||||
openedOnDate | String | |||||||||||||||||||||||||
firstUnix | Int | The unix timestamp of the first market data | ||||||||||||||||||||||||
firstDate | String | The unix timestamp of the first market data as an ISO 8601 formatted string | ||||||||||||||||||||||||
lastUnix | Int | The unix timestamp of the last market update | ||||||||||||||||||||||||
lastDate | String | the unix timestamp of the last market update as an ISO 8601 formatted string | ||||||||||||||||||||||||
ticker | Ticker | Current market statistics | ||||||||||||||||||||||||
ohlcv | OHLCV | Compressed OHLCV for the market. By default returns the newest candles. | ||||||||||||||||||||||||
Inputs |
|
Field | Type | Description |
---|---|---|
percentChange | String | Percent change in 24 hours |
lastPrice | String | Last price |
lowPrice | String | Lowest price in the past 24 hours |
highPrice | String | Highest price in the past 24 hours |
baseVolume | String | Base asset volume traded in past 24 hours |
quoteVolume | String | Quote asset volume traded in past 24 hours |
Field | Type | Description |
---|---|---|
_and | [MarketFilter] | And operator |
_or | [MarketFilter] | Or operator |
id | StringFilter | id filters |
marketSymbol | StringFilter | marketSymbol filters |
marketType | MarketTypeFilter | marketType filters |
marketStatus | MarketStatusFilter | marketStatus filters |
exchangeSymbol | StringFilter | exchangeSymbol filters |
baseSymbol | StringFilter | baseSymbol filters |
quoteSymbol | StringFilter | quoteSymbol filters |
openedOn | IntFilter | |
firstUnix | IntFilter | firstUnix filter |
lastUnix | IntFilter | lastUnix filter |
baseAsset | AssetFilter | Filter by base asset |
quoteAsset | AssetFilter | Filter by quote asset |
exchange | ExchangeFilter | Filter by exchange |