一键导入
context-build-market-widget
Build an embeddable single-market prediction widget with buy/sell buttons
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build an embeddable single-market prediction widget with buy/sell buttons
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create, cancel, or manage multiple orders in a single batch
Place and manage prediction market orders on Context Markets
Build a portfolio dashboard showing positions, P&L, balances, and claimable winnings
Build prediction market frontends with the Context React SDK
Scaffold a full prediction market trading UI with market list, orders, and portfolio
Find interesting prediction markets by volume, trend, liquidity, or topic
| name | context-build-market-widget |
| description | Build an embeddable single-market prediction widget with buy/sell buttons |
Build a self-contained, embeddable component that shows a single market with price, oracle context, and one-click trading.
The user wants to embed a prediction market into an existing page — a compact component showing price, oracle context, and a buy button.
Self-contained provider wrapper — if embedding outside a Context app, the widget needs its own provider stack:
function MarketWidget({ marketId, apiKey }: { marketId: string; apiKey: string }) {
return (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<ContextProvider apiKey={apiKey}>
<WidgetContent marketId={marketId} />
</ContextProvider>
</QueryClientProvider>
</WagmiProvider>
)
}
Market display — useMarket(marketId) for question text, useQuotes(marketId) for current prices.
Oracle badge — use useOracle(marketId) for the oracle summary and useLatestOracleQuote(marketId) if you want a numeric oracle quote alongside the market price.
Trade preview — useSimulateTrade(marketId, params) to show estimated fill as the user adjusts the amount slider.
One-click trade — useCreateMarketOrder() for instant execution at market price. Show the simulation result before confirming.
Balance display — useBalance() to show available funds. Disable buy button if insufficient.
ContextProvider is always required.apiKey in ContextProvider is sent to the browser. Use a read-only key if the widget is public.useAccount() from wagmi.useQuotes is enough for display. Only fetch useOrderbook if showing depth.isLoading and error — show appropriate UI for each.