Documentation for the serverless functions exposed by the app. Useful for integrations, frontend, and AI tools working with this codebase.
Base URL: https://app.seer.pm
Functions are available at: https://app.seer.pm/.netlify/functions/<function-name>
Fetches a single market by ID or URL/slug. Merges real-time subgraph data with cached database data (including verification status) for maximum accuracy.
https://app.seer.pm/.netlify/functions/get-market
Parameter
Type
Required
Description
Network ID (SupportedChain).
Market ID (0xβ¦). *Required if url is not provided.
Market slug/URL (e.g. human-readable name). *Required if id is not provided.
Serialized market object: all bigint fields are returned as string for JSON compatibility.
Copy type SerializedMarket = {
chainId : number ;
factory ?: ` 0x ${ string } ` ;
outcomesSupply : string ;
liquidityUSD : number ;
incentive : number ;
hasLiquidity : boolean ;
categories : string [] ;
poolBalance : ( {
token0 : { symbol : string ; balance : number };
token1 : { symbol : string ; balance : number };
} | null )[] ;
odds : ( number | null )[] ;
creator ?: string | null ;
blockTimestamp ?: number ;
verification ?: { status : " verified " | " verifying " | " challenged " | " not_verified " ; itemID ?: string ; deadline ?: number };
images ?: { market : string ; outcomes : string [] };
index ?: number ;
url : string ;
id : ` 0x ${ string } ` ;
type : " Generic " | " Futarchy " ;
marketName : string ;
outcomes : readonly string [] ;
collateralToken : ` 0x ${ string } ` ;
collateralToken1 : ` 0x ${ string } ` ;
collateralToken2 : ` 0x ${ string } ` ;
wrappedTokens : ` 0x ${ string } ` [] ;
parentMarket : {
id : ` 0x ${ string } ` ;
conditionId : ` 0x ${ string } ` ;
payoutReported : boolean ;
payoutNumerators : readonly string [] ;
};
parentOutcome : string ;
parentCollectionId : ` 0x ${ string } ` ;
conditionId : ` 0x ${ string } ` ;
questionId : ` 0x ${ string } ` ;
templateId : string ;
questions : Array <{
id : ` 0x ${ string } ` ;
arbitrator : ` 0x ${ string } ` ;
opening_ts : number ;
timeout : number ;
finalize_ts : number ;
is_pending_arbitration : boolean ;
best_answer : ` 0x ${ string } ` ;
bond : string ;
min_bond : string ;
base_question : ` 0x ${ string } ` ;
}>;
openingTs : number ;
finalizeTs : number ;
encodedQuestions : readonly string [] ;
lowerBound : string ;
upperBound : string ;
payoutReported : boolean ;
payoutNumerators : readonly string [] ;
}; 400 β Missing request body or Missing required parameters: chainId and (id or url).
404 β Market not found.
500 β Internal server error.
Search and list markets with filters, pagination, and sorting. Queries one or multiple chains; when VITE_TESTNET_WEBSITE=1 only Sepolia is used.
https://app.seer.pm/.netlify/functions/markets-search
Body (JSON) β Search parameters
All optional. Defaults in the handler: limit=1000, page=1, chains = all supported (or Sepolia only on testnet).
Chain IDs (e.g. ["100","1"]). Empty = all.
"Generic" | "Futarchy" | ""
Statuses (e.g. Active, Closed).
Include conditional markets.
Include markets with rewards.
Explicit list of market IDs.
Results per page (default 1000).
400 β Missing request body.
500 β Internal server error.
get-token-transactions
Returns top holders and recent transactions for one or more tokens (per chain).
https://app.seer.pm/.netlify/functions/get-token-transactions
Parameter
Required
Description
Comma-separated list of token addresses.
Chain ID. Must be in SUBGRAPHS.tokens.
recentTransactions items use the following type (value is serialized as string in JSON):
Header: Cache-Control: public, max-age=300 (5 minutes).
400 β Missing tokenIds or chainId, invalid chainId, or unsupported chain.
500 β Internal server error.
get-transactions
Transaction history for an account on a chain: swaps, liquidity (LP add/remove), and CTF events (split/merge/redeem).
https://app.seer.pm/.netlify/functions/get-transactions
Parameter
Required
Description
Unix timestamp start (number).
Unix timestamp end (number).
swap | lp | ctf. If omitted, all event types are returned.
Array of TransactionData, sorted by blockNumber descending:
400 β Missing account or chainId, invalid eventType, or non-numeric startTime/endTime.
500 β Internal server error.
Positions for an account on a chain: outcome token balances per market, with market data, outcome, collateral, and redeemed prices.
https://app.seer.pm/.netlify/functions/get-portfolio
Parameter
Required
Description
Array of PortfolioPosition:
Only positions with balance > 0 are included; for closed markets, only those that qualify as winning per payout.
400 β Missing account or chainId, or non-numeric chainId.
500 β Internal server error.
Returns chart data (hourly price/volume) for markets. If IDs are provided, only those markets; if omitted, all cached chart data.
https://app.seer.pm/.netlify/functions/markets-charts
Parameter
Required
Description
Comma-separated list of market IDs (Address). If omitted, all cached charts are returned. IDs are validated with isAddress.
Object keyed by marketId with each marketβs chart data (array of series):
400 β ids was provided but no valid address: No valid market IDs provided.
500 β Supabase or internal error.
Quick reference for AIs
Function
Method
Key params
Typical use
Single market page or API
Body with filters and page/limit
Listings, search, filters
Token holders and activity
account, chainId, opt. eventType, startTime, endTime
Wallet transaction history
Wallet positions/portfolio
Price/volume charts per market
All responses are JSON. Errors return { "error": "message" } with the appropriate HTTP status code.