Loading...
Loading...
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).
npx skill4agent add dflowprotocol/dflow-skills dflow-platform-feeshttps://pond.dflow.net/mcp/orderdflow--platform-fee-bpshttps://quote-api.dflow.netx-api-keyhttps://dev-quote-api.dflow.netplatformFeeBpsplatformFeeBps: 50platformFeeScalefee = k * p * (1 - p) * ckplatformFeeScaleplatformFeeScale: 50pcp * (1 - p)p = 0.5p = 0p = 1p = 1platformFeeScale = 50p = 0.40fee = 0.050 * 0.40 * 0.60 * 100 = 1.20/order/build/trading/platform-fees/build/recipes/trading/platform-feesplatformFeeBpsplatformFeeScaleplatformFeeModeoutputMintinputMintfeeAccount| Trade type | Allowed |
|---|---|
| Imperative spot | |
| Declarative spot | |
| PM outcome-token trades | Always settlement mint (USDC / CASH), regardless of what you pass |
inputMintfeeAccountplatformFeeBpsplatformFeeBpsplatformFeeScalekplatformFeeModeoutputMint/orderDFLOW_API_KEYx-api-keyhttps://quote-api.dflow.netx-api-keyhttps://dev-quote-api.dflow.nethttps://pond.dflow.net/build/api-keyplatformFeeBpsfeeAccountplatformFeeScalep = 1platformFeeScaleplatformFeeBpsoutputMintplatformFeeMode: "inputMint"feeAccount/orderfeeAccountroundup(0.07 × c × p × (1 − p)) + (0.01 × c × p × (1 − p))/build/prediction-markets/prediction-market-fees/build/recipes/trading/platform-feesplatformFeeBpsplatformFeeScaledflow-spot-trading/orderdflow-kalshi-trading/orderpredictionMarketInitPayer