Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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) or inputMint.
  • 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:

  1. 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 → platformFeeBps only; PM → either; both → usually platformFeeBps on spot + platformFeeScale on PM (per-request choice).
  2. Rate — bps value for fixed; k value for dynamic.
  3. 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?
  4. Imperative or declarative? Only matters for spot and only matters for platformFeeMode — declarative can only fee in outputMint.
  5. DFlow API key. Platform fees are an HTTP-only feature (params on the user's own /order call) — 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 "is DFLOW_API_KEY set?" 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 — same x-api-key unlocks Trade API + Metadata API, REST + WebSocket. Yes → prod https://quote-api.dflow.net + x-api-key. No → dev https://dev-quote-api.dflow.net, rate-limited. Pointer: https://pond.dflow.net/build/api-key.

**Do NOT ask ab

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

Установить 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), без исполняемых скриптов.

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

Сравнить dflow-platform-fees с