compute-gateway-fees-and-net-settlement
Use when pricing must survive processor fees. Computes net settlement per transaction from percentage-plus-fixed fees with integer basis points and finds the break-even ticket.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- compute-gateway-fees-and-net-settlement
- description
- Use when pricing must survive processor fees. Computes net settlement per transaction from percentage-plus-fixed fees with integer basis points and finds the break-even ticket.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md365 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Compute gateway fees and net settlement
2.9% + $0.30 is not 2.9%. On a $5 charge the fixed fee dominates and net is $4.56 — 91% of gross. Every unit-economic model must compute net, in integer minor units.
Procedure
-
Get the real rate from a settlement statement, not a website. Rates vary by card type, region and interchange; keep at least a blended rate and a worst-case rate.
-
Express the percentage as basis points to keep integer maths: 2.9% = 290 bp. The fixed fee is
fixed_minor = 30. -
Compute the fee on a charge:
fee_minor = amount_minor * fee_bp // 10000 + fixed_minor. Floor the multiplication so you never over-charge the fee. -
Compute net:
net_minor = amount_minor - fee_minor. -
Worked example, blended 290 bp + 30:
- $5.00 = 500 minor: fee = 500*290//10000 + 30 = 14 + 30 = 44; net = 456.
- $100.00 = 10000 minor: fee = 290 + 30 = 320; net = 9680.
- effective rate on $5 = 44/500 = 8.8%; on $100 = 3.2%.
-
Find the break-even ticket where the fixed fee is 1% of gross:
fixed_minor / 0.01 = 3000minor = $30. Below $30 the fixed fee exceeds 1%. -
For international or Amex cards, re-run with their bp and a cross-border markup so the model is not optimistic.
-
Net settlements, not gross revenue, feed contribution margin. State which rate a model used.
-
Model refunds: the original fee is usually retained, so a refund costs the fee again unless a fee-return policy applies.
-
Recompute unit economics per SKU; a low-ticket SKU can be net-negative and should be surfaced, not hidden in a blend.
-
Track the blended effective rate monthly; a creeping rate is a silent margin leak even at flat volume.
-
Include chargeback fees and refund-fee retention when estimating the true take rate.
-
Model a fee change: a 20 bp raise on 10,000,000 minor of monthly volume is 20,000 minor of margin.
-
Compare processors on net settlement for your actual ticket mix, not on headline rate.
-
Store the rate schedule with a start date so historical reconciliations use the rate that applied then.
Pitfalls
-
Quoting gross revenue as if it were collected; the processor takes its cut before the deposit.
-
Using the advertised 2.9% when the statement shows 3.4% before interchange plus markup.
-
Float division of the fee drifts across millions of rows; integer bp arithmetic does not.
-
Ignoring chargeback fees and refund-fee retention understates the true take rate.
-
Applying one blended rate to a subscription and a one-off hides that small tickets are unprofitable.
-
A low-ticket SKU can be net-negative after the fixed fee and still show "revenue" on the dashboard.
-
Never re-auditing the rate after a plan change means the model prices with a stale fee.
-
Comparing processors on headline rate ignores the fixed fee that dominates small tickets.
-
Applying today's rate to last quarter's reconciliation silently restates history.
Verification
python3 -c "for a in (500,2000,10000): print(a, a*290//10000+30, a-(a*290//10000+30))"
# 500 44 456 / 2000 88 1912 / 10000 320 9680 -> net rises slower than gross on small tickets
Report: the rate used (bp + fixed), net settlement on the smallest and largest ticket, and the effective rate at each.
04 同仓库更多 Skills
troves
Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.
trade
Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".
staking
Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.
send
Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".
portfolio
View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".
multi-swap
Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.