GB-Power-Market-JJ liberfi-predict
install
source · Clone the upstream repo
git clone https://github.com/GeorgeDoors888/GB-Power-Market-JJ
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/GeorgeDoors888/GB-Power-Market-JJ "$T" && mkdir -p ~/.claude/skills && cp -r "$T/openclaw-skills/skills/bombmod/liberfi-predict" ~/.claude/skills/georgedoors888-gb-power-market-jj-liberfi-predict && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/GeorgeDoors888/GB-Power-Market-JJ "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/openclaw-skills/skills/bombmod/liberfi-predict" ~/.openclaw/skills/georgedoors888-gb-power-market-jj-liberfi-predict && rm -rf "$T"
manifest:
openclaw-skills/skills/bombmod/liberfi-predict/SKILL.mdsource content
LiberFi Prediction Market
Browse prediction market events, manage positions, and place orders on Kalshi and Polymarket using the LiberFi CLI.
Pre-flight Checks
See bootstrap.md for CLI installation and connectivity verification.
This skill's auth requirements:
| Command | Requires Auth |
|---|---|
| No |
| No |
| No |
| No |
| No |
| No (Polymarket needs POLY_* headers) |
| No (Polymarket needs POLY_* headers) |
| No |
| No |
| No (requires POLY_* headers) |
Polymarket authentication: Polymarket order operations require CLOB HMAC authentication via five
--poly-* flags. These are NOT LiberFi JWT credentials — they are the user's own Polymarket CLOB API credentials.
Skill Routing
| 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 |
CLI Command Index
Query Commands (read-only)
| 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) |
Mutating Commands
| Command | Description | Auth |
|---|---|---|
| Request Kalshi quote | No |
| Submit signed Kalshi transaction | No |
| Create Polymarket order | POLY_* headers |
Parameter Reference
Events list (
lfi predict events):
— Max results per page--limit <n>
— Pagination cursor--cursor <cursor>
— Event status filter (e.g.--status <status>
,active
)resolved
— Provider source:--source <source>
orkalshipolymarket
— Filter by tag--tag-slug <slug>
— Free-text search--search <query>
— Sort field--sort-by <field>
— Sort ascending:--sort-asc <bool>
ortruefalse
— Include embedded markets:--with-markets <bool>
ortruefalse
Event detail (
lfi predict event <slug>):
— Required. Event slug identifier<slug>
— Required. Provider source:--source <source>
orkalshipolymarket
Balance (
lfi predict balance):
— Required. Provider source:--source <source>
orkalshipolymarket
— Required. User wallet address--user <address>
Positions (
lfi predict positions):
— Required. User wallet address--user <address>
— Optional provider source filter--source <source>
Trades (
lfi predict trades):
— Required. Wallet address--wallet <address>
— Optional provider source filter--source <source>
— Max results per page--limit <n>
— Pagination cursor--cursor <cursor>
— Comma-separated trade types--type <types>
— Trade side filter--side <side>
Orders (
lfi predict orders):
— Provider source--source <source>
— Wallet address (required for kalshi)--wallet-address <address>
— Market ID filter--market-id <id>
— Asset ID filter--asset-id <id>
— Pagination cursor--next-cursor <cursor>
,--poly-api-key
,--poly-address
,--poly-signature
,--poly-passphrase
— Polymarket CLOB auth (required when source is polymarket)--poly-timestamp
Order detail (
lfi predict order <id>):
— Required. Order ID<id>
— Required. Provider source--source <source>- Same
flags as orders list--poly-*
Kalshi quote (
lfi predict kalshi-quote):
— Required. Input token mint address--input-mint <address>
— Required. Output token mint address--output-mint <address>
— Required. Swap amount--amount <amount>
— Required. User's Solana public key--user-public-key <key>
— Slippage tolerance in basis points--slippage-bps <bps>
Kalshi submit (
lfi predict kalshi-submit):
— Required. Signed transaction data--signed-transaction <tx>
— Required. Order context as JSON string (contains--order-context <json>
,user_public_key
,market_slug
,side
, mints,outcome
,amount
,price
)slippage_bps
Polymarket order (
lfi predict polymarket-order):
— Required. Raw order JSON string--body <json>
— Required. Polymarket API key--poly-api-key <key>
— Required. Polymarket address--poly-address <address>
— Required. Polymarket HMAC signature--poly-signature <sig>
— Required. Polymarket passphrase--poly-passphrase <pass>
— Required. Polymarket timestamp--poly-timestamp <ts>
Operation Flow
Browse Prediction Events
- Fetch events:
lfi predict events --with-markets true --limit 20 --json - Present results: Show event title, status, number of markets, volume
- Suggest next step: "Want to see details for a specific event?" / "需要查看某个事件的详情?"
Browse Events by Source
- Determine source: Ask user for
orkalshipolymarket - Fetch:
lfi predict events --source kalshi --with-markets true --limit 20 --json - Present: Events filtered by provider
- Suggest next step: "Pick an event to view its markets and outcomes"
View Event Details
- Determine slug: From user selection or input
- Fetch event:
lfi predict event <slug> --source <source> --json - Present: Event title, description, status, resolution sources, markets with outcomes and prices
- Suggest next step: "Want to check your balance or place an order?"
Check USDC Balance
- Collect inputs: Source (kalshi/polymarket) and wallet address
- Fetch:
lfi predict balance --source <source> --user <address> --json - Present: Available USDC balance
- Suggest next step: "Ready to place a prediction?" / "准备下注了吗?"
Kalshi Order Flow (Quote → Sign → Submit)
- Browse events:
lfi predict events --source kalshi --with-markets true --json - View event:
— identify market, outcomes, and mintslfi predict event <slug> --source kalshi --json - Check balance:
lfi predict balance --source kalshi --user <publicKey> --json - Get quote:
lfi predict kalshi-quote --input-mint <inMint> --output-mint <outMint> --amount <amt> --user-public-key <key> --json - Present quote: Show expected output amount, price, slippage
- (mandatory) Wait for explicit user confirmation
- User signs the transaction (externally, e.g. via wallet)
- Submit:
lfi predict kalshi-submit --signed-transaction <signedTx> --order-context '<contextJson>' --json - Present result: Show signature, status
Polymarket Order Flow
- Browse events:
lfi predict events --source polymarket --with-markets true --json - View event:
lfi predict event <slug> --source polymarket --json - Check balance:
lfi predict balance --source polymarket --user <address> --json - Prepare order body: Construct the Polymarket order JSON
- (mandatory) Show order summary and wait for explicit user confirmation
- Create order:
lfi predict polymarket-order --body '<orderJson>' --poly-api-key <key> --poly-address <addr> --poly-signature <sig> --poly-passphrase <pass> --poly-timestamp <ts> --json - Present result: Show order response
View Positions
- Determine user: Get wallet address from user
- Fetch:
lfi predict positions --user <address> --json - Present: Show event/market, outcome, size, entry price, current value
- Suggest next step: "Want to see your trade history?" / "需要查看交易历史?"
View Trade History
- Determine wallet: Get wallet address from user
- Fetch:
lfi predict trades --wallet <address> --limit 20 --json - Present: Show trade timestamp, event/market, side, price, size
- Suggest next step: "Want to check your current positions?" / "需要查看当前持仓?"
Check Order Status
- List orders:
lfi predict orders --source <source> --wallet-address <address> --json - Or get specific order:
lfi predict order <id> --source <source> --json - Present: Show order status, side, price, filled amount
Cross-Skill Workflows
"Research an event and place a bet"
Full flow: predict → predict → predict → predict → predict
- predict →
lfi predict events --search "bitcoin" --with-markets true --json - predict →
— view markets and outcomeslfi predict event <slug> --source kalshi --json - predict →
— check fundslfi predict balance --source kalshi --user <publicKey> --json - predict →
— get quotelfi predict kalshi-quote --input-mint <in> --output-mint <out> --amount <amt> --user-public-key <key> --json - Present quote, wait for confirmation, user signs transaction
- predict →
lfi predict kalshi-submit --signed-transaction <tx> --order-context '<ctx>' --json
"Check my prediction portfolio and trade history"
Full flow: predict → predict
- predict →
— current positionslfi predict positions --user <address> --json - predict →
— trade historylfi predict trades --wallet <address> --limit 50 --json - Present consolidated portfolio view
"Browse events, then research the underlying token"
Full flow: predict → token → token
- predict →
lfi predict events --with-markets true --limit 10 --json - User selects an event related to a specific token
- token →
— token detailslfi token info sol <tokenAddress> --json - token →
— security auditlfi token security sol <tokenAddress> --json
Suggest Next Steps
| 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?" / "需要查看某个订单的详情?" |
Edge Cases
- Invalid source: If the API returns an error about source, list valid sources (
,kalshi
) and ask the user to choosepolymarket - No events found: Inform user: "No prediction events found matching your criteria. Try different filters or search terms."
- Empty positions: Inform user: "No open positions found for this wallet. You can browse events to find prediction opportunities."
- Insufficient balance: If balance is too low for a trade, inform the user and suggest depositing funds
- Invalid slug: If event not found, suggest searching events first via
lfi predict events --search <keyword> - Polymarket auth missing: If POLY_* flags are missing for Polymarket operations, list all required flags and ask the user to provide them
- Invalid JSON in --body or --order-context: If JSON parsing fails, show the parse error and ask the user to correct the JSON
- Quote expired: Kalshi quotes have limited validity; if too much time passes, get a new quote
- Network timeout: Retry once after 3 seconds; if still fails, suggest checking connectivity via
lfi ping --json
Common Pitfalls
| Pitfall | Correct Approach |
|---|---|
Forgetting on event detail | Always specify or |
| Missing POLY_* flags for Polymarket | All five flags are required for Polymarket orders and order queries |
| 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 must come from the user's actual wallet signing |
| Using wrong mint addresses | Verify mints from the event detail response before quoting |
Security Notes
See security-policy.md for global security rules.
Skill-specific rules:
- Polymarket CLOB credentials are sensitive — never log, display, or store POLY_* values beyond the immediate command execution
- Kalshi transactions involve real funds — never fabricate or guess signed transaction data
- NEVER place orders without explicit user confirmation — always show the order summary first
- The
and--order-context
fields are opaque — pass them through as-is; do not interpret, modify, or display raw content beyond summarizing key fields (amount, side, market)--body - After order submission, provide the result so the user can independently verify