# Bots config

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f916">🤖</span>Forced Liquidation Protection Bot</summary>

XAPY provides a <mark style="color:green;">**Forced Liquidation Protection Bot**</mark> for situations where one side of a position becomes deficient (position imbalance) due to unforeseen circumstances such as: rapid liquidation, partial liquidation (ADL), exchange delisting, etc.

The bot will immediately close the imbalanced position if the conditions you set are triggered.

<figure><img src="/files/MrrErF3EjzFNatOBIa7S" alt=""><figcaption></figcaption></figure>

**As shown in the image above***:* You maintain a position of $100,000 in BTC tokens (long on Coinex and short on Huobi), and you configure the Forced Liquidation Protection Bot to activate if the position discrepancy reaches $3,000.&#x20;

If, for any reason, the positions on the two exchanges diverge by $3,000 (e.g., Coinex shows $50,000 while Huobi shows $47,000), the Forced Liquidation Protection Bot will activate and immediately close all BTC positions on both exchanges using market orders.

The purpose is to ensure account safety when a position imbalance breaks the Delta Neutral mechanism (ΔN = 0), preventing extraordinary losses.

<mark style="color:red;">**And this condition applies to all positions you currently hold.**</mark>

</details>

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f916">🤖</span>Automated Fund Transfer Bot</summary>

XAPY supports automated fund transfers between accounts to mitigate significant market volatility in cryptocurrency, enabling you to maintain positions for extended periods while reducing unnecessary order entries. This minimizes trading costs and slippage.

You must configure the fund transfer threshold (amount transferred per transaction) and transfer conditions (leverage limit reached, liquidation threshold for tokens, etc.).

1. **Set transfer conditions.**

* In the "Hedging Bot" section, enter the amount you want the bot to transfer each time to balance positions (you will receive 2 Telegram notifications: one for the money transfer and one for the transfer from Spot to Futures) if the trigger condition in the "Trigger hedging" section is met.
* The "Trigger hedging" section specifies the conditions for activating money transfers. There are two conditions you can use to trigger it: first, when the exchange reaches a certain leverage (Trigger Leverage), and second, when a position approaches the liquidation threshold (Positions).

<figure><img src="/files/aGJyD2s5T2rhnqALgtoK" alt=""><figcaption></figcaption></figure>

⏰<mark style="color:red;">Note that you should avoid setting the exchange leverage condition too high</mark> before transferring funds, as the price may fluctuate too quickly for the transfer to arrive in time, leading to liquidation (although the <mark style="color:green;">Forced Liquidation Protection Bot will be activated in this case</mark> to protect you, impermanent loss is still unavoidable). The default value for all exchanges is currently leverage x7.5

⏰<mark style="color:red;">Since we are in Cross Margin mode</mark>, if a token approaches liquidation and triggers the transfer feature, the funds will be distributed equally among all existing positions on that exchange, rather than just for that specific token. Therefore, you should not set the trigger point too close to the liquidation price to ensure safety and allow enough time for the funds to arrive. The default value for all tokens is currently 70%, but you can certainly modify this.

<figure><img src="/files/K2LfdAd7iIX26PdrPyGJ" alt=""><figcaption><p>💡Small tip: For tokens with low volatility (less than 10-20% in a short period), you can safely set the trigger conditions slightly further apart.</p></figcaption></figure>

2. **Track transfer history or transfer manually.**

Beyond automated transfers, you can also manually transfer funds through XAPY’s interface&#x20;

* Select the sending exchange, select the receiving exchange, enter the transfer amount, enter the 2FA code, then click "Transfer."

<figure><img src="/files/vn2zHDfOqw2z6LvOgWAv" alt=""><figcaption><p>You can track the transfer and receipt status directly via the txt hash.</p></figcaption></figure>

* If the API is under maintenance or you have not granted Read-Write permissions for the API, please access the exchange directly to transfer manually.

**Note:** An exchange that is in the process of transferring funds cannot accept further transfers until the current transfer is completed.&#x20;

However, an exchange can receive funds from multiple sources simultaneously without waiting for previous pending transfer statuses to complete.

</details>

<details>

<summary><span data-gb-custom-inline data-tag="emoji" data-code="1f916">🤖</span>Configuring Order Entry/Exit Bot</summary>

* XAPY provides a free simultaneous order entry/exit bot across two exchanges directly in your web browser. You must keep the browser window open while executing orders; only close it after completing the order entries or after disabling the bot.

<figure><img src="/files/HXpY7j9E4EgZ9jyeOTey" alt=""><figcaption></figcaption></figure>

* For professional institutional users, you may purchase your own server and deploy XAPY’s Bot Master from GitHub to execute unlimited position orders. In this scenario, you can control the bot through XAPY’s bot management interface without needing to maintain an open browser window.

<figure><img src="/files/NBnPIopPAkSOK9zEjvfv" alt=""><figcaption></figcaption></figure>

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xapy.io/setup/on-xapy-platform/bots-config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
