binance-exchange / binance-java-api

binance-java-api is a lightweight Java library for the Binance API, supporting synchronous and asynchronous requests, as well as event streaming using WebSockets.
MIT License
830 stars 622 forks source link

Not a margin account #427

Open umeshy opened 2 years ago

umeshy commented 2 years ago

I'm getting error in below statement, please suggest reason for the error:

BinanceApiMarginRestClient marginClient = factory.newMarginRestClient();
        String marginlistenKey = marginClient.startUserDataStream();

Error: com.binance.api.client.exception.BinanceApiException: Not a margin account.

cezary-ptaszek commented 2 years ago

You probably don't have an open margin account in binance. Tip:

Under “Balance Details”, click on “Margin” so you can start opening a Binance margin trading account.
You need to complete the KYC identity verification and ensure that your country is not part of the blacklist. 
Enabling 2FA is also mandatory. After that, you will see a reminder regarding margin trading's risks.