> For the complete documentation index, see [llms.txt](https://docs.carbondefi.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carbondefi.xyz/contracts-and-functions/carboncontroller-functions/write-functions/strategy-management/deletestrategy.md).

# deleteStrategy()

{% code title="CarbonController.sol" overflow="wrap" lineNumbers="true" %}

```solidity
    function deleteStrategy(uint256 strategyId) 
        external 
        nonReentrant 
        whenNotPaused 
        onlyProxyDelegate
```

{% endcode %}

This function is used to delete a strategy on Carbon DeFi. Once removed, all liquidity associated to the strategy is sent to the strategy owner's wallet.&#x20;

### **Function Arguments**

<table><thead><tr><th width="149">Name</th><th width="191.66666666666663">Type</th><th>Description</th></tr></thead><tbody><tr><td>strategyId</td><td>uint256</td><td>The ID of the strategy to delete.</td></tr></tbody></table>

### Example

```solidity
deleteStrategy(
2381976568446569244243622252022377480199 //strategyId
) // Only the strategy owner can delete the strategy
```

{% hint style="success" %}
While all required data is available on chain, it is recommended to use the [Carbon DeFi SDK](/developer-guides/carbon-defi-sdk.md).
{% endhint %}


---

# 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://docs.carbondefi.xyz/contracts-and-functions/carboncontroller-functions/write-functions/strategy-management/deletestrategy.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.
