Isolated MARGIN_BUY along with AUTO_REPAY

I am looking to place an order that takes margin while placing long/short order , and if the price hits target price , close the trade and repay the margin back.
Does stopPrice allow this in the margin api ? (POST /sapi/v1/margin/order)

I understand MARGIN_BUY can be used to take margin and AUTO_REPAY to make auto-repayment , but can this be achieved in a single trade if we set a stopPrice (TAKE_PROFIT) ??

An order may have a side effect of MARGIN_BUY or AUTO_REPAY, not both. One of the side-effects must be done manually.

1 Like

Yea Understood.
Is manual intervention necessary ?
we can place order by calling 2 apis with MARGIN_BUY or AUTO_REPAY respectively right ?

You may borrow or repay via the Borrow endpoint and Repay endpoint respectively.

https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-margin
https://binance-docs.github.io/apidocs/spot/en/#margin-account-repay-margin

1 Like