> For the complete documentation index, see [llms.txt](https://docs.jaspervault.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jaspervault.io/development/jaspervault-sdk/option-trading.md).

# Option Trading

The option trading library helps developers buy call or put options by performing the entire option trading flow when they make an order.

### Function List

* To fetch sign data from RPC

<table data-full-width="false"><thead><tr><th>Method</th><th>Parameter Type</th><th>Error Message</th></tr></thead><tbody><tr><td><pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">fetchSignData()
</code></pre></td><td><pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">-
</code></pre></td><td><pre class="language-typescript" data-overflow="wrap"><code class="lang-typescript">'Error fetching sign data'
</code></pre></td></tr></tbody></table>

* To place an order for the option trading
  * Input an object that includes option type (Call or Put), amount, underlying asset address (e.g. ETH address), premium asset (e.g. USDT address), expiration date (e.g. 2 hours, 8 hours, 24 hours)

<table data-full-width="false"><thead><tr><th>Method</th><th>Parameter Type</th><th>Error Message</th></tr></thead><tbody><tr><td><pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">placeOrder(JVaultOrder: JVaultOrder)
</code></pre></td><td><pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript"> JVaultOrder:
(
optionType: OptionType;
  amount: BigNumber;
  underlyingAsset: Address;
  premiumAsset: Address;
  expiry: Date
)
</code></pre></td><td><pre class="language-typescript" data-overflow="wrap"><code class="lang-typescript">'Error Placing order'
</code></pre></td></tr></tbody></table>

* To settle the option order at expiration time
  * With two main parameter:
    * JVaultOrder refers to above option trading parameter
    * LiquidateType includes 'NotExercising', 'Exercising', 'ProfitTaking'

<table data-full-width="false"><thead><tr><th>Method</th><th>Parameter Type</th><th>Error Message</th></tr></thead><tbody><tr><td><pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript">liquidateOrder(JVaultOrder: JVaultOrder, liquidateType: LiquidateType)
</code></pre></td><td><pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript"> JVaultOrder:
(
optionType: OptionType;
  amount: BigNumber;
  underlyingAsset: Address;
  premiumAsset: Address;
  expiry: Date
);
<strong>LiquidateType:
</strong>(
  NotExercising,
  Exercising,
  ProfitTaking,
) // enum
</code></pre></td><td><pre class="language-typescript" data-overflow="wrap"><code class="lang-typescript">'Error liquidateOrder'
</code></pre></td></tr></tbody></table>


---

# 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://docs.jaspervault.io/development/jaspervault-sdk/option-trading.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.
