# Electrum

{% hint style="danger" %} <mark style="color:red;">Before setting up auto payouts, please read the</mark> [<mark style="color:blue;">risk warning</mark>](https://premium.gitbook.io/main/en/basic-settings/merchants-and-auto-payments/auto-payments/risk-warning)<mark style="color:blue;">!</mark>
{% endhint %}

{% hint style="info" %}
If you need to update the module on the server, please refer to the [instructions](https://premium.gitbook.io/main/en/en/basic-settings/faq/updating-script-files-on-the-server/how-to-update-files-on-the-server#merchant-and-auto-payout-modules).
{% endhint %}

{% hint style="warning" %}
It is **recommended** to use [different Electrum wallets](https://premium.gitbook.io/main/en/basic-settings/modul-electrum/ustanovka-i-nastroika-electrum/sozdanie-dopolnitelnogo-koshelka) for receiving funds and for auto payouts.
{% endhint %}

## Installation and Setup of the Module

Install Electrum on the server following the [instructions](https://premium.gitbook.io/main/en/basic-settings/modul-electrum/ustanovka-i-nastroika-electrum).

Make sure to save the wallet password, the port number for connection, the server address (optional), and the login and password for wallet access in a text file.

<figure><img src="https://3137668309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwgP5ZE7DnnlT9DQMSCQz%2Fuploads%2Fgit-blob-e87e706112ec176573798040c8ecfbbfc6d87dfb%2Fimage%20(1443)_eng.png?alt=media" alt=""><figcaption></figcaption></figure>

## **Module Settings**

In the admin panel, create a new merchant in the "**Auto Payouts**" section by clicking "**Add Auto Payout**."

Select Electrum from the dropdown menu in the "**Module**" field, provide a name for the module, and click "**Save**."

<figure><img src="https://3137668309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwgP5ZE7DnnlT9DQMSCQz%2Fuploads%2Fgit-blob-8c9491ea1793c05384c4f05c66286c8b6aa5cec5%2Fimage%20(1447)_eng.png?alt=media" alt="" width="509"><figcaption></figcaption></figure>

Fill in the required authorization fields.

<figure><img src="https://3137668309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwgP5ZE7DnnlT9DQMSCQz%2Fuploads%2Fgit-blob-2c011976cd5d1d5a1a7ea0a5132075e3853fb8fa%2Fimage%20(1448)_eng.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Number of confirmations for a payment to be considered completed** — leave this field empty to use the default value set by Electrum.
* **Login** — enter the information from the "**User for connection**" field.
* **Password** — enter the information from the "**User password for connection**" field.
* **API server** — enter the information from the "**API server**" field.

{% hint style="warning" %}
The "**API Server**" field should only be filled in if the Electrum module is installed on a different server than the one where the Premium Exchanger script is located.

If the Electrum module is installed on the same server as the Premium Exchanger script, leave this field empty.
{% endhint %}

* **API port** — enter the information from the "**Port for connection**" field.
* **Wallet password** — enter the password for your wallet that you set when creating the wallet (if no password was set, leave this field empty).

## Special Fields

In the auto payout module settings, you will find the following options:

<figure><img src="https://3137668309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwgP5ZE7DnnlT9DQMSCQz%2Fuploads%2Fgit-blob-931892f77eaac78904ee2979abdac76bfd015e8a%2Fimage%20(768)_eng.png?alt=media" alt=""><figcaption></figcaption></figure>

1. Mass payouts:

* “**No**” — mass payouts are not used, and requests will be processed sequentially.
* “**Yes + instant payout by button**” — mass payouts will be enabled, and you can also make an instant single payout by clicking the “Transfer” button in the "Requests" section of the admin panel.
* “**Yes + add request to payout queue**” — mass payouts will be enabled, and when you click the “Transfer” button in the "Requests" section of the admin panel, requests will be added to the mass payout queue.

2. Commission priority — choose one of the available network fee options.

{% hint style="info" %}
The current fee for sending a payment is automatically requested from the [Mempool.space](https://mempool.space/api/v1/fees/recommended) service just before each fund payout.
{% endhint %}

3. **Minimum and maximum fee size (in bytes)** — limits for the minimum and maximum network fee size. It is recommended to set these to avoid using abnormal values.

*Recommended values: min. = 3 and max. = 100*.

4. **Minimum number of requests for mass payout** — the minimum number of requests in the queue required to trigger a mass payout. If the required number is not met, the payout will not occur.

*Recommended value = 20*.

5. **Waiting time before mass payout (in minutes)** — the time during which paid requests will accumulate before the mass payout. The countdown starts from the first paid request in the queue.

*Recommended value = 5*.

6. **CRON (mass payments)** — a link for setting up a cron job that needs to be [added to the task scheduler on the server](https://premium.gitbook.io/main/en/basic-settings/faq/kak-sozdat-zadanie-cron-na-servere). This task checks for available requests for payout and initiates the payout if there are any.

*Recommended execution time - once every minute*.

### Recommended Settings for the Above Parameters:

<figure><img src="https://3137668309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwgP5ZE7DnnlT9DQMSCQz%2Fuploads%2Fgit-blob-695e1883e78339d5012d50b9431f1a5cb6fe07fa%2Fimage%20(1449)_eng.png?alt=media" alt=""><figcaption></figcaption></figure>

With these settings, mass payouts will occur after 5 minutes if 20 paid requests are accumulated. If 5 minutes pass and there are not 20 requests, the mass payout will still occur, but with the number of requests currently in the queue.

## Continuing the Setup

Next, proceed to configure the merchant by following the [general setup instructions](https://premium.gitbook.io/main/en/basic-settings/merchants-and-auto-payments/auto-payments/obshie-nastroiki-merchantov-avtovyplat).
