> For the complete documentation index, see [llms.txt](https://yieldshield.gitbook.io/yieldshield/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yieldshield.gitbook.io/yieldshield/features/stop-loss.md).

# Stop-Loss

Finally, you can get a good night's sleep or spend a day out, knowing your investment is shielded, thanks to YieldShield’s stop-loss mechanism.

#### What is stop-loss?

**Stop-loss** is a trading tool designed to limit the maximum loss of an investment by automatically liquidating assets once the market price reaches a specified value.

YieldShield is using stop-loss to prevent the loss of the investment.

Simply specify the level of allowable drawdown and our RoboFarmer will collect your investments and rewards, swap them to th

### How does stop-loss work?&#x20;

1\) set stop-loss percentage when creating investment.

![](/files/kVPLYt3fhsjuBWIp68Ie)

2\) Every block we are checking for the updates on-chain to see all the changes in the pools and prices.

3\) If the stop-loss percentage was hit - robofarmer will exit the investment, claim rewards, convert all of it to the currency you initially invested, and send it to your wallet.

{% hint style="warning" %}
**Important:** YieldShield is not charging any platform fees when stop-loss is activated. Only a Gas Fee will be charged from the Gas wallet on the platform.&#x20;
{% endhint %}

{% hint style="warning" %}
**Important:** if you do not have enough funds on your Gas wallet - stop-loss will not be activated as the transaction can't go through. &#x20;
{% endhint %}

#### How to calculate the stop-loss percentage?&#x20;

$$
Stop \~loss , %  = 100% - \frac{Initial ,Investment} {Current ,Investment - Gas, fee}
$$

**Initial investment** - investment amount at the moment of creating the investment (calculated in USD).

**Current investment** - current value of the investment (the price of LP tokens funds are staked to) and rewards collected so far (calculated in USD).

**Gas** - the total amount of gas spent for this investment (calculated in USD).

![Stop Loss Diagram](/files/gUHfCQGggWhSfUNC3l5k)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://yieldshield.gitbook.io/yieldshield/features/stop-loss.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.
