The first decentralized solution for extracting human-readable Polymarket market names directly from blockchain data.
Before: Developers had to rely on Polymarket's API to get human-readable market names
// Raw subgraph data
{
"conditionId": "0xe5107ae8640f781ba136c89c5be7934dbc5dd67ce10b95e10e8fa7e085cd7344",
"question": "???" // No human-readable name!
}After: Get clean, human-readable names directly from blockchain data
// With Polymarket Names Subgraph
{
"questionID": "0xe5107ae8640f781ba136c89c5be7934dbc5dd67ce10b95e10e8fa7e085cd7344",
"question": "LEC Finals: G2 vs. Movistar KOI - G2 and Movistar KOI are scheduled to play..."
}{
# Get recent markets with clean, readable names
markets(first: 5, orderBy: timestamp, orderDirection: desc) {
questionID
question # π― Human-readable market name!
creator
reward
timestamp
}
}Sample Response:
{
"data": {
"markets": [
{
"questionID": "0xe5107ae8...",
"question": "Bitcoin Up or Down β May 28 (9 AM ET Candle)",
"creator": "0x91430cad...",
"reward": "5000000",
"timestamp": "1749328016"
}
]
}
}This subgraph indexes UMA CTF Adapter contracts on Polygon to extract human-readable questions from ancillary data:
- Listens for
QuestionInitializedevents from UMA CTF Adapter contracts - Extracts ancillary data containing human-readable market questions
- Parses the data to extract clean, dashboard-ready titles
- Stores the mapping between questionID and human-readable names
- Current UMA CTF Adapter V2:
0x6A9D222616C90FcA5754cd1333cFD9b7fb6a4F74 - Legacy UMA CTF Adapter:
0x71392E133063CC0D16F40E1F9B60227404Bc03f7 - Binary Adapter:
0xCB1822859cEF82Cd2Eb4E6276C7916e692995130
type Market @entity {
id: ID!
questionID: Bytes! # Links to other Polymarket subgraphs
creator: Bytes # Market creator address
question: String # π― Human-readable market name
reward: BigInt # Market reward/incentive
timestamp: BigInt # Creation timestamp
# ... additional metadata
}{
# Get all markets with readable names
markets(first: 10, orderBy: timestamp, orderDirection: desc) {
questionID
question
creator
timestamp
}
}{
# Crypto markets
cryptoMarkets: markets(where: { question_contains_nocase: "bitcoin" }) {
questionID
question
reward
}
# Sports markets
sportsMarkets: markets(where: { question_contains: "vs." }) {
questionID
question
timestamp
}
# Political markets
politicalMarkets: markets(where: { question_contains_nocase: "trump" }) {
questionID
question
creator
}
}{
# High-reward markets (> $5 USDC)
premiumMarkets: markets(where: { reward_gte: "5000000" }) {
question
reward
creator
}
# Recent high-activity markets
recentMarkets: markets(
where: { timestamp_gte: "1749240000" }
orderBy: reward
orderDirection: desc
first: 20
) {
question
reward
timestamp
}
}{
# Perfect for dashboard cards
dashboardData: markets(
first: 12
orderBy: timestamp
orderDirection: desc
where: { reward_gte: "1000000" }
) {
questionID # For linking to other subgraphs
question # Clean title for UI
creator # Market creator
reward # Incentive amount
timestamp # Creation time
}
}This subgraph is the missing piece that makes all other Polymarket subgraphs truly useful:
// Step 1: Get trading data from main Polymarket subgraph
const tradingData = await queryMainSubgraph(`{
fixedProductMarketMakers(first: 10) {
conditions # Contains questionID
scaledCollateralVolume
outcomeTokenPrices
}
}`);
// Step 2: Get human names from THIS subgraph
const marketNames = await queryNamesSubgraph(`{
markets(where: { questionID_in: ["0x..."] }) {
questionID
question # Clean human-readable name!
}
}`);
// Step 3: Perfect dashboard data!
const enrichedData = tradingData.map(market => ({
...market,
humanName: marketNames.find(m => m.questionID === market.conditions[0])?.question,
volume: formatCurrency(market.scaledCollateralVolume)
}));- Network: Polygon
- Subgraph ID:
QmP6hMoYTYx4dFGs2dYiNnUDsRZ4ybhH9N6C6G19tHQxku - GraphQL Endpoint:
https://api.thegraph.com/subgraphs/id/QmP6hMoYTYx4dFGs2dYiNnUDsRZ4ybhH9N6C6G19tHQxku - Explorer: View in The Graph Explorer
How to get API key with The Graph Here
We welcome contributions! Please feel free to:
- Submit bug reports and feature requests
- Improve documentation
- Add new query examples
- Optimize parsing logic
This project is licensed under the MIT License - see the LICENSE file for details.
- UMA Protocol - For the Optimistic Oracle infrastructure
- The Graph - For the decentralized indexing protocol
- Polymarket - For the prediction market platform
- Gnosis - For the Conditional Tokens Framework
- Main Polymarket Subgraph Analytics - Comprehensive query examples
- UMA CTF Adapter - Resolution infrastructure
- Conditional Tokens - Market framework
Built with β€οΈ for the decentralized prediction market ecosystem
