Skip to content

Conversation

@wphan
Copy link
Member

@wphan wphan commented Jul 16, 2025

No description provided.

maxOffsetInPrice.mul(new BN(-1)),
maxOffsetInPrice
new BN(maxOffsetPct).mul(new BN(-1)),
new BN(maxOffsetPct)
Copy link
Member Author

Choose a reason for hiding this comment

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

rust:

let inventory_pct = liquidity_fraction
.cast::<i64>()?
.safe_mul(max_offset_pct)?
.safe_div(PERCENTAGE_PRECISION.cast::<i64>()?)?
.clamp(-max_offset_pct, max_offset_pct);

@wphan wphan merged commit de8dc6d into master Jul 18, 2025
30 of 33 checks passed
@wphan wphan deleted the wphan/ref-price-offset-sdk-bug branch July 18, 2025 00:32
harsh4786 pushed a commit to harsh4786/drift-v2 that referenced this pull request Oct 23, 2025
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.

2 participants