Skip to content

0.138.0: Reconcile margin after risk-reducing order fills - #18

Merged
MathisWellmann merged 2 commits into
mainfrom
reconcize
Jul 18, 2026
Merged

0.138.0: Reconcile margin after risk-reducing order fills#18
MathisWellmann merged 2 commits into
mainfrom
reconcize

Conversation

@MathisWellmann

Copy link
Copy Markdown
Owner

Changes:

  • version 0.138.0
  • Fixed previous panic asserting available_balance >= 0, which was violated after a risk-reducing market order got filled and margin was no longer sufficient.
  • New method reconcile_margin ensures account collateral is reconciled after a fill was settled.
  • liquidate refactored into force_liquidate, avoiding possible panic paths by not going through public interface with additional checks.
  • New types ForcedCancels, Solvency and MarketOrderSettlement to ensure forced cancels of limit orders are propagated nicely through the public API.
  • Bunch more new methods on Account to help with everything.
  • Account gained a bad_debt field of losses absorbed by the venue (insurance fund / auto-deleveraging style)
  • Now position reducing orders are always accepted by the venue (as before), but the panicking assumptions are eliminated.

@MathisWellmann MathisWellmann self-assigned this Jul 18, 2026
@MathisWellmann
MathisWellmann merged commit 30d14cb into main Jul 18, 2026
1 check passed
@MathisWellmann
MathisWellmann deleted the reconcize branch July 18, 2026 19:31
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