# 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](https://docs.carbondefi.xyz/developer-guides/carbon-defi-sdk).
{% endhint %}
