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.md
source 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:

CommandRequires Auth
lfi predict events
No
lfi predict event <slug>
No
lfi predict balance
No
lfi predict positions
No
lfi predict trades
No
lfi predict orders
No (Polymarket needs POLY_* headers)
lfi predict order <id>
No (Polymarket needs POLY_* headers)
lfi predict kalshi-quote
No
lfi predict kalshi-submit
No
lfi predict polymarket-order
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, securityliberfi-token
Token K-line, candlestick chartliberfi-token
Trending tokens, market rankingsliberfi-market
Newly listed tokensliberfi-market
Wallet holdings, balance (non-prediction), PnLliberfi-portfolio
Wallet activity, transaction historyliberfi-portfolio
Token swap, trade executionliberfi-swap
Login, logout, session managementliberfi-auth

CLI Command Index

Query Commands (read-only)

CommandDescriptionAuth
lfi predict events
List prediction events with filteringNo
lfi predict event <slug> --source <s>
Get event details by slugNo
lfi predict balance --source <s> --user <addr>
Get USDC balanceNo
lfi predict positions --user <addr>
Get portfolio positionsNo
lfi predict trades --wallet <addr>
List trade historyNo
lfi predict orders
List ordersNo (POLY_* for Polymarket)
lfi predict order <id> --source <s>
Get order detailsNo (POLY_* for Polymarket)

Mutating Commands

CommandDescriptionAuth
lfi predict kalshi-quote --input-mint <m> --output-mint <m> --amount <a> --user-public-key <k>
Request Kalshi quoteNo
lfi predict kalshi-submit --signed-transaction <tx> --order-context '<json>'
Submit signed Kalshi transactionNo
lfi predict polymarket-order --body '<json>' --poly-api-key <k> --poly-address <a> --poly-signature <s> --poly-passphrase <p> --poly-timestamp <t>
Create Polymarket orderPOLY_* headers

Parameter Reference

Events list (

lfi predict events
):

  • --limit <n>
    — Max results per page
  • --cursor <cursor>
    — Pagination cursor
  • --status <status>
    — Event status filter (e.g.
    active
    ,
    resolved
    )
  • --source <source>
    — Provider source:
    kalshi
    or
    polymarket
  • --tag-slug <slug>
    — Filter by tag
  • --search <query>
    — Free-text search
  • --sort-by <field>
    — Sort field
  • --sort-asc <bool>
    — Sort ascending:
    true
    or
    false
  • --with-markets <bool>
    — Include embedded markets:
    true
    or
    false

Event detail (

lfi predict event <slug>
):

  • <slug>
    Required. Event slug identifier
  • --source <source>
    Required. Provider source:
    kalshi
    or
    polymarket

Balance (

lfi predict balance
):

  • --source <source>
    Required. Provider source:
    kalshi
    or
    polymarket
  • --user <address>
    Required. User wallet address

Positions (

lfi predict positions
):

  • --user <address>
    Required. User wallet address
  • --source <source>
    — Optional provider source filter

Trades (

lfi predict trades
):

  • --wallet <address>
    Required. Wallet address
  • --source <source>
    — Optional provider source filter
  • --limit <n>
    — Max results per page
  • --cursor <cursor>
    — Pagination cursor
  • --type <types>
    — Comma-separated trade types
  • --side <side>
    — Trade side filter

Orders (

lfi predict orders
):

  • --source <source>
    — Provider source
  • --wallet-address <address>
    — Wallet address (required for kalshi)
  • --market-id <id>
    — Market ID filter
  • --asset-id <id>
    — Asset ID filter
  • --next-cursor <cursor>
    — Pagination cursor
  • --poly-api-key
    ,
    --poly-address
    ,
    --poly-signature
    ,
    --poly-passphrase
    ,
    --poly-timestamp
    — Polymarket CLOB auth (required when source is polymarket)

Order detail (

lfi predict order <id>
):

  • <id>
    Required. Order ID
  • --source <source>
    Required. Provider source
  • Same
    --poly-*
    flags as orders list

Kalshi quote (

lfi predict kalshi-quote
):

  • --input-mint <address>
    Required. Input token mint address
  • --output-mint <address>
    Required. Output token mint address
  • --amount <amount>
    Required. Swap amount
  • --user-public-key <key>
    Required. User's Solana public key
  • --slippage-bps <bps>
    — Slippage tolerance in basis points

Kalshi submit (

lfi predict kalshi-submit
):

  • --signed-transaction <tx>
    Required. Signed transaction data
  • --order-context <json>
    Required. Order context as JSON string (contains
    user_public_key
    ,
    market_slug
    ,
    side
    ,
    outcome
    , mints,
    amount
    ,
    price
    ,
    slippage_bps
    )

Polymarket order (

lfi predict polymarket-order
):

  • --body <json>
    Required. Raw order JSON string
  • --poly-api-key <key>
    Required. Polymarket API key
  • --poly-address <address>
    Required. Polymarket address
  • --poly-signature <sig>
    Required. Polymarket HMAC signature
  • --poly-passphrase <pass>
    Required. Polymarket passphrase
  • --poly-timestamp <ts>
    Required. Polymarket timestamp

