Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bigz/amm spread inventory pct #374

Merged
merged 14 commits into from
Feb 28, 2023
Merged

Conversation

0xbigz
Copy link
Member

@0xbigz 0xbigz commented Feb 24, 2023

No description provided.

programs/drift/src/math/amm_spread.rs Outdated Show resolved Hide resolved
sdk/src/math/amm.ts Show resolved Hide resolved
base_asset_amount_with_amm
.abs()
.safe_mul(PERCENTAGE_PRECISION_I128)?
.safe_div(min_side_liquidity.max(1))?
Copy link
Member

Choose a reason for hiding this comment

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

could maybe just max this with PERCENTAGE_PRECISION_I128 and get rid of the min before, might make it easier to replicate in ts sdk?

sdk/src/math/amm.ts Outdated Show resolved Hide resolved
sdk/src/math/amm.ts Outdated Show resolved Hide resolved
@crispheaney crispheaney merged commit d67c73f into master Feb 28, 2023
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.

None yet

2 participants