Skip to content

fix(trader): guard against division by zero and fix peak PnL logic#1422

Open
chulinhcql-art wants to merge 4 commits intoNoFxAiOS:devfrom
chulinhcql-art:fix/risk-pnl-logic
Open

fix(trader): guard against division by zero and fix peak PnL logic#1422
chulinhcql-art wants to merge 4 commits intoNoFxAiOS:devfrom
chulinhcql-art:fix/risk-pnl-logic

Conversation

@chulinhcql-art
Copy link
Copy Markdown

This PR fixes a critical logic error in drawdown monitoring. It adds a safety check for zero entry prices and fixes the Peak PnL logic to correctly handle short positions. Authored by chulinhcql-art.

@chulinhcql-art
Copy link
Copy Markdown
Author

Please use this Base (USDC) wallet for the reward: 0x061E613F450AefC5Ca0dB1A7764AE0545c968811. Thank you!

@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Mar 20, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


chulinhcql-art seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Mar 20, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


chulinhcql-art seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@chulinhcql-art
Copy link
Copy Markdown
Author

Critical fix for potential crash (division by zero). Highly recommend merging this to protect system stability.

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