Query Examples
Last updated
Last updated
Here are some example queries to interact with Seer and third-party subgraphs. You can fetch data points like:
prediction markets you created
current liquidity of a pool
current prices for tokens in your portfolio
and much more. To run a query, copy and paste it into the graph explorer. You can access the graph explorer url by replacing {subgraph-id} with the .
Graph Explorer Url:
To query market data you need to use .
You can choose to query multiple markets or a specific market by providing a market id.
To query the first 5 markets:
To query a single market:
To query multiple pools with liquidity information:
You may notice that we use skip here to get 10 pools after the first 5.
Every time the prices of a pool change, a record of PoolHourData
is registered. You can query for these records and filter a specific time range using periodStartUnix_lt
and periodStartUnix_gt
.
The following query retrieves the first 5 PoolHourData
records from September 1, 2024, between 00:00 and 10:00 UTC:
To query for LItems:
To query liquidity and price data you need to use .
Currently, Seer is using Swapr to create and provide liquidity for trading pools. Behind the scenes, Swapr uses Algebra and Algebra Subgraph, for which you can find the documentation . Inside the docs you can find more information about Algebra Subgraph schemas, queries, and other related topics.
To query curate data you need to use .
Prediction markets on Seer can go through a where you can submit images to help verify the legitimacy of a market. Each time a market enters the verification process, an LItem is created in the curate subgraph. Here, you can find information about the requester and links to market images.