dflow-platform-fees
БесплатноБез исполняемых скриптовНе проверенMonetize a DFlow integration by collecting a builder-defined fee on trades your app routes through the Trade API — either a fixed percentage (spot + PM) via…
от x402agent★ 26 звёзд на GitHubОб этом скилле
DFlow Platform Fees
Collect a fee on trades your app routes through the DFlow Trade API, paid to a builder-controlled token account on successful execution. This is the builder→user fee — builders monetizing their distribution.
Prerequisites
- DFlow docs MCP (
https://pond.dflow.net/mcp) — install per the repo README. This skill is the recipe; the MCP is the reference. Exact parameter encoding, response shapes, and the full mode matrix live there — don't guess.
Surface
API only. Platform fees are /order parameters on the Trade API. The dflow CLI is for direct self-trading, not for monetizing a distribution product, so it doesn't expose platform-fee flags — don't hunt for a --platform-fee-bps option.
Which host depends on API-key status, same as the other trading skills: prod https://quote-api.dflow.net with x-api-key, dev https://dev-quote-api.dflow.net.
Two fee models
Pick based on what trades you're fee-ing.
Fixed — platformFeeBps
Flat percentage of the trade in basis points (1 bps = 0.01%). platformFeeBps: 50 → 0.5% fee. Works on spot and PM trades. The only option for spot.
Dynamic — platformFeeScale (PM outcome tokens only)
Probability-weighted fee that scales with market uncertainty:
fee = k * p * (1 - p) * c
k=platformFeeScale, 3-decimal precision (platformFeeScale: 50→ k = 0.050).p= the all-in price (includes all fees + filled price), 0–1.c= contract size.- Paid in the settlement mint (USDC or CASH).
p * (1 - p) peaks at p = 0.5 and is zero at p = 0 / p = 1 — so you charge the most on coin-flip markets, scale down as markets approach certainty, and charge nothing at redemption (p = 1). If your revenue model assumes a take on redemption, rework it.
Example. platformFeeScale = 50, user buys 100 YES contracts at p = 0.40:
fee = 0.050 * 0.40 * 0.60 * 100 = 1.20 → $1.20 on a $40 buy.
Dynamic fees are not available on spot.
Core /order parameters
Full param details and encoding → docs MCP, or read the pages directly: /build/trading/platform-fees, /build/recipes/trading/platform-fees.
platformFeeBps— fixed fee in bps. Works everywhere.platformFeeScale— dynamic fee coefficient. PM outcome tokens only.platformFeeMode— which side pays the fee:outputMint(default) orinputMint.feeAccount— the SPL token account that receives the fee. Must already exist before the trade; DFlow won't create it.
Mode matrix — who can pay the fee in which token
| Trade type | Allowed platformFeeMode |
|---|---|
| Imperative spot | inputMint or outputMint |
| Declarative spot | outputMint only |
| PM outcome-token trades | Always settlement mint (USDC / CASH), regardless of what you pass |
Easy trap when porting from imperative to declarative: inputMint mode silently becomes invalid.
Fee accounts (ATAs)
You need one ATA per token you collect in. A builder collecting in USDC and SOL needs a USDC ATA and a SOL ATA, both already created, both controlled by the builder's wallet. Pass the relevant one as feeAccount per request — DFlow reads it, validates it matches the mode's token, and transfers on success.
For PM: the fee ATA must be a settlement-mint ATA (USDC or CASH), since that's the only token PM fees can be paid in.
What to ASK the user (and what NOT to ask)
Ask if missing:
- Which trade types do you want to collect fees on — spot, PM outcome tokens, or both? Scopes which fee model(s) are relevant: spot-only →
platformFeeBpsonly; PM → either; both → usuallyplatformFeeBpson spot +platformFeeScaleon PM (per-request choice). - Rate — bps value for fixed;
kvalue for dynamic. - Collection token(s) — which token(s) do you want the fee paid in, and do you already have a matching ATA owned by the builder wallet?
- Imperative or declarative? Only matters for spot and only matters for
platformFeeMode— declarative can only fee inoutputMint. - DFlow API key. Platform fees are an HTTP-only feature (params on the user's own
/ordercall) — there's no CLI flag for them, so you're always plumbing the key into the script's HTTP client. Ask with a clean, neutral question: "Do you have a DFlow API key?" Don't presuppose where the key lives — phrasings like "do you have it in env?" or "isDFLOW_API_KEYset?" nudge the user toward env-var defaults they didn't ask for. Surface the choice; don't silently fall back to env or to dev. It's one DFlow key everywhere — samex-api-keyunlocks Trade API + Metadata API, REST + WebSocket. Yes → prodhttps://quote-api.dflow.net+x-api-key. No → devhttps://dev-quote-api.dflow.net, rate-limited. Pointer:https://pond.dflow.net/build/api-key.
**Do NOT ask ab
Установить dflow-platform-fees в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл dflow-platform-fees?
Monetize a DFlow integration by collecting a builder-defined fee on trades your app routes through the Trade API — either a fixed percentage (spot + PM) via `platformFeeBps`, or a probability-weighted dynamic fee (PM outcome tokens only) via `platformFeeScale`. Use when the user asks "how do I take a cut of trades?", "add a builder fee", "monetize my swap UI", "charge a platform fee", "how does platformFeeBps / platformFeeScale work?", or "where do my fees get paid?". Do NOT use to run a trade itself (use `dflow-spot-trading` or `dflow-kalshi-trading` — both also cover priority fees and sponsored / gasless flows).
Как установить скилл dflow-platform-fees?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dflow-platform-fees запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic