Skip to content

fix(rails): rail 14 is a monthly buy cap, not a fee-free allowance (#836) - #837

Merged
eaitbrahim merged 4 commits into
mainfrom
fix/rail14-buy-cap-not-fee-free
Sep 27, 2026
Merged

eaitbrahim merged 4 commits into
mainfrom
fix/rail14-buy-cap-not-fee-free

Conversation

@eaitbrahim

Copy link
Copy Markdown
Contributor

Closes #836.

What was wrong

keel described rail 14's cap as the venue's fee-free allowance, and its research treated "inside the allowance" as a fee-free regime. keel's orders go through Coinbase Advanced Trade, which has no fee-waiver tier:

  • On 2026-09-27 the account reported the Intro tier: 0.9% taker, 0.5% maker, has_promo_fee: false.
  • Every live fill had paid a fee: 1.19%, 1.14%, 1.19% and 0.89%.
  • Coinbase One's "zero trading fees up to $500/month" applies on the main Coinbase platform, not Advanced Trade.

What changed (wording only; enforcement untouched)

  • keel/execution/guards.py has zero changed lines. The 29 rail 14 guard tests pass unchanged, which proves the cap, its fail-closed behaviour and every number it enforces are the same.
  • No schema rename. The free_volume_usd field keeps its historical name. A rename would need a migration and would change no behaviour.
  • Operator-facing text:
  • Docs:
    • docs/rails/rail-14-subscription-allowance.md is retitled "the monthly buy cap". Its "What it bounds" section no longer claims a fee waiver or a "profitability boundary", and it carries a dated correction. The enforcement, veto and inspection sections are unchanged.
    • The runbook and the research toolkit are corrected in place.
  • Records are appended to, never rewritten. Five records that described a fee-free regime each gain a dated Fee note under the title: the 2026-08-21 significance, 2026-08-22 trailing exits and 2026-09-05 restatement records, the quant-lab note cross-verification, and the 2026-09-27 accumulation-policy record. The accumulation note says its flat-taker run is the one matching live, and the verdict is unchanged.
  • Code comments and docstrings now call the fee-free tier model hypothetical for keel's orders.

Tests

tests/test_rail14_is_a_buy_cap.py has 6 tests, all seen failing first:

One existing test that pinned the old "fee-free" wording is rewritten to pin the corrected label.

Not in scope, deliberately

Verification

  • Full suite: 6838 passed, 3 skipped.
  • mypy, ruff check and ruff format --check are clean.

🤖 Generated with Claude Code

)

keel trades through Coinbase Advanced Trade, which has no fee-waiver
tier: on 2026-09-27 the account reported the Intro tier (0.9% taker,
has_promo_fee false) and every live fill had paid a fee. Coinbase One's
zero trading fees apply on the main Coinbase platform only.

Wording only -- guards.py is untouched and every rail 14 number is the
same:
- subscription set help, the throughput report, the significance
  verdict's zero-fee phrase and the sim's tier section say buy cap /
  hypothetical zero-fee regime, not fee-free allowance;
- the rail 14 doc drops the fee-waiver and profitability-boundary claim
  and records the correction;
- the runbook and research toolkit are corrected in place;
- five records that described a fee-free regime gain a dated fee note
  (appended, never rewritten), pinned by a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eaitbrahim eaitbrahim added fix Bug fix (groups under Fixes) rails Un-overridable safety rail / guard (Compliance & rails) docs Documentation (Docs, CI & tooling) labels Sep 27, 2026
Comment thread tests/test_rail14_is_a_buy_cap.py Outdated
Comment thread keel/research/throughput.py Outdated
Comment thread keel/research/significance.py
Comment thread packages/keel-core/keel_core/config.py
eaitbrahim and others added 3 commits September 27, 2026 09:33
…laim is gone from templates and configs

- The rail 14 doc test could not fail: its regex never matched the real
  pre-#836 paragraph (a line break split the phrase and ** wrapped it).
  It now normalises markdown and whitespace first, and a new test pins
  the detector against the retracted paragraph verbatim.
- The fee-free claim is corrected in keel/templates/config.live.yaml and
  config.yaml (what keel setup writes into a deployment), the tracked
  config.yaml / config.paperforward.yaml / config.paper-hourly.yaml, the
  TierConfig docstring, and throughput.py / significance.py (#838).
  Comments only: every config's parsed values are identical.
- The record-note rule now covers docs/superpowers/specs; four specs gain
  a dated fee note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fees to beyond a free allowance (#838)

The fees: block in both setup templates, config.yaml and
config.paperforward.yaml, and the FeesConfig docstring, said Advanced
Trade fees applied only to volume beyond a tier's free allowance. They
apply to every keel order. The comment now says so, and that the account
measured 0.9% / 0.5% on 2026-09-27 while the sim keeps 1.2% / 0.6% as
its conservative figure (values unchanged). The tiers comment, which
the first fix split mid-sentence, is rewritten as one paragraph. A test
pins the templates keel setup writes; it fails on the pre-#836 template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed Coinbase One covered keel's trades (#836)

Held from #837's round-3 review: the original design spec says the
Coinbase One zero-fee benefit covers the trades this tool places. It
gains the same dated, appended note as the other specs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eaitbrahim
eaitbrahim merged commit ed9cb2a into main Sep 27, 2026
4 checks passed
@eaitbrahim
eaitbrahim deleted the fix/rail14-buy-cap-not-fee-free branch September 27, 2026 14:09
eaitbrahim added a commit that referenced this pull request Sep 28, 2026
…an's cap (#845)

MINOR: live and paper DCA now spend each rule's own size_usd, and DCA
buys are exempt from the total-exposure rail. No schema change since 0.18.0.

What lands:
  #843 (#840) -- executor sizes each DCA buy from the rule's size_usd;
  absent falls back to dca.budget_usd, present-but-invalid skips the buy.
  #842 (#841) -- rail 4 (total exposure) no longer vetoes DCA buys;
  rail 14 (monthly buy cap) and rail 6 (per-asset) still bind them.
  #837 (#836) -- rail 14 relabelled a monthly buy cap, not fee-free.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation (Docs, CI & tooling) fix Bug fix (groups under Fixes) rails Un-overridable safety rail / guard (Compliance & rails)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rail 14: the "fee-free allowance" is not fee-free on Advanced Trade -- relabel it a monthly buy cap, and re-scope what rests on the premise

1 participant