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

fix(perp): Fix margin ratio calc when querying a trader's position #766

Merged
merged 3 commits into from
Aug 1, 2022

Conversation

NibiruHeisenberg
Copy link
Contributor

Margin ratio calc now returns the max PnL, which is what the liquidation code path uses.

Had to fix tests to account for a TWAP PnL calculation.

@AgentSmithMatrix
Copy link
Contributor

@onikonychev can you confirm by pulling this branch if this is what you expected?

@NibiruHeisenberg NibiruHeisenberg merged commit 8e89ca2 into master Aug 1, 2022
@NibiruHeisenberg NibiruHeisenberg deleted the fix/perp/margin-ratio-calc branch August 1, 2022 15:44
@onikonychev
Copy link
Contributor

@NibiruHeisenberg @AgentSmithMatrix could this be propagated to a demo branch?

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.

feat(x/perp): the 'q position' query should expose 'marginRatioMark', 'marginRatioIndex', (and 'blockHeight')
3 participants