Skip to main content

Overview

Kuest provides a comprehensive market creation workflow in the admin panel that guides you through creating prediction markets with AI-powered validation and on-chain deployment.

Creating Markets

Access the Market Creator

Navigate to the admin panel and access the market creation interface:
/admin/create-event
Only authorized wallet addresses configured in ADMIN_WALLETS can access the market creation panel.

Market Creation Workflow

The creation process consists of 5 steps:
1

Event Configuration

Configure the basic event details:Required Fields:
  • Event Title: Clear, descriptive market question
  • Event Slug: URL-friendly identifier (auto-generated from title)
  • End Date: When the market closes for trading
  • Event Image: Visual representation (PNG, JPG, WebP, or SVG)
  • Main Category: Primary classification (e.g., Politics, Sports, Crypto)
  • Sub Categories: At least 4 tags for better discoverability
// Example from source code
{
  title: "Will Bitcoin reach $100k by end of 2025?",
  slug: "btc-100k-2025-abc",
  endDateIso: "2025-12-31T23:59:59Z",
  mainCategorySlug: "crypto",
  categories: [
    { label: "Bitcoin", slug: "bitcoin" },
    { label: "Price Prediction", slug: "price-prediction" },
    { label: "2025", slug: "2025" },
    { label: "Cryptocurrency", slug: "cryptocurrency" }
  ]
}
The slug is automatically enhanced with a creator identifier (last 3 characters of your wallet address) to ensure uniqueness.
2

Market Structure

Choose your market type:

Binary Markets

Simple Yes/No questions with two outcomes.Configuration:
  • Market question
  • Outcome labels (default: “Yes” / “No”)
  • Single market per event
// Binary market example
{
  marketMode: "binary",
  binaryQuestion: "Will Bitcoin reach $100k by end of 2025?",
  binaryOutcomeYes: "Yes",
  binaryOutcomeNo: "No"
}

Multi-Market Events

Multi-Multiple: Users can bet on multiple options (e.g., “Which teams will reach the finals?”)Multi-Unique: Users bet on a single winner (e.g., “Who will win the 2028 election?”)Each option requires:
  • Question: Specific prediction for this option
  • Title: Full descriptive name
  • Short Name: Abbreviated display name
  • Slug: URL identifier
  • Outcome labels (Yes/No by default)
  • Optional image
// Multi-unique market example
{
  marketMode: "multi_unique",
  options: [
    {
      id: "opt-1",
      question: "Will Candidate A win?",
      title: "Candidate A for President",
      shortName: "Candidate A",
      slug: "candidate-a",
      outcomeYes: "Wins",
      outcomeNo: "Loses"
    },
    {
      id: "opt-2",
      question: "Will Candidate B win?",
      title: "Candidate B for President",
      shortName: "Candidate B",
      slug: "candidate-b",
      outcomeYes: "Wins",
      outcomeNo: "Loses"
    }
  ]
}
3

Resolution Configuration

Define how the market will be resolved:Resolution Source (Optional)
  • URL to authoritative source for outcome verification
  • Must be a valid URL format
  • Example: https://www.coinmarketcap.com/currencies/bitcoin/
Resolution Rules (Required)
  • Clear, deterministic criteria for resolution
  • Minimum 60 characters
  • Should leave no room for ambiguity

AI-Powered Rules Generation

Click “Generate with AI” to automatically create resolution rules based on your market configuration.
// The system uses OpenRouter API to generate rules
// Example generated rules:

"This market will resolve to 'Yes' if Bitcoin (BTC) reaches or exceeds 
a price of $100,000 USD on any major cryptocurrency exchange (Coinbase, 
Binance, Kraken) at any point before December 31, 2025, 23:59:59 UTC. 
The market will resolve to 'No' if this condition is not met by the 
end date. Price data will be verified using CoinMarketCap historical 
data. In case of exchange discrepancies, the median price across the 
three exchanges will be used."
Rules generation requires OpenRouter API configuration in admin settings.
4

Pre-Sign Validation

Before deploying to the blockchain, the system runs comprehensive checks:

Funding Checks

USDC Balance Check
  • Verifies your wallet has sufficient USDC for the reward pool
  • Default requirement: 5 USDC per market
  • Configured via market context settings
// Source: AdminCreateEventForm.tsx
const requiredTotalRewardUsdc = requiredRewardUsdc * marketCount
// This reward pays the UMA proposer who resolves correctly
POL Gas Check
  • Ensures sufficient POL for transaction fees
  • Estimated gas: ~700,000 units for initialization
  • Uses Polygon mainnet or Amoy testnet

Authorization Checks

Allowed Creator Check
  • Confirms your wallet is in the allowed creator list
  • Configured in General Settings → Market Creators
Slug Uniqueness
  • Verifies the event slug doesn’t exist in the database
  • Prevents duplicate market creation

Content Validation

OpenRouter Status
  • Confirms API key is configured and active