Operation Flow

Browse Prediction Events

  1. Fetch events:
    lfi predict events --with-markets true --limit 20 --json
  2. Present results: Show event title, status, number of markets, volume
  3. Suggest next step: "Want to see details for a specific event?" / "需要查看某个事件的详情?"

Browse Events by Source

  1. Determine source: Ask user for
    kalshi
    or
    polymarket
  2. Fetch:
    lfi predict events --source kalshi --with-markets true --limit 20 --json
  3. Present: Events filtered by provider
  4. Suggest next step: "Pick an event to view its markets and outcomes"

View Event Details

  1. Determine slug: From user selection or input
  2. Fetch event:
    lfi predict event <slug> --source <source> --json
  3. Present: Event title, description, status, resolution sources, markets with outcomes and prices
  4. Suggest next step: "Want to check your balance or place an order?"

Check USDC Balance

  1. Collect inputs: Source (kalshi/polymarket) and wallet address
  2. Fetch:
    lfi predict balance --source <source> --user <address> --json
  3. Present: Available USDC balance
  4. Suggest next step: "Ready to place a prediction?" / "准备下注了吗?"

Kalshi Order Flow (Quote → Sign → Submit)

  1. Browse events:
    lfi predict events --source kalshi --with-markets true --json
  2. View event:
    lfi predict event <slug> --source kalshi --json
    — identify market, outcomes, and mints
  3. Check balance:
    lfi predict balance --source kalshi --user <publicKey> --json
  4. Get quote:
    lfi predict kalshi-quote --input-mint <inMint> --output-mint <outMint> --amount <amt> --user-public-key <key> --json
  5. Present quote: Show expected output amount, price, slippage
  6. (mandatory) Wait for explicit user confirmation
  7. User signs the transaction (externally, e.g. via wallet)
  8. Submit:
    lfi predict kalshi-submit --signed-transaction <signedTx> --order-context '<contextJson>' --json
  9. Present result: Show signature, status

Polymarket Order Flow

  1. Browse events:
    lfi predict events --source polymarket --with-markets true --json
  2. View event:
    lfi predict event <slug> --source polymarket --json
  3. Check balance:
    lfi predict balance --source polymarket --user <address> --json
  4. Prepare order body: Construct the Polymarket order JSON
  5. (mandatory) Show order summary and wait for explicit user confirmation
  6. 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
  7. Present result: Show order response

View Positions

  1. Determine user: Get wallet address from user
  2. Fetch:
    lfi predict positions --user <address> --json
  3. Present: Show event/market, outcome, size, entry price, current value
  4. Suggest next step: "Want to see your trade history?" / "需要查看交易历史?"

View Trade History

  1. Determine wallet: Get wallet address from user
  2. Fetch:
    lfi predict trades --wallet <address> --limit 20 --json
  3. Present: Show trade timestamp, event/market, side, price, size
  4. Suggest next step: "Want to check your current positions?" / "需要查看当前持仓?"

Check Order Status

  1. List orders:
    lfi predict orders --source <source> --wallet-address <address> --json
  2. Or get specific order:
    lfi predict order <id> --source <source> --json
  3. 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

  1. predict
    lfi predict events --search "bitcoin" --with-markets true --json
  2. predict
    lfi predict event <slug> --source kalshi --json
    — view markets and outcomes
  3. predict
    lfi predict balance --source kalshi --user <publicKey> --json
    — check funds
  4. predict
    lfi predict kalshi-quote --input-mint <in> --output-mint <out> --amount <amt> --user-public-key <key> --json
    — get quote
  5. Present quote, wait for confirmation, user signs transaction
  6. predict
    lfi predict kalshi-submit --signed-transaction <tx> --order-context '<ctx>' --json

"Check my prediction portfolio and trade history"

Full flow: predict → predict

  1. predict
    lfi predict positions --user <address> --json
    — current positions
  2. predict
    lfi predict trades --wallet <address> --limit 50 --json
    — trade history
  3. Present consolidated portfolio view

"Browse events, then research the underlying token"

Full flow: predict → token → token

  1. predict
    lfi predict events --with-markets true --limit 10 --json
  2. User selects an event related to a specific token
  3. token
    lfi token info sol <tokenAddress> --json
    — token details
  4. token
    lfi token security sol <tokenAddress> --json
    — security audit

Suggest Next Steps

Just completedSuggest 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
    ,
    polymarket
    ) and ask the user to choose
  • 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

PitfallCorrect Approach
Forgetting
--source
on event detail
Always specify
--source kalshi
or
--source polymarket
Missing POLY_* flags for PolymarketAll five
--poly-*
flags are required for Polymarket orders and order queries
Modifying the quote response before submittingPass quote data through as-is in
--order-context
Submitting without user confirmationALWAYS show order/quote summary and wait for explicit "yes"
Fabricating a signed transactionThe
--signed-transaction
must come from the user's actual wallet signing
Using wrong mint addressesVerify 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
    --order-context
    and
    --body
    fields are opaque — pass them through as-is; do not interpret, modify, or display raw content beyond summarizing key fields (amount, side, market)
  • After order submission, provide the result so the user can independently verify