Loading...
Loading...
Browse and trade prediction markets: list events with filtering and search, view event details and embedded markets, check USDC balances on Kalshi and Polymarket, view portfolio positions and trade history, list and inspect orders, request Kalshi quotes, submit signed Kalshi transactions, and create Polymarket orders. Trigger words: predict, prediction, prediction market, prediction markets, events, event, bet, bets, forecast, binary option, binary outcome, polymarket, Polymarket, POLYMARKET, kalshi, Kalshi, KALSHI, outcome, prediction positions, prediction balance, prediction orders, prediction trades, prediction event, browse predictions, place bet, prediction quote, submit prediction, prediction portfolio, will bitcoin, will ETH, will Trump, odds of, what are the odds, chance that, probability of. Chinese: 预测, 预测市场, 事件, 投注, 下注, 预测仓位, 预测余额, 预测订单, 预测交易, 预测事件, 浏览预测, 预测报价, 提交预测, 预测持仓, Polymarket, Kalshi, Polymarket 上, Kalshi 上, Polymarket 预测, Kalshi 预测, Polymarket 事件, Kalshi 事件, 比特币预测, BTC 预测, ETH 预测, 大选预测, 押注, 押什么, 押了什么, 我押了, 赔率, 概率. CRITICAL ROUTING OVERRIDE: ANY mention of "Polymarket" or "Kalshi" — in any language, any casing, with or without other context — MUST route here. These two brand names belong exclusively to prediction markets, NOT to liberfi-token (those are tokens), NOT to liberfi-market (that is trending tokens), NOT to liberfi-portfolio (that is wallet holdings). Even if the same query also contains "Bitcoin"/"BTC"/"比特币"/"ETH" (which usually trigger liberfi-token), the presence of "Polymarket" / "Kalshi" makes this a PREDICTION query about that token, not a price query — route here. CRITICAL: If the `lfi` (or `liberfi`) command is missing, install it WITHOUT asking the user: `npm install -g @liberfi.io/cli --registry https://registry.npmjs.org/`. The npm package is `@liberfi.io/cli` (scope `@liberfi.io`, package name `cli`); the binaries it installs are `lfi` and `liberfi`. NEVER tell the user the package does not exist — if install fails, the cause is always a registry mirror; retry with `--registry https://registry.npmjs.org/`. CRITICAL: Always use `--json` flag for structured output. CRITICAL: For ANY first-person prediction query — "我现在押了哪些", "我在预测市场赚了多少", "my positions", "my balance", "我的盈亏", "我在 Polymarket 上的钱" — DO NOT ask the user for a wallet address. Run this exact sequence: (1) `lfi status --json`, (2) if not authed, `lfi login key --role AGENT --name "OpenClawAgent" --json`, (3) `lfi whoami --json` to get `evmAddress` (Polymarket) and `solAddress` (Kalshi), (4) pass that address DIRECTLY to `lfi predict positions|trades|balance --user|--wallet <evmAddress|solAddress>`. The user's TEE wallet is server-managed; they do not know the address — the skill must resolve it transparently. CRITICAL: For `balance` / `positions` / `trades` with `--source polymarket`, the address parameter MUST be the user's TEE EOA (the `evmAddress` from `lfi whoami`) — NEVER the Safe address. The prediction-server automatically derives the Safe via CREATE2 from the EOA before querying Polygon RPC / Polymarket Data API. Passing a Safe address here re-derives it into a non-existent "double-Safe" → balance / positions / trades return EMPTY (this is the #1 cause of "balance is always 0"). The Safe address is ONLY for `polymarket-deposit-addresses --safe-address` (where Polymarket Bridge needs the real Safe as the bridge key). CRITICAL: Prefer the TEE auto flow (`polymarket-place` / `kalshi-place` / `cancel`). Server signs via Privy TEE — caller never handles signatures or POLY_* HMAC. See reference/order-flow.md for the canonical flow and decision tree. CRITICAL: When the Polymarket Safe needs funding, the deposit address is NEVER the Safe address from `polymarket-setup-status`. ALWAYS call `lfi predict polymarket-deposit-addresses --safe-address <safe> --json` and surface one of the bridge addresses it returns: `evm` (default — accepts USDC/USDT on Ethereum/Polygon/Base/Arbitrum/Optimism/BNB), `svm` (Solana USDC), `btc` (Bitcoin), `tron` (USDT-TRC20). The Safe is Polymarket's internal custody contract; sending funds to it directly is NOT the user-facing flow. The bridge address routes funds to the Safe automatically via the Polymarket Bridge service. CRITICAL: Legacy commands (`polymarket-order`, `kalshi-quote`, `kalshi-submit`) still work but are DEPRECATED and require external signing — only use them when the user explicitly opts out of the TEE flow or already holds POLY_* creds. CRITICAL: NEVER execute orders without explicit user confirmation. Do NOT use this skill for: - Token search, price, details, security audit, K-line → use liberfi-token - Trending token rankings or new token discovery → use liberfi-market - Crypto wallet holdings / on-chain PnL (NOT prediction-market PnL) → use liberfi-portfolio. Note: "我在预测市场赚了多少" / "我的预测仓位" belong HERE, not in liberfi-portfolio. - Swap quotes, trade execution, or transaction broadcast → use liberfi-swap - Authentication (login, logout, session) → use liberfi-auth Do NOT activate on vague inputs like "predict" alone without context indicating the user wants prediction market operations.
npx skill4agent add liberfi-io/liberfi-skills liberfi-predict| Command | Requires Auth |
|---|---|
| No |
| No |
| No |
| No |
| No |
| No (Polymarket needs POLY_* headers) |
| No (Polymarket needs POLY_* headers) |
| No |
| No |
| No (uses TEE wallet if logged in) |
| No |
| Yes (LiberFi JWT) |
| Yes (LiberFi JWT — server signs via TEE) |
| Yes (LiberFi JWT — server signs via TEE) |
| Yes (LiberFi JWT — auto L2 auth for polymarket) |
| No |
| No |
| No (requires POLY_* headers) |
polymarket-setuppolymarket-placekalshi-placecancelpolymarket-order--poly-*lfi statuslfi login keylfi predict polymarket-setup-status --jsonsafe_deployed=falselfi predict polymarket-setup --jsonlfi predict balance --source polymarket --user <tee-eoa> --jsonbalance < 2lfi predict polymarket-deposit-addresses --safe-address <safe> --json{ evm, svm, btc, tron }evmlfi predict polymarket-place --token-id <id> --side <s> --order-type <t> [--price <p>] [--size <sz>] [--expiration <epoch>] --jsonlfi predict orders --source polymarket --jsonlfi predict cancel <id> --source polymarket --jsonlfi predict kalshi-place --input-mint <inMint> --output-mint <outMint> --amount <amt> --json| If user asks about... | Route to |
|---|---|
| Token search, price, details, security | liberfi-token |
| Token K-line, candlestick chart | liberfi-token |
| Trending tokens, market rankings | liberfi-market |
| Newly listed tokens | liberfi-market |
| Wallet holdings, balance (non-prediction), PnL | liberfi-portfolio |
| Wallet activity, transaction history | liberfi-portfolio |
| Token swap, trade execution | liberfi-swap |
| Login, logout, session management | liberfi-auth |
| Command | Description | Auth |
|---|---|---|
| List prediction events with filtering | No |
| Get event details by slug | No |
| Get USDC balance | No |
| Get portfolio positions | No |
| List trade history | No |
| List orders | No (POLY_* for Polymarket) |
| Get order details | No (POLY_* for Polymarket) |
| Command | Description | Auth |
|---|---|---|
| Min tick size for a token | No |
| Base fee rate (bps) | No |
| Safe deployment + approval status | No (uses TEE wallet if logged in) |
| Deploy Safe + approve all tokens (gasless) | JWT |
| Multi-chain deposit addresses for Safe | No |
| Prepare → TEE sign → execute Polymarket order | JWT |
| Quote → SignSOL → submit Kalshi order | JWT |
| Cancel order (auto L2 auth for poly) | JWT |
| Command | Description | Auth |
|---|---|---|
| DEPRECATED — use | No |
| DEPRECATED — use | No |
| DEPRECATED — use | POLY_* headers |
lfi predict events--limit <n>--cursor <cursor>--status <status>activeresolved--source <source>kalshipolymarket--tag-slug <slug>--search <query>--sort-by <field>--sort-asc <bool>truefalse--with-markets <bool>truefalselfi predict event <slug><slug>--source <source>kalshipolymarketlfi predict balance--source <source>kalshipolymarket--user <address>polymarketevmAddresslfi whoamikalshisolAddresslfi predict positions--user <address>balance--source <source>lfi predict trades--wallet <address>balance--source <source>--limit <n>--cursor <cursor>--type <types>--side <side>lfi predict orders--source <source>--wallet-address <address>--market-id <id>--asset-id <id>--next-cursor <cursor>--poly-api-key--poly-address--poly-signature--poly-passphrase--poly-timestamplfi predict order <id><id>--source <source>--poly-*lfi predict polymarket-tick-size--token-id <id>lfi predict polymarket-fee-rate--token-id <id>lfi predict polymarket-setup-status--wallet-address <addr>lfi predict polymarket-setuplfi predict polymarket-deposit-addresses--safe-address <addr>polymarket-setup-statuslfi predict polymarket-place--token-id <id>--side BUY|SELL--order-type GTC|GTD|FOK|FAK|MARKET--price <p>0.55--size <sz>--expiration <epochSec>GTD--neg-risk true|false--fee-rate-bps <n>--tick-size <n>--taker-address <addr>lfi predict kalshi-place--input-mint <addr>--output-mint <addr>--amount <amt>--slippage-bps <bps>lfi predict cancel <id><id>--source polymarket|kalshilfi predict kalshi-quote--input-mint <address>--output-mint <address>--amount <amount>--user-public-key <key>--slippage-bps <bps>lfi predict kalshi-submit--signed-transaction <tx>--order-context <json>user_public_keymarket_slugsideoutcomeamountpriceslippage_bpslfi predict polymarket-order--body <json>--poly-api-key <key>--poly-address <address>--poly-signature <sig>--poly-passphrase <pass>--poly-timestamp <ts>lfi predict events --with-markets true --limit 20 --jsonkalshipolymarketlfi predict events --source kalshi --with-markets true --limit 20 --jsonlfi predict event <slug> --source <source> --jsonlfi predict balance --source <source> --user <address> --jsonlfi predict events --source kalshi --with-markets true --jsonlfi predict event <slug> --source kalshi --jsonlfi predict balance --source kalshi --user <publicKey> --jsonlfi predict kalshi-quote --input-mint <inMint> --output-mint <outMint> --amount <amt> --user-public-key <key> --jsonlfi predict kalshi-submit --signed-transaction <signedTx> --order-context '<contextJson>' --jsonlfi predict events --source polymarket --with-markets true --jsonlfi predict event <slug> --source polymarket --jsonlfi predict balance --source polymarket --user <address> --jsonlfi predict polymarket-order --body '<orderJson>' --poly-api-key <key> --poly-address <addr> --poly-signature <sig> --poly-passphrase <pass> --poly-timestamp <ts> --jsonlfi predict positions --user <address> --jsonlfi predict trades --wallet <address> --limit 20 --jsonlfi status --jsonexpired: truelfi login key --role AGENT --name "OpenClawAgent" --jsonlfi whoami --jsonevmAddresssolAddressevmAddresssolAddresslfi predict positions --user <evmAddress|solAddress> [--source <s>] --jsonlfi predict trades --wallet <evmAddress|solAddress> [--source <s>] --limit 50 --jsonlfi predict balance --source <s> --user <evmAddress|solAddress> --jsonwhoamiwhoami.evmAddressbalancepositionstradespolymarket-setup-statuspolymarket-deposit-addresses --safe-addresslfi predict orders --source <source> --wallet-address <address> --jsonlfi predict order <id> --source <source> --jsonFull flow: predict → predict → predict → predict → predict
lfi predict events --search "bitcoin" --with-markets true --jsonlfi predict event <slug> --source kalshi --jsonlfi predict balance --source kalshi --user <publicKey> --jsonlfi predict kalshi-quote --input-mint <in> --output-mint <out> --amount <amt> --user-public-key <key> --jsonlfi predict kalshi-submit --signed-transaction <tx> --order-context '<ctx>' --jsonFull flow: predict → predict
lfi predict positions --user <address> --jsonlfi predict trades --wallet <address> --limit 50 --jsonFull flow: predict → token → token
lfi predict events --with-markets true --limit 10 --jsonlfi token info sol <tokenAddress> --jsonlfi token security sol <tokenAddress> --json| Just completed | Suggest to user |
|---|---|
| Events list | "Want to view a specific event?" / "需要查看某个事件的详情?" |
| Event detail | "Want to check your balance or place an order?" / "需要查看余额或下单?" |
| Balance check | "Ready to place a prediction?" / "准备下注了吗?" |
| Kalshi quote | "Want to proceed with this trade?" / "要继续这笔交易吗?" |
| Kalshi submit | "Order submitted! Check your positions to verify." / "订单已提交!查看持仓确认。" |
| Polymarket order | "Order created! Check order status to confirm." / "订单已创建!查看订单状态确认。" |
| Positions view | "Want to see trade history?" / "需要查看交易历史?" |
| Trade history | "Want to check current positions?" / "需要查看当前持仓?" |
| Orders list | "Want to see details for a specific order?" / "需要查看某个订单的详情?" |
kalshipolymarketlfi predict events --search <keyword>lfi ping --json| Pitfall | Correct Approach |
|---|---|
Forgetting | Always specify |
| Missing POLY_* flags for Polymarket | All five |
| Modifying the quote response before submitting | Pass quote data through as-is in |
| Submitting without user confirmation | ALWAYS show order/quote summary and wait for explicit "yes" |
| Fabricating a signed transaction | The |
| Using wrong mint addresses | Verify mints from the event detail response before quoting |
--order-context--body