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

Increase the Maintenance Margin for futures order #944

Open
KomodoCrypto opened this issue Dec 7, 2021 · 5 comments
Open

Increase the Maintenance Margin for futures order #944

KomodoCrypto opened this issue Dec 7, 2021 · 5 comments

Comments

@KomodoCrypto
Copy link

KomodoCrypto commented Dec 7, 2021

I am using the library in my application to handle spot and futures orders successfully. However, I am being liquidated in futures orders because a very small maintenance ratio of the orders.

Context example: future LONG order, with shares calculated based on 100$. My account has 500$ with available isolated leverage x10.

var resultPlaceOrder = privateClient.FuturesUsdt.Order.PlaceOrderAsync("AVAXUSDT", OrderSide.Buy, OrderType.Market, newClientOrderId: DateTimeEntry, quantity: shares).Result;

The order is executed successfully.

Problem: the margin is set to only about 2$, and the liquidation price is consequently 98$. Why?
If I add some margin, 100$, with following method, it works too:

    `var result = privateClient.FuturesUsdt.ModifyPositionMarginAsync("AVAXUSDT", 100m, FuturesMarginChangeDirectionType.Add).Result;`

Then my liquidation price is calculated and set as expected, so I assume that it is not a matter of margin funds. But, this is obviously not a solution, because it’s too risky, so between the order execution event and the execution of margin increase, there are a few ms that can liquidate the future.

I am then stacked trying to know why the default maintenance ratio is so low… These lower values don't make sense to me. How could I increase it? How the default maintenance margin is calculated? Is there any method to set it into my account?

@JKorf
Copy link
Owner

JKorf commented Dec 7, 2021

I don't have enough knowledge about this to answer you. You could try this Binance API forum:
https://dev.binance.vision/

@KomodoCrypto
Copy link
Author

Ok, I do, thanks. If anybody else faced the same problem, I keep this thread open for discussion. I will post the answer or related link from binance here if any. Thank you for your great work.

@techno2mahi
Copy link

+1
Looking for the same API where I can increase the margin of placed orders.

@techno2mahi
Copy link

+1

@hiliev
Copy link

hiliev commented Sep 5, 2022

This happens because you are in isolated margin mode. When in cross margin mode, all the available funds in the futures wallet are used as margin shared between all assets. When in isolated margin mode, the initial margin for a particular asset is the notional value divided by the leverage, i.e. it is equivalent to what you are paying to open the position. This is described in the documentation, more specifically the liquidation price calculation page notes that in isolated mode only the isolated position margin counts and the cost page shows that the initial margin is the notional value divided by the leverage.

You have to manually allocate more or less margin funds to an isolated position and so manage the risk. This is the sole reason isolated positions exist.

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

No branches or pull requests

4 participants