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

cli test(perp): open a reverse position larger than the existing position #522

Conversation

kai0x
Copy link
Contributor

@kai0x kai0x commented Jun 1, 2022

No description provided.

@kai0x kai0x linked an issue Jun 1, 2022 that may be closed by this pull request
@@ -209,7 +209,30 @@ func (s *IntegrationTestSuite) TestOpenAndClosePositionCmd() {
s.Require().Equal(sdk.MustNewDecFromStr("1000000"), queryResp.Position.Margin)
s.Require().Equal(sdk.MustNewDecFromStr("999900"), queryResp.Position.OpenNotional)

// Close positions
// C. Open a reverse position larger than the existing position
args = []string{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

changes start here

AgentSmithMatrix and others added 4 commits June 1, 2022 02:44
…n-the-existing-one' of github.com-kai:NibiruChain/nibiru into 506-cli-test-open-a-reverse-position-bigger-in-size-than-the-existing-one
@kai0x kai0x marked this pull request as ready for review June 2, 2022 05:49
@kai0x kai0x requested a review from a team as a code owner June 2, 2022 05:49
"sell",
pairStr,
"1", // Leverage
"2000000", // 2 BTC (?)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is correct, we use 10^6 that represents the real unit, all the others mean decimals. This is indeed 2 BTC.

Copy link
Contributor

Choose a reason for hiding this comment

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

This argument is actually collateral amount, so it would be 2000000 unusd or uusdc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks! sounds good, let update that in my new cli test pr

"sell",
pairStr,
"1", // Leverage
"2000000", // 2 BTC (?)
Copy link
Contributor

Choose a reason for hiding this comment

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

This argument is actually collateral amount, so it would be 2000000 unusd or uusdc.

@kai0x kai0x merged commit 64d29c6 into master Jun 5, 2022
@kai0x kai0x deleted the 506-cli-test-open-a-reverse-position-bigger-in-size-than-the-existing-one branch June 5, 2022 03:39
@NibiruHeisenberg NibiruHeisenberg linked an issue Jun 17, 2022 that may be closed by this pull request
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.

cli, test: Open a reverse position bigger in size than the existing one
3 participants