Documentation is in progress. Every page in this section describes the current implementation and may change as PolyLab evolves.
Reference

Public API Contract

In Progress Last updated 2026-03-10

Public reference for the endpoints the current PolyLab web app relies on.

Current Implementation

This page is intentionally explicit and implementation-first. If the product or upstream APIs change, the current behavior described here can change with them.

GET /api/homepage-bootstrap

Returns the precomputed homepage payload used for the marketing homepage first paint.

Important response fields include:

FieldMeaning
generated_atSnapshot generation timestamp
market_last_updatedLatest snapshot_at used when building the snapshot
smart_money_last_updatedLatest smart-money refresh timestamp available to the snapshot
cache_max_age_msSuggested client-side cache TTL for local bootstrap hydration
spotlight_marketsReady-to-render smart-money spotlight cards
playbook_previewsPer-playbook preview rows keyed by preset id

GET /api/app-bootstrap

Returns the precomputed first-paint payload for /app.

Query params:

ParamMeaning
viewscanner or smart
presetOptional preset id such as smart_money_edge

Important response fields include:

FieldMeaning
generated_atSnapshot generation timestamp
market_last_updatedLatest snapshot_at used when building the snapshot
smart_money_last_updatedLatest smart-money refresh timestamp available to the snapshot
viewResolved app view after preset application
active_preset_idResolved preset id, or null for default bootstraps
filtersResolved initial filter state for the first paint
marketsInitial market rows rendered before live revalidation
tagsInitial tag stats used by include/exclude autocomplete
cache_keyStorage key used by the frontend for bootstrap caching

GET /api/tags

Returns tag statistics used by the include/exclude tag UI.

FieldMeaning
tag_labelTag label
countNumber of occurrences in the current snapshot

GET /api/status

Returns the last known refresh timestamps used by the UI header.

FieldMeaning
last_updatedLatest snapshot_at in active_market_outcomes
smart_money_last_updatedLatest last_updated_at in market_smart_money_stats

GET /api/markets

Returns the main scanner rows and accepts the query parameters documented in Scanner Query and Filter Contract.

Important response fields include:

FieldMeaning
market_idMarket identifier
condition_idCondition identifier used for holders lookup
questionMarket question
outcome_nameRow outcome
priceStored outcome price
aprComputed APR
spreadStored spread
volume_usdStored volume
liquidity_usdStored liquidity
start_dateStart date
end_dateEnd date
categoryPrimary category from tags
icon_urlEvent image/icon
yes_profitable_countSampled profitable YES wallets
yes_losing_countSampled losing YES wallets
yes_totalTotal sampled YES holder rows
no_profitable_countSampled profitable NO wallets
no_losing_countSampled losing NO wallets
no_totalTotal sampled NO holder rows

GET /api/markets/{market_id}/holders

Returns holder rows for the condition represented by the selected market detail view.

FieldMeaning
wallet_addressNormalized holder wallet
position_sizeCurrent sampled position size
outcome_indexYES / NO side index
total_pnlJoined wallet PnL if available
aliasOptional wallet alias
wallet_tagOptional operational tag such as SYSTEM

Contract stability

The homepage and initial /app load are intentionally snapshot-backed for speed. Live /api/markets remains the source for interactive filtering, pagination, and silent revalidation after first paint.

This reference documents what the current public app uses today. It should be read as a current implementation contract, not a long-term versioned API promise.