# 2b - Connect to Binance

{% hint style="success" %}
Ensure **you have read and understood** the required prerequisites before continuing.

Please refer to **the "Must-knows" page** in the left menu.
{% endhint %}

Follow the steps below to configure a [**Binance**](https://accounts.binance.com/register?ref=S1QRJ7DZ) **account** and enable **automated management** of your funds.

### **Before proceeding**, ensure that your **SPOT wallet** contains <mark style="background-color:green;">**only USDC**</mark>.

{% hint style="info" %}
**If you have any crypto dust**, please use the functionality on Binance to **convert it to BNB**, and **then exchange those BNB for stablecoin**. Binance does not allow this to be done via API.
{% endhint %}

## Main Account Synchronization

1. **Log in** to your [**Binance**](https://accounts.binance.com/register?ref=S1QRJ7DZ) account.
2. [Click here](https://www.binance.com/en/my/settings/api-management) to access the page for generating **new API keys**.
3. Next, click the **Create API** button, choose the option: **Generated by system**, and click **Next :**&#x20;

<figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2Fo2HiYwzGClRIojalyMDY%2FBIN1.png?alt=media&#x26;token=2ac0c3be-86b1-48e3-92e3-54add37a37ab" alt=""><figcaption></figcaption></figure>

4. Label your key by naming it: **CryptoTrader**, and then click **Next :**&#x20;

<figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2FrNLJumOuK6vM7ISleSbl%2FBIN2.png?alt=media&#x26;token=67455cf2-bef3-462b-884e-e693a19805e1" alt=""><figcaption></figcaption></figure>

5. Click on **Modify restrictions** and check the box **Restrict access to trusted IP addresses only** **(recommended)**.
6. Whitelist the following **two IP addresses**, separating them by a space:
   * 35.195.13.37
   * 89.184.13.176

<figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2FhTh0MVSWrJeIDSPjkcCG%2FIPBinanceEN.png?alt=media&#x26;token=3f1894d2-bfd8-4f6d-90c4-517b507492f6" alt=""><figcaption></figcaption></figure>

5. In the API Restrictions tab, check the box **Enable Spot and Margin Trading** and click on **Save :**&#x20;

<figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2FOZpeEF5vVkqnb4YRenT6%2FBIN4.png?alt=media&#x26;token=c79f3e95-c3aa-4271-a24f-d1a962f2fb1a" alt=""><figcaption></figcaption></figure>

Your API keys have been successfully generated. Before proceeding to the final step located in the left menu of this documentation under the section '**3 - Link to CryptoTrader', please make sure to keep the window containing the newly created public and private keys open, or copy them into a temporary file.**

## Synchronizing a Sub-Account

It is possible to connect a [Binance](https://accounts.binance.com/register?ref=S1QRJ7DZ) sub-account **instead of your main account**.

This will allow you to host our automated strategy while the main account is used for your own trading operations.&#x20;

1. [Click here](https://www.binance.com/en/my/sub-account/account-management) to access the page for generating a **new sub-account,** then click on the **Create Sub-Account** button.
2. Choose **Create with email** option if you want your sub-account to be accessible via a **different email address**, which is not already used by another Binance account. The password and 2-factor authentication (2FA) will also be **separate** from your main account. \
   Choose **Create with virtual email** option if you want your sub-account to be **linked to your main account**. This sub-account will use the same login credentials you typically use, and you'll be able to switch between accounts within the same interface. This option is recommended.
3. Once you've selected your preferred option, click on **Create Sub Account**.

<div><figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2Fl5kppwPEbbWmQFIlGfcs%2FSCE1.png?alt=media&#x26;token=56ad1567-9736-445e-88d8-d7ff1c260849" alt=""><figcaption></figcaption></figure> <figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2FCym1EFkwQM9GdWQ6Wsd9%2FSouscompteEN.png?alt=media&#x26;token=49caf991-c337-424a-b467-cbfb206f8b93" alt=""><figcaption></figcaption></figure></div>

4. [Click here](https://www.binance.com/en/my/sub-account/asset-management) to go to the **Asset Management page**, then click on **Transfer In.**
5. Transfer to your sub-account the funds you wish to allocate to our **automated strategy**, then click on **Confirm.**
6. [Click here](https://www.binance.com/en/my/sub-account/api-management) to access the **API Management page**. Then click on the **Create API** button, choose the option: **System Generated**, and then click on **Next :**&#x20;

<figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2FvTGsJ7VNzADehIULb689%2FSCE2.png?alt=media&#x26;token=69ece1d3-2a00-4c8a-85f5-90cba89e6f1c" alt=""><figcaption></figcaption></figure>

6. Click on **Email** and select the sub-account linked to the email address you just generated. Label the API key as **CryptoTrader**.
7. Click on **Modify restrictions** and check the box **Restrict access to trusted IP addresses only** **(recommended)**.
8. Whitelist the following **two IP addresses**, separating them by a space:
   * 35.195.13.37
   * 89.184.13.176

<figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2FhTh0MVSWrJeIDSPjkcCG%2FIPBinanceEN.png?alt=media&#x26;token=3f1894d2-bfd8-4f6d-90c4-517b507492f6" alt=""><figcaption></figcaption></figure>

6. In the API Restrictions tab, check the box **Enable Spot and Margin Trading** and click on **Save :**&#x20;

<figure><img src="https://139071599-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoLzoLpI4GbFaDN6waLrV%2Fuploads%2FOZpeEF5vVkqnb4YRenT6%2FBIN4.png?alt=media&#x26;token=c79f3e95-c3aa-4271-a24f-d1a962f2fb1a" alt=""><figcaption></figcaption></figure>

Your API keys have been successfully generated. Before proceeding to the final step located in the left menu of this documentation under the section '**3 - Link to CryptoTrader', please make sure to keep the window containing the newly created public and private keys open, or copy them into a temporary file.**
