Skip to content

More utility methods. - #23

Merged
MathisWellmann merged 10 commits into
mainfrom
try_from_scaled
Aug 23, 2026
Merged

More utility methods.#23
MathisWellmann merged 10 commits into
mainfrom
try_from_scaled

Conversation

@MathisWellmann

@MathisWellmann MathisWellmann commented Aug 23, 2026

Copy link
Copy Markdown
Owner
  • Add try_from_scaled methods for BaseCurrency and QuoteCurrency.
  • Add to_f64 and to_f32 methods for BaseCurrency and QuoteCurrency
  • Make new_weighted_price public on QuoteCurrency.
  • Add invert method to PositionSide
  • Add method iter for SortedOrders
  • Make more methods of SortedOrders public
  • CI: include a review.yml workflow backed my local inference with Qwen3.8-27B.

@MathisWellmann MathisWellmann self-assigned this Aug 23, 2026
@github-actions

Copy link
Copy Markdown

Summary

Adds read-only iter/IntoIterator to SortedOrders and ActiveLimitOrders, PositionSide::invert, try_from_scaled/to_f32/to_f64/Div<i64> for both currencies, and a new AI PR-review workflow. The order-book and currency changes are correct and tested, but the trade_aggregation.rs test edit breaks the test build.

Issues

  • src/trade_aggregation.rs:61, blocker: <Trade as TakerTrade>::price(trade) passes trade by value, while the pre-existing line directly below calls the same method as price(&trade) (and the pre-change code used trade.price()), so TakerTrade::price takes a reference. Fully-qualified method syntax does not auto-ref the receiver, so this line fails to compile and cargo test — the CI cargo-test step — errors out. Fix: pass &trade.

@github-actions

Copy link
Copy Markdown

Summary

The PR adds a dedicated AI PR-review workflow (pi against the self-hosted vLLM endpoint, isolated PI_CODING_AGENT_DIR, minimal .#review nix devShell), bumps the crate to 0.138.3, and widens the public API: non-consuming SortedOrders::iter/IntoIterator, PositionSide::invert, try_from_scaled/to_f64/to_f32/Div<i64> for both currency types, and public new_weighted_price. I verified the pi env var and CLI flags against the pi docs, the worst-to-best iteration semantics against the sort invariant (best() is orders.last()) and the new tests, the workflow's failure guards, and Cargo.toml/Cargo.lock version consistency.

Issues

None

@MathisWellmann
MathisWellmann merged commit 6c0cd7b into main Aug 23, 2026
2 checks passed
@MathisWellmann
MathisWellmann deleted the try_from_scaled branch August 23, 2026 13:52
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