Binance.Net icon indicating copy to clipboard operation
Binance.Net copied to clipboard

Increase the Maintenance Margin for futures order

Open KomodoCrypto opened this issue 2 years ago • 5 comments

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?

KomodoCrypto avatar Dec 07 '21 08:12 KomodoCrypto

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

JKorf avatar Dec 07 '21 08:12 JKorf

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.

KomodoCrypto avatar Dec 07 '21 08:12 KomodoCrypto

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

techno2mahi avatar Feb 04 '22 01:02 techno2mahi

+1

techno2mahi avatar Feb 04 '22 01:02 techno2mahi

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.

hiliev avatar Sep 05 '22 11:09 hiliev