Skip to content

docs(reference): bring the API examples in line with the current code - #78

Merged
ricardofrantz merged 2 commits into
mainfrom
feat/execution-records
Nov 13, 2026
Merged

ricardofrantz merged 2 commits into
mainfrom
feat/execution-records

Conversation

@ricardofrantz

@ricardofrantz ricardofrantz commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #76, which moved the developer reference to docs/reference.md unchanged. The review there flagged stale examples; this fixes those and about fifteen more found by checking every example against the source:

  • CostModel: bps fields are f64, min_trade_fee is min_commission.
  • Position::apply_fill takes Shares.
  • backtest_weights (Rust and Python) takes CostModel, FillPolicy and BarPrices; equity_curve holds the initial equity plus one entry per period; result fields listed in full.
  • Broker trait: open_orders, BrokerOrder.client_order_id, Quote.timestamp.
  • Event list: the four SubmitStop* variants. Symbol limit: 8 UTF-8 bytes.
  • compute_metrics returns Option<Metrics>; risk statuses are PASS|WARN|FAIL; rebalancer and lob CLI commands completed; Python stop and broker options documented.

Check: every changed Rust example compiles and runs (with asserts) in a scratch crate depending on the workspace by path; the old snippets fail to compile. Python examples checked against the PyO3 source and run against a local build.

View guided diff Turn on auto-fix

The reference was moved out of the README unchanged and had drifted:
CostModel fields (f64 bps, min_commission), Shares in Position fills,
the backtest_weights signature (CostModel, FillPolicy, BarPrices),
equity_curve length (initial equity plus one per period), the Broker
trait (open_orders, client_order_id, quote timestamp), the stop event
variants, UTF-8 symbol limit, metrics fields, risk status strings,
rebalancer and lob CLI commands, and Python stop and broker options.
Every changed Rust example was compiled and run in a scratch crate;
the old snippets fail to compile.

Co-authored-by: Ricardo Frantz <4220623+ricardofrantz@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 79ea2e4 and 036b259.

Files selected for processing: 1

  • docs/reference.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/reference.md Resolved
Co-authored-by: Ricardo Frantz <4220623+ricardofrantz@users.noreply.github.com>
@ricardofrantz
ricardofrantz merged commit c26342b into main Nov 13, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant