# updateStrategy

This function creates an unsigned transaction to update an existing strategy.

```
public async updateStrategy(
    strategyId: BigNumberish,
    encoded: EncodedStrategy,
    baseToken: { address: string; decimals: number },
    quoteToken: { address: string; decimals: number },
    buyPriceLow: string,
    buyPriceHigh: string,
    buyBudget: string,
    sellPriceLow: string,
    sellPriceHigh: string,
    sellBudget: string,
    overrides?: PayableOverrides
  )
```

<table><thead><tr><th width="172.33333333333331">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>strategyId</td><td>number</td><td>The id of the strategy to update.</td></tr><tr><td>encoded</td><td>EncodedStrategy</td><td>The encoded form of the strategy that is being updated. This can be acquired using the <a href="/pages/un1tUf2maQFRcYKHObsX">getUserStrategies</a> function. </td></tr><tr><td>baseToken</td><td>object {token address, number}</td><td>An object containing a token address and a string with the number of decimal places used for the given token.</td></tr><tr><td>quoteToken</td><td>object {token address, number}</td><td>An object containing a token address and a string with the number of decimal places used for the given token.</td></tr><tr><td>buyPriceLow</td><td>string (number)</td><td>The lowest price at which to buy the quote token, in the form of quoteTokens  per 1 baseToken. </td></tr><tr><td>buyPriceHigh</td><td>string (number)</td><td>The highest price at which to buy the quote token, in the form quoteTokens  per 1 baseToken. </td></tr><tr><td>buyBudget</td><td>string (number)</td><td>The number of base tokens to start the strategy with.</td></tr><tr><td>sellPriceLow</td><td>string (number)</td><td>The lowest price at which to buy the base token, in the form of baseTokens per 1 quote token. </td></tr><tr><td>sellPriceHigh</td><td>string (number)</td><td>The highest price at which to buy the base token, in the form of baseTokens per 1 quote token. </td></tr><tr><td>sellBudget</td><td>string (number)</td><td>The number of quote tokens to start the strategy with.</td></tr><tr><td>overrides</td><td>object (<strong>optional</strong>)</td><td>This optional object contains transaction parameters, such as gas price, Eth value, etc. See <strong>overrides</strong> in the <a href="https://docs.ethers.org/v5/api/contract/contract/#:~:text=The-,overrides,-object%20for%20a">Ethers documentation</a> for details. </td></tr></tbody></table>

### Returns

This function returns an unsigned transaction, ready to be signed and submitted to the blockchain.


---

# 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.carbondefi.xyz/developer-guides/carbon-defi-sdk/sdk-functions/updatestrategy.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.
