Command Palette

Search for a command to run...

Назад к скиллам
скилл № 72981

dflow-kalshi-portfolio

View what a wallet holds on DFlow's Kalshi prediction markets — current positions, unrealized mark-to-market, realized P&L, activity history, and redeemable…

БесплатноБез исполняемых скриптов
x402agentот x402agent★ 26 звёзд на GitHub

Установить dflow-kalshi-portfolio в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

DFlow Kalshi Portfolio

Read-only views on a wallet's Kalshi activity — holdings, mark-to-market valuations, realized P&L, fill history, redeemable positions.

Prerequisites

  • DFlow docs MCP (https://pond.dflow.net/mcp) — install per the repo README. This skill is the recipe; the MCP is the reference. Look up exact response shapes, pagination, and batch-endpoint payloads via search_d_flow / query_docs_filesystem_d_flow — don't guess.
  • dflow CLI (optional, for the fast-path holdings view) — install per the repo README.

Surface

There is no /positions endpoint. A portfolio is assembled by hand from onchain wallet balances + metadata joins. Two ways to do it:

  • CLI — dflow positions — one command, dumps spot + outcome tokens for the active vault wallet with balances and market labels. Covers "what do I hold right now?" on the CLI, and the stablecoin uiAmount already reads as USD. Doesn't carry mark prices for outcome tokens, redemptionStatus, or fill history, so outcome-token valuation, redemption checks, and P&L still need the API pipeline. Active-vault only.
  • API — build-your-own pipeline — needed whenever the user wants any of: mark-to-market, P&L, activity history, redemption eligibility, or to inspect a wallet that isn't the CLI's active vault.

Quick path: dflow positions (CLI)

Output (single JSON envelope, same on every wallet):

{
  "ok": true,
  "data": {
    "wallet": "<pubkey>",
    "positions": [
      { "type": "spot",    "mint": "...", "symbol": "USDC", "amount": "1326161", "uiAmount": 1.326161, "decimals": 6 },
      { "type": "outcome", "mint": "...", "symbol": "DFlowYU0192", "amount": "2000000", "uiAmount": 2.0, "decimals": 6,
        "side": "yes", "market": { "title": "...", "status": "active" } }
    ]
  }
}
  • type: "spot" — SOL, USDC, CASH, and anything else in the wallet.
  • type: "outcome" — Kalshi outcome token; additionally carries side ("yes" | "no") and a minimal market (title, status).
  • No flag to inspect another wallet. For that, use the API pipeline.

Full path: build-your-own (API)

The canonical pipeline, from the DFlow recipe /build/recipes/prediction-markets/track-positions:

  1. Read wallet balances via Solana RPC — getParsedTokenAccountsByOwner(wallet, { programId: TOKEN_2022_PROGRAM_ID }). Outcome tokens are Token-2022. (For stablecoin balances, also query the classic SPL token program.)
  2. POST /api/v1/filter_outcome_mints — send the wallet's mint list, get back just the PM outcome mints.
  3. POST /api/v1/markets/batch — fetch full market metadata for those outcome mints (title, status, closeTime, yesBid / yesAsk / noBid / noAsk, redemptionStatus, accounts.yesMint / noMint).
  4. Join — map each holding to its market; determine YES vs NO by matching the held mint against accounts.yesMint / accounts.noMint.

Field-level detail (response envelopes, pagination) → docs MCP.

Views on top of the pipeline

Current positions

Output of the pipeline above. Optionally attach current mark price per position (yesBid for YES holdings, noBid for NO holdings — see mark-to-market below).

Unrealized mark-to-market

Value each outcome holding at the bid on its side (what you could sell it for), not the ask:

  • Long YES → uiAmount * parseFloat(yesBid)
  • Long NO → uiAmount * parseFloat(noBid)

Sum across positions for a wallet-level unrealized value. Subtract cost basis (below) for unrealized P&L.

Realized activity and P&L

GET /api/v1/onchain-trades?wallet=<pubkey>&sortBy=createdAt&sortOrder=desc&limit=N — DFlow-indexed view of the wallet's onchain fills.

  • Activity feed: each row has createdAt, marketTicker, side, inputAmount, outputAmount, transactionSignature.
  • Cost basis per market: track net settlement-mint flow per outcome mint (settlement-in on buys minus settlement-out on sells).
  • Fees: sum feeAmount across fills in the settlement mint.

Redeemable sweep

A holding is redeemable iff all three:

  • market status is determined or finalized,
  • market redemptionStatus is "open",
  • the held outcome mint is the winning side (from market result).

To redeem, hand off to dflow-kalshi-trading (redemption is a sell of the winning side back to the settlement mint).

Pending order check

If the app submitted the order itself, persist the orderAddress returned at submission and poll GET /order-status?orderAddress=<addr> until terminal. There's no list-by-wallet endpoint. Most fills terminate well under the CLI's 120s poll budget, so this is rarely a user-facing concern — but outside the maintenance window, don't assume a specific fill time.

What to ASK the user (and what NOT to ask)

**View shape

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл dflow-kalshi-portfolio?

View what a wallet holds on DFlow's Kalshi prediction markets — current positions, unrealized mark-to-market, realized P&L, activity history, and redeemable winners. Use when the user asks "what are my positions?", "what do I own?", "am I up or down?", "what's my fill history?", "what can I redeem?", "mark my portfolio to market", or "show me this wallet's DFlow activity". Read-only. Do NOT use to place sells or redemptions (use `dflow-kalshi-trading`), for market-wide data unrelated to a wallet (use `dflow-kalshi-market-data`), or to discover new markets (use `dflow-kalshi-market-scanner`).

Как установить скилл dflow-kalshi-portfolio?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dflow-kalshi-portfolio запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dflow-kalshi-portfolio с