/algo-trading-skills:post-only-and-maker-taker-fee-optimizationfrom algo-trading-skills
Builds post-only order payloads for Binance, Bybit, Coinbase, Kraken, and FIX venues. Rejects marketable prices so limit orders rest rather than execute as taker.
Ships in algo-trading-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Use this skill when a strategy submits limit orders that are supposed to rest on the book — market making, passive rebalancing, patient accumulation, the resting leg of a spread — and executing as a taker would be a defect rather than a cost. Post-only tells the matching engine to cancel or reject the order rather than let it trade on arrival, which converts an unnoticed taker fill into a visible non-fill you can act on.
The module does three separable things: it decides whether a proposed limit price is marketable against a top-of-book snapshot, it builds the post-only payload in the spelling the named venue accepts, and it accounts for the fee differential versus crossing — as an estimate conditional on a fill, with realized amounts accrued only from fills the venue actually reports.
kill-switch-and-drawdown-circuit-breakers and execution-algorithm-kill-switch-integration.adverse-selection-measurement-for-passive-orders and queue-position-modeling-for-passive-orders before concluding that passive is cheaper.post-only-limit-repricing-under-fast-markets.market-maker-vs-taker-strategy-classification and transaction-cost-analysis-tca-integration.Venue must be one of the supported members, and behaviour must be confirmed for anything else.0.001 = 10 bps). Required — there is no default, because a plausible-looking default is exactly how a fabricated savings figure reaches a report.> 0 is charged to the desk, < 0 is credited (a rebate). A negative fee differential therefore means post-only is the more expensive side. This matches exchange-fee-tier-and-rebate-structure-analysis.best_bid, best_ask, both finite and positive), optionally with tick_size.category (spot / linear / inverse / option) passed through venue_params.Name the venue before building anything — the flag is not portable.
type="LIMIT_MAKER" and has no post-only timeInForce; spot accepts only GTC/IOC/FOK. Binance USD-M futures uses type="LIMIT" with timeInForce="GTX". Bybit v5 uses timeInForce="PostOnly". Coinbase Advanced Trade nests post_only inside order_configuration.limit_limit_gtc. Kraken uses oflags="post". FIX 4.4 uses ExecInst (tag 18) value 6.venue_params keys that would overwrite the flag, the price, or the quantity.ExecInst value 6 is the wire value. Sending the human-readable label "ParticipateDoNotInitiate" in tag 18 is not a valid FIX message. Tag 18 is a MultipleValueString, so 6 may travel space-delimited alongside other instructions.Validate the side as an enum, not a string.
"B", "BUY_TO_COVER", a config file's leading space in " BUY" — skips the check entirely and submits the marketable price unchanged. OrderSide is required for exactly this reason; a non-enum side raises rather than falling through.Test marketability against the snapshot, inclusively.
limit_price >= best_ask; a sell when limit_price <= best_bid. Both bounds are inclusive: a limit exactly equal to the opposite touch trades against it.Choose a crossing policy — repricing is not free.
REPRICE_PASSIVE moves the price to the near touch (bid for a buy, ask for a sell). Decision point: this is a different order. It no longer takes the liquidity the original price was reaching for, so the trade may simply not happen. Choose it when the fill is optional.REJECT refuses to submit and hands the decision back. Decision point: the correct follow-up to a rejection is a classification, not a resubmission — either the trade is still worth doing at the touch (send an explicit taker order and book the taker fee), or it is not (drop it). Blind resubmission at a crossing price is the cancellation loop.best_bid >= best_ask) the near touch is itself marketable, so there is no passive price to reprice to. The engine returns POST_ONLY_REJECTED_LOCKED_OR_CROSSED_BOOK rather than emitting a payload the venue would cancel.Read the fee figures as counterfactuals, not as savings.
_if_filled_usd field is conditional on a fill that post-only cannot guarantee. Do not accumulate them. An unfilled post-only order saves nothing and forgoes the trade; the previous version of this skill accrued savings at submission time and reported $12,000 of savings for 100 orders that never filled.record_maker_fill(filled_quantity, fill_price, taker_reference_price, fill_id), driven by the venue's fill reports, on filled quantity only. Decision point: pass the venue's execution id — overlapping paginated fill fetches are the ordinary way one fill arrives twice, and a repeated id is rejected rather than double-counted.Handle the venue's rejection semantics — they differ.
EXPIRED order update asynchronously. Bybit cancels the order.order-placement-idempotency.Full procedure: see
references/workflows.md. Standards reference: seereferences/standards.md. Printable pre-flight checklist: seeassets/checklist.md.
post_only, POC and execInst in one payload is not a portable fallback. The venue that does not recognise a field usually ignores it, and an ignored post-only flag submits an ordinary limit order that crosses and pays the taker rate — the exact outcome the flag was added to prevent."ParticipateDoNotInitiate" in FIX tag 18. The wire value is 6. The label is documentation, not a message field.timeInForce="GTX" on Binance spot, or LIMIT_MAKER on futures. They are different products with different post-only mechanics; the spot endpoint accepts only GTC/IOC/FOK.BUY/SELL skips the crossing comparison and submits the marketable price with a post-only flag attached — which the venue then cancels, so the order silently never exists.best_bid == best_ask, moving a buy "passively" to the bid leaves it at the ask. The payload looks correct and the venue cancels it on arrival.order-to-trade-ratio-fee-penalty-avoidance.Venue.BINANCE_SPOT must emit type="LIMIT_MAKER" and no timeInForce; Venue.BINANCE_USDM_FUTURES must emit timeInForce="GTX"; Venue.BYBIT_V5 must emit timeInForce="PostOnly" with side "Buy" and string qty/price; Venue.COINBASE_ADVANCED must nest post_only: True inside order_configuration.limit_limit_gtc; Venue.KRAKEN_SPOT must emit oflags="post"; Venue.FIX_4_4 must emit tag 18 = "6". No payload from any venue may carry execInst or a POC time-in-force.best_ask and a sell at exactly best_bid must both be treated as marketable; a buy strictly inside the spread must be submitted unchanged.best_bid == best_ask == 60,010, a buy at 60,020 under REPRICE_PASSIVE must return POST_ONLY_REJECTED_LOCKED_OR_CROSSED_BOOK with an empty payload — not a payload priced at 60,010.realized_fee_differential_usd at exactly 0.0. Only record_maker_fill may move it, and a repeated fill_id must raise rather than accrue twice.dict in place of a TopOfBook, an off-tick limit price, a Bybit order without category, venue_params overwriting the post-only flag/price/quantity, a quantity that underflows string serialisation, and a non-FeeSchedule or non-Venue constructor argument must each raise PostOnlyOrderError (a ValueError). FeeSchedule and TopOfBook are frozen.python -m unittest discover -s skills/post-only-and-maker-taker-fee-optimization/scripts and confirm 100% pass rate.post-only-limit-repricing-under-fast-marketsmarket-maker-vs-taker-strategy-classificationexchange-fee-tier-and-rebate-structure-analysisadverse-selection-measurement-for-passive-ordersqueue-position-modeling-for-passive-ordersorder-to-trade-ratio-fee-penalty-avoidanceorder-placement-idempotencybroker-order-type-capability-matrixexecution-venue-fee-tier-optimizationtransaction-cost-analysis-tca-integrationWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
36 skills in this plugin
/alpaca-paper-live-key-separationUse when a bot connects to the Alpaca Trading API and must never cross paper keys with the live endpoint; pins the base URL per environment, checks the key prefix, probes /v2/account and requires an explicit ALLOW_LIVE_TRADING flag./api-key-least-privilege-audit-toolUse before deploying a live bot, to audit existing broker API keys for scopes they do not need. Flags withdrawal, transfer and admin rights that turn a leaked execution key into theft./broker-account-margin-call-handlingUse when a bot trades a Reg T, portfolio or futures margin account and must act before the broker liquidates: tiered maintenance-margin warnings cross-checked against broker excess liquidity, initial-margin order gating and liquidity-aware de-leveraging./broker-agnostic-adapter-interfaceUse when strategy code must run across several brokers and should not import kiteconnect, alpaca-py or ibapi directly; defines an adapter contract with Decimal prices, typed exceptions and normalised order status across venues./broker-api-changelog-diffing-toolUse before upgrading a broker SDK or OpenAPI spec, to diff two schema snapshots for removed endpoints, newly required parameters, enum mutations and type changes so CI fails before the change reaches an order path./broker-api-deprecation-notice-monitoringUse when a long-running bot calls REST endpoints a broker may retire; parses RFC 8594 Sunset and RFC 9745 Deprecation headers plus changelog feeds into one dated migration deadline with an escalation tier.npx claudepluginhub himanshuj16/algo-trading-skills --plugin algo-trading-broker-integrationOther plugins' skills for the same job