> For the complete documentation index, see [llms.txt](https://sharwa.gitbook.io/sharwa-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sharwa.gitbook.io/sharwa-docs/for-devs/margin-account/hegicstoporders.md).

# HegicStopOrders

### Features

#### Functionality:

1. Automatically execute the option when time conditions are met.
2. Automatically execute the option when price conditions are met.

#### Examples

For example, if you buy a Call option with a strike price of $1,000, you can set up a stop market order with a trigger price of $1,100. When the trigger condition is met, the option can be exercised (closed).

HegicStopOrders uses Chainlink Automation to check the conditions of all active stop orders. When the trigger conditions are met, Chainlink Automation calls the specified function that exercises the option.

HegicStopOrders also uses Chainlink Price Oracles to determine if the price trigger condition is met.

Another functionality involves time-based triggers. You can set up a time trigger, and the positions will be closed when the trigger condition is met. For example, you can set a condition that your position should be exercised one hour before the expiration date. When the time conditions are met, Chainlink Automation will call the specified function to exercise the position.

### Support

If you have questions about how to use the SDK, please reach out in the `#dev-chat` channel in our Discord.

{% embed url="<https://github.com/SharwaFinance/HegicStopOrders>" %}


---

# 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, and the optional `goal` query parameter:

```
GET https://sharwa.gitbook.io/sharwa-docs/for-devs/margin-account/hegicstoporders.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
