Populate penalty_caps_native for fast-path orders - #4956
AryanGodara merged 5 commits into
Conversation
|
Claude finished @AryanGodara's task in 3m 16s —— View job PR Review: Populate
|
Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
9f1b737 to
01a36ff
Compare
|
Claude finished @AryanGodara's task in 2m 51s —— View job PR Review: Populate
|
…ng-populate-competition_auctionspenalty_caps_native Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
…ng-populate-competition_auctionspenalty_caps_native Signed-off-by: Aryan Godara <aryangodara03@gmail.com> # Conflicts: # crates/e2e/tests/e2e/fast_path_settle.rs
MartinquaXD
left a comment
There was a problem hiding this comment.
Looks good overall. Just 2 small requests.
Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
…ng-populate-competition_auctionspenalty_caps_native Signed-off-by: Aryan Godara <aryangodara03@gmail.com>
Description
The fast-path handler earlier hardcoded 0 for penalty_cap_native, so fast-path settlements carried no enforceable cap. Now it computes the real cap for fast-path orders, the same way as a regular auction.
The cap depends only on the fixed side of the trade and native prices, not on the quote, and the handler already has both from the staged quote competition.
So this reuses the existing
PenaltyCapCalculatorrather than adding new logic, with no faspath specific changes.Changes
PenaltyCapCalculatorbw the regular auction loop and the fast-path handler, so the fast path reuses the same instance the regular loop keeps refreshed (its USD reference price feeds the absolute cap).FastPathHandler::compute_and_persist_final_execution, replacing the hardcoded 0. Falls back to 0 only when penalty caps are disabled in the config.How to test
cargo nextest run -p autopilot penaltyCloses BE-281