원클릭으로
seer-sites
Build multi-page prediction market sites using the Seer protocol with @seer-pm/sdk, @seer-pm/react, and Stitch (stitch-loop).
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Build multi-page prediction market sites using the Seer protocol with @seer-pm/sdk, @seer-pm/react, and Stitch (stitch-loop).
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | seer-sites |
| description | Build multi-page prediction market sites using the Seer protocol with @seer-pm/sdk, @seer-pm/react, and Stitch (stitch-loop). |
This skill builds prediction market websites using the Seer protocol.
It is designed to work with Stitch, especially the stitch-loop skill, to generate complete multi-page apps that integrate with:
@seer-pm/sdk – low-level Seer contracts + HTTP API integration@seer-pm/react – React hooks and helpers for Seer UIsUse this skill when the goal is to:
Generic Stitch prompt: For building Seer sites with Google Stitch (or similar design tools), use skills/seer-sites/STITCH_PROMPT.md. It defines the fixed Seer data model (market/outcome fields, screens, redeem flow) and a Part 2 placeholder where the user specifies site name, identity, network, and aesthetic. Copy Part 1 as-is; fill Part 2 per project.
This skill does not define on-chain contracts or ABIs; instead, it relies on the Seer SDK as the single source of truth for integration details.
Use seer-sites when:
@seer-pm/sdk / @seer-pm/react.Do not use this skill when:
@seer-pm/sdk (core integration: contracts + HTTP API) and @seer-pm/react (hooks and React utilities). The project must use wagmi v2 and viem v2 (e.g. wagmi and viem at major version 2) and satisfy the peer dependencies of both packages: wagmi, @wagmi/core, viem, react; @seer-pm/react also needs @seer-pm/sdk, @tanstack/react-query; @seer-pm/sdk also needs graphql-request and graphql-tag for HTTP API usage.react-toastify wired through Seer notifier helpers – see skills/seer-sites/examples/toastify.tsx and ensure ToastContainer + import "react-toastify/dist/ReactToastify.css"; are added at app root.default and s-gCRC on Gnosis). Each site build may call configureCollateral("circles") (optional — defaults to "default"). The shared app backend indexes all registered collaterals; portfolio APIs take ?collateralProfile= (profile name, e.g. default or circles). See 9-collateral-profiles.md.vite.config.ts (add nodePolyfills() to the plugins array), and add a define block so Node-style globals and process.env are available for SDK/wagmi deps:
import { nodePolyfills } from 'vite-plugin-node-polyfills'
// In defineConfig:
plugins: [nodePolyfills(), /* ...existing plugins (e.g. react()) */],
define: {
'process.env': {},
'global': {},
},
Whenever possible, follow the patterns from the official Seer integration docs instead of inventing new flows or parameters.
For any Seer-related behavior, refer to the integration docs hosted in the seer-pm/demo repository:
| Goal | Document / API |
|---|---|
| Create a market | useCreateMarket from @seer-pm/react (pass txNotifier, isFutarchyMarket, onSuccess; mutation accepts CreateMarketProps) |
| Resolve a market | useResolveMarket from @seer-pm/react (pass txNotifier, optional onSuccess; mutation accepts ResolveMarketProps with market) |
| Split / merge / redeem positions | useSplitPosition, useMergePositions, and useRedeemPositions from @seer-pm/react |
| Trading via AMMs | useQuoteTrade and useTrade from @seer-pm/react |
| Block explorer / pool URLs | getBlockExplorerUrl, getTokenExplorerUrl, getLiquidityUrlByMarket, getPoolExplorerUrl from @seer-pm/sdk |
| Collateral profiles (multi-primary, white-label) | 9-collateral-profiles.md — getCollateralProfiles, configureCollateral, collateralProfile API param |
Treat these documents as the authoritative reference for:
useSplitPosition, useMergePositions, and useRedeemPositions.useQuoteTrade (quotes) and useTrade (execute) on AMMs (Swapr/Uniswap V3).A conditional market is a market that depends on a specific outcome of an existing parent market. The child question is only relevant if the parent resolves to that outcome (e.g. “Will X happen by 2026?” conditional on “Will X happen by 2025?” resolving to Yes).
Detecting and using parent data
market.parentMarket – Address of the parent market contract. If it is the zero address, the market is a root (non-conditional) market; otherwise it is a conditional (child) market.market.parentOutcome – Index of the parent outcome this market is conditional on (e.g. 0 = first outcome, often “Yes”). Only meaningful when parentMarket is not zero.Creating a conditional market
Use the same flow as for root markets (useCreateMarket and CreateMarketProps), but set parentMarket to the parent market address and parentOutcome to the chosen parent outcome index. Use the zero address for parentMarket when creating a root market.
Split, merge, and redeem on conditional markets
The same hooks apply (useSplitPosition, useMergePositions, useRedeemPositions), but the collateral token for a conditional market is not the chain’s base collateral (e.g. sDAI). It is the parent’s outcome token for the outcome the child is conditional on. That token is the one at index market.parentOutcome in the parent market’s outcome tokens (e.g. parentMarket.wrappedTokens[parentOutcome] or the equivalent from the SDK). So for a child market you pass that parent outcome token as the collateral when calling split/merge/redeem.
After resolution
Redeeming winning positions on a resolved conditional market returns parent outcome tokens, not base collateral. To show or offer “redeem to base collateral” in one step when the parent is a root and already resolved, the SDK or contracts may expose a helper (e.g. ConditionalRouter); otherwise the user redeems the child and then redeems the parent separately.
Nested conditionals
Markets can be conditional on other conditional markets. The rule is the same at each level: the “collateral” for a child is always the parent’s wrapped outcome token for the outcome the child depends on. If the parent resolves to a different outcome, that child branch has no redeemable value.
When generating sites or components, prioritize these high-level flows:
Markets list page
Market detail page
Create market flow
useCreateMarket from @seer-pm/react with a txNotifier; the mutation accepts full CreateMarketProps. The hook handles both regular markets and futarchy proposals via isFutarchyMarket.Resolve market flow
useResolveMarket from @seer-pm/react (pass txNotifier, optional onSuccess; mutation accepts { market }) for the resolver to submit the result.useRedeemPositions.Prefer composing screens from smaller components:
MarketsListMarketCardMarketDetailTradeFormCreateMarketFormResolveMarketFormThis skill includes example React components in skills/seer-sites/examples/ that demonstrate recommended integration patterns:
MarketsPage.tsx – high-level markets listing page.MarketDetailPage.tsx – single market detail page with an outcomes list and trade widget (SwapWidget).SwapWidget.tsx – full-featured trade widget wired to Seer AMMs and notifiers.OutcomesList.tsx – list outcomes on a market detail page: user balance per outcome, image and name, current odds, link to token contract in block explorer, and link to pool (or create pool).Use these examples as primary reference for:
@seer-pm/sdk and @seer-pm/react.When generating new components, align with these examples unless the user explicitly requests a different structure.
When using seer-sites:
Prefer SDK helpers over raw contract calls
@seer-pm/sdk / @seer-pm/react instead of manually encoding transactions whenever possible.Keep Seer-specific logic in dedicated hooks/utilities
useMarkets, useMarket, useTrade, useCreateMarket, useApproveTokens) and then consuming those hooks in UI components.Respect network & address configuration
Handle loading, error, and empty states
Security & UX
Avoid imaginary providers or APIs
SeerProvider – there is no provider exported from @seer-pm/react.WagmiConfig / Config from wagmi) and then call Seer hooks (useMarkets, useMarket, useCreateMarket, useTrade, useApproveTokens, etc.) directly inside components.@seer-pm/react exports and the examples in skills/seer-sites/examples/*.tsx; if it is not there, do not assume it exists.No mock data
useMarkets() from @seer-pm/react (or the equivalent hook that matches your filter, e.g. by creator). Pass the returned data to the UI.useMarket(marketId, chainId) from @seer-pm/react. Pass the returned market to the header, outcomes list, and trading widget.Collateral configuration (multi-primary)
configureCollateral("circles") (or another name) once at startup when the site is not on the default profile. Omit for standard sDAI sites (see integration doc 9-collateral-profiles).getActiveCollateralProfile(chainId) / getActivePrimaryCollateral(chainId).getActivePrimaryCollateral(market.chainId) / getActiveCollateralProfile(market.chainId) for secondary (xDAI).market.collateralToken === getActivePrimaryCollateral(chainId).address when appropriate.configureCollateral in shared backend code; one Netlify instance serves multiple frontends.With stitch-loop:
stitch-loop can generate page structure and navigation for a multi-page site.seer-sites should provide the Seer-specific integration details and examples so the generated pages correctly use @seer-pm/sdk and @seer-pm/react.With generic React skills (e.g., react-components):
seer-sites to decide how to wire Seer data and actions.Always keep Seer integration semantics (from the integration docs above) as the top priority when resolving conflicts between design-driven and protocol-driven requirements.