AI Content Checker
  • Validates English language content
  • Checks deterministic resolution rules
  • Verifies all mandatory fields are complete
  • Confirms date coherence
  • Validates resolution source format
  • Checks market structure consistency
// Content check phases
const CONTENT_CHECK_PROGRESS = [
  'checking content language...',
  'checking deterministic rules...',
  'checking mandatory fields...',
  'checking event date coherence...',
  'checking resolution source format...',
  'checking market structure consistency...',
  'checking outcomes consistency...',
  'checking final consistency...'
]
Issues can be bypassed individually if needed, but this is not recommended for production markets.
5

Sign & Deploy

Final step: Sign transactions and deploy to blockchain.

Deployment Process

1

EIP-712 Signature

Sign the market creation authorization message:
// The system creates a typed data signature
const domain = {
  name: "Kuest Market Creator",
  version: "1",
  verifyingContract: "0x..."
}

const types = {
  CreateMarketAuth: [
    { name: "creator", type: "address" },
    { name: "chainId", type: "uint256" },
    { name: "payloadHash", type: "bytes32" },
    { name: "nonce", type: "string" },
    { name: "expiresAt", type: "uint256" }
  ]
}
This signature is valid for a limited time (typically 15 minutes).
2

Transaction Execution

The system prepares and executes multiple transactions:
  1. USDC Approval: Approve reward amount for the adapter contract
  2. Market Initialization: Deploy the market on-chain
Each transaction is signed in your wallet and confirmed on the blockchain.
// Gas estimation with 30% buffer
const gasEstimate = INITIALIZE_GAS_UNITS_ESTIMATE * 13n / 10n
3

Finalization

After all transactions confirm:
  • Request is marked as completed
  • Market data is synced to the database
  • Event becomes visible on the platform
You can view the event at: https://your-domain.com/event/{slug}

Transaction Monitoring

Each transaction shows:
  • Status indicator (pending/confirming/success/error)
  • Transaction description
  • Block explorer link (Polygon PolygonScan)
  • Market identifier
If a transaction fails, you can retry from where it left off. The system maintains the signature flow state.

Market Templates

Binary Yes/No Market

{
  "title": "Will ETH reach $5,000 by Q2 2025?",
  "mainCategory": "crypto",
  "categories": ["ethereum", "price-prediction", "2025", "defi"],
  "marketMode": "binary",
  "endDate": "2025-06-30T23:59:59Z",
  "resolutionRules": "Resolves YES if ETH reaches $5,000 on any major exchange by June 30, 2025..."
}

Multi-Outcome Election

{
  "title": "2028 US Presidential Election Winner",
  "mainCategory": "politics",
  "categories": ["election", "usa", "2028", "presidential"],
  "marketMode": "multi_unique",
  "endDate": "2028-11-07T23:59:59Z",
  "options": [
    {
      "title": "Democrat Nominee",
      "question": "Will the Democratic nominee win?",
      "shortName": "Democrat"
    },
    {
      "title": "Republican Nominee",
      "question": "Will the Republican nominee win?",
      "shortName": "Republican"
    },
    {
      "title": "Independent/Third Party",
      "question": "Will an independent or third-party candidate win?",
      "shortName": "Independent"
    }
  ]
}

Draft Persistence

The market creation form automatically saves your progress to browser localStorage:
// Storage key
const CREATE_EVENT_DRAFT_STORAGE_KEY = 'admin_create_event_draft_v1'

// Saved data includes:
// - All form fields
// - Current step and max visited step
// - Slug seed for uniqueness
// - Outcome editability flags
You can safely close the browser and resume later. Use the “Reset Form” button to start fresh.

Best Practices

Write Clear Questions

Use simple, unambiguous language. Avoid jargon unless targeting a specific audience.

Set Realistic End Dates

Ensure sufficient time for trading activity and for the outcome to be determinable.

Define Deterministic Rules

Resolution rules should be objective and verifiable from public sources.

Test on Amoy First

Use the Polygon Amoy testnet to practice market creation before deploying to mainnet.

Troubleshooting

Slug Already Exists

Solution: Click the “Regenerate Slug” button or manually edit the slug field. The system appends a timestamp-based seed for uniqueness.

Insufficient USDC Balance

Solution: Bridge USDC to Polygon using the built-in swap interface or an external bridge like LI.FI.

AI Content Check Fails

Solution:
  1. Review the specific errors listed
  2. Edit your market content to address the issues
  3. Re-run the check
  4. If necessary, bypass individual checks (not recommended for production)

Transaction Fails

Solution:
  1. Check that you have sufficient POL for gas
  2. Verify the transaction on PolygonScan for specific error messages
  3. If using a custom wallet, ensure it properly handles EIP-712 signatures
  4. Try increasing gas settings in your wallet

Market Resolution

Learn how markets are resolved using UMA protocol

Admin Panel

Explore all admin panel features

API Reference

Programmatic market creation API

Monitoring

Track market creation success and errors

Build docs developers (and LLMs) love